tvm icon indicating copy to clipboard operation
tvm copied to clipboard

[Bug] Legalization for nn.dense on cuda does not account for change of units

Open lazycal opened this issue 5 years ago • 1 comments

Minimum code to reproduce:

import tvm
from tvm import relay

x = relay.var('x', shape=(32, 128), dtype='float16')
y = relay.var('y', shape=(20, 128), dtype='float16')
x1 = relay.nn.dense(x, y, units=20)
func = relay.Function([x,y], x1)
mod = tvm.IRModule.from_expr(func)

with tvm.transform.PassContext(opt_level=3):
    with tvm.target.Target('cuda'):
        lib = relay.optimize(mod)

A quick fix would be adding one line of code new_attrs['units'] = None before here (but that may not be desired since it makes a originally non-None units None).

lazycal avatar Jul 19 '21 22:07 lazycal

Closed as it's already fixed in this PR: https://github.com/apache/tvm/pull/9030

lazycal avatar Sep 17 '21 01:09 lazycal