Thanks to visit codestin.com
Credit goes to github.com

Skip to content

TORCH_COMPILE_DEBUG=1 does not consistently generate debug logs #152374

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโ€™ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
xuxalan opened this issue Apr 28, 2025 · 0 comments
Open

TORCH_COMPILE_DEBUG=1 does not consistently generate debug logs #152374

xuxalan opened this issue Apr 28, 2025 · 0 comments
Labels
module: dynamo module: logging Features which make it easier to tell what PyTorch is doing under the hood oncall: pt2 triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module

Comments

@xuxalan
Copy link

xuxalan commented Apr 28, 2025

๐Ÿ› Describe the bug

I am trying to collect log files generated during torch.compile execution for debugging purposes, but the files do not always appear.

I created the following simple test script:

import torch
import torch.nn as nn
import torch.nn.functional as F

device = torch.device("cuda")

class SimpleModel(nn.Module):
    def __init__(self):
        super(SimpleModel, self).__init__()
        self.proj1 = nn.Linear(10, 10)
        self.proj2 = nn.Linear(10, 10)

    def forward(self, x):
        x = F.relu(self.proj1(x))
        x = self.proj2(x)
        return x

torch.compiler.reset()
model = SimpleModel()
model.to(device)
compiled_model = torch.compile(model)

x = torch.randn(1, 10).to(device)
y = compiled_model(x)

Observed behavior:

After a reboot, the debug log files are correctly generated under torch_compile_debug/<log_dir>/torchinductor/model__0_forward_1.0/. However, no new log files are generated when running the script again without rebooting. This might be related to a cache issue.

Expected behavior:

TORCH_COMPILE_DEBUG=1 would consistently generate debug logs, without requiring a system reboot.

Error logs

No debug files generated.

Versions

env.txt

cc @chauhang @penguinwu @voznesenskym @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @chenyang78 @kadeng @amjames

@zou3519 zou3519 added module: logging Features which make it easier to tell what PyTorch is doing under the hood triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module module: dynamo labels May 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
module: dynamo module: logging Features which make it easier to tell what PyTorch is doing under the hood oncall: pt2 triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module
Projects
None yet
Development

No branches or pull requests

2 participants