TVM Optimizations

Hello,

I would like to evaluate TVM backend optimizations passes. Is there a way that I can control the application and order of optimization passes in TVM?

Thanks

I’m not sure what you mean by TVM “backend” optimizations, but if you mean the optimization passes run on tir by TVM, then I think one way to modify/remove those passes is in the tvm.lower method in the build_module.py file. Since its just a python file, so you wouldn’t need to recompile TVM to use those changes.

If by backend you mean the passes run by the target code generators, like the LLVM passes for the llvm target, then that probably depends on the backend. For llvm I think you can take a look at codegen_llvm.cc where it looks like -O3 optimization flag is passed. I’m not sure if there’s a direct way to pass in LLVM flags for any given target.

1 Like

@sanirudh. Thanks for the directions. It is helpful.

1 Like