PYTORCH_FUSION_DEBUG=1 gives blank output

I have seen in several places examples using PYTORCH_FUSION_DEBUG=1 to retrieve the source of the fused kernels (for example here [JIT] Fusion of Dropout without constant is_training parameter is unsuccessful · Issue #24032 · pytorch/pytorch · GitHub), I am assuming this dumps it to stdout, but when run with this variable set I see nothing.

Could anyone give advice on how to get this working? Perhaps I need to compile PyTorch with specific flags set?

PyTorch has 3 fusers (legacy, NNC/TensorExpr fuser, and cuda/nvFuser), the PYTORCH_FUSION_DEBUG only worked for the old (now legacy) fuser.
For the newer fusers, you probably could get some info from the logging facility described here:

Best regards


1 Like

Great, thanks for the quick reply!