Viztracer + torch.compile never exits
Author: mwlonCreated May 7, 2025Updated May 9, 2025
Here's a simple script that runs forever when run with viztracer -- <this file>
import torch
@torch.compile
def add(x, y):
return x + yIt appears this is due to the torch compile inductor workers: I believe this is where they're spawned, so they only die on parent process exit. But viztracer waits for its children to die first, so we get stuck in an infinite loop.
Source: gaogaotiantian/viztracer