Debug Hints

AITemplate is a new project under active development. We have a rich test set to avoid bugs but don’t be surprised if there is anything unexpected.

Here are some helpful tips we learned during the development of AITemplate:

  1. Once the codegen for op which requires profiling is changed, remember to delete old profilers (usually located at workdir), and flush the cache by either deleting ~/.aitemplate or setting the environment variable FLUSH_PROFILE_CACHE=1.

  2. Check the pseudo code/visualization generated by each optimization pass if some optimization behaves in unexpected way.

  3. Always do the numerical test, from small to large, to make sure the entire model is correct.

  4. Try to make the new fusion subgraph work in a manual way, then try to add an automatic pass to rewrite the graph with the fused subgraph.