Skip to content
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

[ONNX] Re-purpose 'name' field of GraphProto #107408

Closed
wants to merge 5 commits into from

Conversation

BowenBao
Copy link
Collaborator

@BowenBao BowenBao commented Aug 17, 2023

Stack from ghstack (oldest at bottom):

Previously, the top level GraphProto is hardcoded with name "torch_jit", and the subgraphs "torch_jit_{count}". It does not offer any insight to the graph, but rather encodes the graph producer as jit (torchscript). This is no longer true now that the graph can also be produced from dynamo.

As a naive first step, this PR re-purposes the name, to "main_graph", and "sub_graph_{count}" respectively. More delicate processing can be done to name the subgraphs with respect to their parent node or module. This can be done as follow ups.

@pytorch-bot
Copy link

pytorch-bot bot commented Aug 17, 2023

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/107408

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit 51e2e68 with merge base 3f3479e (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@pytorch-bot pytorch-bot bot added the release notes: onnx torch.onnx related changes that should show up in the release notes label Aug 17, 2023
BowenBao added a commit that referenced this pull request Aug 17, 2023
ghstack-source-id: 0a6e24f20488f57c42be426ea93951f7181abdd0
Pull Request resolved: #107408
@titaiwangms titaiwangms self-requested a review August 22, 2023 05:02
@BowenBao BowenBao added the ciflow/trunk Trigger trunk jobs on your pull request label Aug 22, 2023
@justinchuby justinchuby added the module: onnx Related to torch.onnx label Aug 22, 2023
…urpose 'name' field of GraphProto"


Previously, the top level GraphProto is hardcoded with name "torch_jit", and the subgraphs "torch_jit_{count}". It does not offer any insight to the graph, but rather encodes the graph producer as jit (torchscript). This is no longer true now that the graph can also be produced from dynamo.

As a naive first step, this PR re-purposes the name, to "main_graph", and "sub_graph_{count}" respectively. More delicate processing can be done to name the subgraphs with respect to their parent node or module. This can be done as follow ups.

[ghstack-poisoned]
pytorchmergebot pushed a commit that referenced this pull request Aug 23, 2023
…107409)

Enclose source package of modules that are exported as onnx local function in exported onnx model. GPT2 model example:

<img width="350" alt="image" src="https://github.com/pytorch/pytorch/assets/9376104/5e361bdd-ca24-45e7-a9ba-191c35acf3bb">

Pull Request resolved: #107409
Approved by: https://github.com/justinchuby
ghstack dependencies: #107408
pytorchmergebot pushed a commit that referenced this pull request Aug 23, 2023
Summary:

- Remove experimental rules that were never used.
- Fill in detailed rule descriptions.
Pull Request resolved: #107653
Approved by: https://github.com/justinchuby, https://github.com/titaiwangms
ghstack dependencies: #107408, #107409
pytorchmergebot pushed a commit that referenced this pull request Aug 23, 2023
Summary:
- Log fx graph name for 'fx-graph-to-onnx' diagnostic.
- Log fx graph and onnx graph under DEBUG verbosity level for 'fx-graph-to-onnx' diagnostic.
- Adjust unittest to run with diagnostics verbosity level logging.DEBUG.
- Sarif logs will be saved for unittest when `TORCH_LOGS="onnx_diagnostics"` is set.

<img width="640" alt="image" src="https://github.com/pytorch/pytorch/assets/9376104/a5718530-3594-46fb-85a2-b8bcc8ba01c7">

Pull Request resolved: #107654
Approved by: https://github.com/justinchuby, https://github.com/titaiwangms
ghstack dependencies: #107408, #107409, #107653
@facebook-github-bot facebook-github-bot deleted the gh/BowenBao/288/head branch August 27, 2023 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ciflow/trunk Trigger trunk jobs on your pull request Merged module: onnx Related to torch.onnx open source release notes: onnx torch.onnx related changes that should show up in the release notes topic: improvements topic category
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

5 participants