Torch._dynamo.config.log_level

Hi,
I’m trying to generate some debug traces using torch._dynamo.config, as demo’d in this talk. Looks like the log_level attribute is no longer defined in torch/_dynamo/config.py.
When I set torch._dynamo.config.log_level = logging.DEBUG, I get the following error.

File "/home/pytorch-cuda/my_scripts/model.py", line 13, in <module>
    dcfg.log_level = logging.DEBUG
  File "/home/pytorch-cuda/torch/_dynamo/config_utils.py", line 72, in __setattr__
    raise AttributeError(f"{self.__name__}.{name} does not exist")
AttributeError: torch._dynamo.config.log_level does not exist

Thanks!

A lot changed for logging, this is what I’d suggest you poke around in torch._logging — PyTorch main documentation

1 Like

Thanks for pointing me in the right direction. I found the new debug config API here(https://pytorch.org/docs/main/generated/torch._logging.set_logs.html#torch._logging.set_logs).