Can we dump the intermediate files to explore the optimization process when building a model using nnvm.compiler.build()?
You are in luck. There is a mechanism that does exactly what you want.
When building TVM function, enable
dump_ir_pass option, like this:
with tvm.build_config(dump_ir_pass=True): tvm.build(...)
This will dump all intermediate IRs in a current directory.
@masahi Thanks very much
I add the tvm.build_config statement in my code like this:
with nnvm.compiler.build_config(opt_level=2): with tvm.build_config(dump_pass_ir=True): graph, lib, params = nnvm.compiler.build(sym, target, shape_dict, params=params)
and it dump out almost 2000 files, does those files contain the graph level optimization process in NNVM?
Do you have a good learning road map to understand those files?
This flag only dumps passes in tvm, but there are only 40+ passes in tvm, so you may have like 50+ layers in your model you are building. each of them run thru all passes of tvm, so you have 40*50 files.
if you wanna know what’s happening in each pass, you may choose one layer dump files(40+).