Skip to content

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

Description

@lazycal

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).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions