Skip to content

Instantly share code, notes, and snippets.

@shunting314
Created December 30, 2025 06:16
Show Gist options
  • Select an option

  • Save shunting314/905e2f23bf363e576c219c237e07d182 to your computer and use it in GitHub Desktop.

Select an option

Save shunting314/905e2f23bf363e576c219c237e07d182 to your computer and use it in GitHub Desktop.
import torch
x = torch.randn(1024, device="cuda")
g = torch.cuda.CUDAGraph()
with torch.cuda.graph(g):
# print(x)
y = x + 1
print(g.pool())
print(torch.cuda.memory_snapshot())
breakpoint()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment