Opt_level=0 and required_pass = ['FoldConstant'] leaded to crash!

Crash description

When opt_level =0, and required_pass = ['FoldConstant'] , the compilation crashed. Is the crash due to the bug in TVM? If not, are there any restrictions on using required_pass?

To ensure this crash is related with opt_level and required_pass, I did some related experiments. Experiment-1: set opt_level= 1,2,3 and 4 -------> no bug.
Experiment-2: set required_pass = other passes excluded foldconstant ----> no bug.
Experiment-3: use other model, ---->the bug stll exists.

In conclusion, this bug is related with opt_level and required_pass and not related with models.

Script for reproducing

import keras
import tvm
import tvm.relay as relay

model_path = '/share_container/data/keras_model/xception-imagenet_origin.h5'
predict_model = keras.models.load_model(model_path)
shape_dict = {"input_7": (1,3,299,299)}
irmod, params = relay.frontend.from_keras(predict_model, shape_dict)

target = 'llvm'
ctx = tvm.cpu(0)

required_pass = ['FoldConstant']
with tvm.transform.PassContext(opt_level=0, disabled_pass=None, required_pass=required_pass):
   graph, lib, params = relay.build_module.build(irmod, target, params=params)

Crash Message

You can receive the model from this link:

TVM : 0.8.dev0
OS: Ubuntu 16.04

Hope someone give me some advice, Thanks for advance!

@tqchen @merrymercy @FrozenGene @Wheest Can you give me some advice about this crash? Thanks in advance.

As the error says, op fusion is required to run any non trivial model. However, opt_level = 0 disables fusion.

1 Like

@masahi I understand. Thank you!