How do we enable diagnostics?

Title says it all. I know this is for a different framework (torch-mlir) but I assume the steps to be the same!

I am trying to print diagnostic information of each the operations in my PyTorch code. This is similar to the one listed here on the MLIR website. I do see something a function definition given here for the diagnostic engine but the function is not being called when I ran the debugger here.

Is there any I can enable this in-Python? I am not using the command-line to run the torch-mlir-opt tool. Thanks :)!

Something like this should call that function.

from torch_mlir.dialects.torch.importer.jit_ir import ModuleBuilder
mb = ModuleBuilder()

Ideally, we would split out that function – the whole ModuleBuilder class needs an overhaul.

Nopes, didn’t work for me - it does call the ModuleBuilder function yes, just doesn’t call the diagnostic messages