Creating a custom pass torch 1.8.0

is there are new way to create a custom transformation pass in torchscript with torch1.8.0 ?

just like here: pytorch_compiler_tutorial/register.cpp at master · bwasti/pytorch_compiler_tutorial · GitHub

torch.jit.trace() doesnt call: RegisterPass pass anymore

1 Like

Hey Andre, I am curious, were you able to find a solution to this issue? I haven’t looked at 1.8 but I am interested in hearing what you found out.

No. I havent found a solution yet.
Anyone can help out?

RegisterPass still is the right thing to do (or use registerPostPass if you want to call something - RegisterPass is just a trick to call registerPostPass at initialization, there also is a registerPrePass to get an earlier graph). Note that custom passes are not called during the tracing/scripting phase of the JIT but during the optimization phase in the graph executors.
I once wrote a overview blog post about the runtime phases.

Best regards

Thomas

1 Like

Thank you very much for the explanation

1 Like