Skip to content

[Error messages/documentation] BiasAddRel indexes into a shape, does not fail gracefully for scalars #7466

@slyubomirsky

Description

@slyubomirsky

The following program does not type check and arguably shouldn't, but the error message is an internal check failure rather than a proper error message stating what the error is

import tvm
from tvm import relay
mod = tvm.IRModule()
mod["main"] = relay.Function([], relay.nn.bias_add(relay.const(1), relay.const(2), axis=0))
mod = relay.transform.InferType()(mod)

The error message is:

---------------------------------------------------------------
An internal invariant was violated during the execution of TVM.
Please read TVM's error reporting guidelines.
More details can be found here: https://discuss.tvm.ai/t/error-reporting/7793.
---------------------------------------------------------------
  Check failed: false == false: [21:00:55] /home/sslyu/tvm/include/tvm/runtime/container.h:683:
---------------------------------------------------------------
An internal invariant was violated during the execution of TVM.
Please read TVM's error reporting guidelines.
More details can be found here: https://discuss.tvm.ai/t/error-reporting/7793.
---------------------------------------------------------------
  Check failed: 0 <= i && i < p->size_ == false: IndexError: indexing 0 on an array of size 0

The cause is indexing into the input shape at this line, but there should probably be a more informative error message than this. (I was just looking at some type relations when I noticed this. I imagine there are probably also failure cases that should be handled more gracefully.)

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