Issues due to logging in torch.compile()

I am trying to run forward() function of a model with eager and torch.compile() mode.
It runs fine on eager but with torch.compile() I see following issue

msg = 'Logger not supported for non-export cases'

    def unimplemented(msg: str, *, from_exc: Any = _NOTHING) -> NoReturn:
        assert msg != os.environ.get("BREAK", False)
        if from_exc is not _NOTHING:
            raise Unsupported(msg) from from_exc
>       raise Unsupported(msg)

Is this expected or issue from torch side?

1 Like

Many improvements to torch.compile() have been made in PyTorch 2.1 and later versions. If you’re using an older version, update PyTorch:
Try enabling full graph mode for torch.compile:

python

Copy code

model = torch.compile(model, mode="max-autotune", fullgraph=True)

I am using pytorch 2.4 and passing fullgraph=True. however I am not sure about max-autotune mode. Is it relevant to issue faced by me?