Skip to content
This repository was archived by the owner on Aug 1, 2025. It is now read-only.

Conversation

@yushangdi
Copy link
Contributor

@yushangdi yushangdi commented Jul 28, 2022

Reland #665.

Previously reverted by #673, because waiting for a pytorch PR to land - pytorch/pytorch#82368. Now the pytorch PR is landed.

creates a fx graph of the buffers generated by lowering

with this patch you can run e.g.

INDUCTOR_SCHEDULER_GRAPH=1 python benchmarks/torchbench.py --training --devices=cuda --inductor --skip-accuracy-check -n 1 --isolate -k hf_Bert

to dump the forward and backward graphs of compute-buffers of hf_Bert. The resulting svg file will be in torchbenchmark/.

The dumped files' names are in the format of {model_name}_{graph_type}.svg.
If #673 is not in pytorch, the dumped graph's name is model.svg.

Also the dumping is quite slow, so for large models like hf_Bert, you would want to change the number of layers to a small number.

The graph dumped looks like this: https://www.svgviewer.dev/s/PpmacAjw

image

@yushangdi yushangdi merged commit 9ecbdae into main Jul 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants