Relay.build_config optimization level

Hi alpha930,

I don’t know whether you have got the answer. It not, hope my reply will help you.

I’m new user of TVM too. After reading source code to understand when optimization passes are applied, I’d like to give my views on your question.

I don’t know where you modified source code, maybe you modified at the wrong position. You can see in the src/relay/backend/build_module.cc file(about #325 line), many passes are pushed back pass_seqs, and a sequential pass is created by pass_seqs. The construction of sequential pass will determine which passes will be reserved according to opt_level. You can see the related codes in src/relay/pass/pass_manager.cc(about 405 line), SequentialNode will traverse all passes to check whether this pass is enabled. You can modify pass_manager.cc to see which passes are allowed.