areusch opened a new issue #6653:
URL: https://github.com/apache/incubator-tvm/issues/6653
We should not abort() the whole Python instance just because someone passed
the incorrect data type (or, as seems more likely in this case, the parser is
misconfigured to produce `kTVMObjectHandle` from `data_layout` attributes
instead of `kTVMStr`).
To reproduce at `2cfbd093be048ca04cbedd36e9c63f76e2e59bce`, create
`repro_bug.py`:
```
import tvm
RELAY_MODEL = """
#[version = "0.0.5"]
def @main(%data : Tensor[(1, 64, 64, 3), uint8], %conv0_weight : Tensor[(5,
5, 8, 3), int8]) {
%1 = nn.conv2d(
%data,
%conv0_weight,
padding=[2, 2],
channels=32,
kernel_size=[5, 5],
data_layout="NHWC",
kernel_layout="HWOI",
out_dtype="int32");
%1
}
"""
model = tvm.parser.fromtext(RELAY_MODEL)
```
Output:
```
$ poetry run python3 repro_bug.py
libc++abi.dylib: terminating with uncaught exception of type tvm::AttrError:
AttributeError:relay.attrs.Conv2DAttrs: Cannot find required field
'data_layout' during initialization.If the key is defined check that its type
matches the declared type.
Abort trap: 6
```
Expected output:
```
Expect str
```
(I.e. the LOG(FATAL)
[here](https://github.com/apache/incubator-tvm/blob/8348a44b9a915fe2fb2ead44c8bf3d1be126ff8d/include/tvm/ir/attrs.h#L418))
Really, we expect a proper error raised, but it would have the same effect
on this bug.
cc @jroesch @tqchen
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]