10000 [ONNX] Refactor dispatcher and registry by justinchuby · Pull Request #147396 · pytorch/pytorch · GitHub
[go: up one dir, main page]

Skip to content

Conversation

justinchuby
Copy link
Collaborator
@justinchuby justinchuby commented Feb 18, 2025

Stack from ghstack (oldest at bottom):

This PR sets up the registry to accept onnx decomp functions to be moved into PyTorch (#139301).

The ops from onnx script are currently appended to the registry. When the ops are moved into PyTorch, the moved ops takes precedence because they appear first in the registry list.

After the migration hooks for loading ops from onnx script will be removed.

  1. Use a private field _pt_onnx_signature to store function signatures to avoid conflicts
  2. Update the registry to record the signature in OnnxDecompMeta and update the dispatcher to leverage the data structure
  3. Update registry to prepare for onnx op registration, and update the the onnx_impl decorator to support a no_compile option

Signed-off-by: Justin Chu justinchuby@users.noreply.github.com

[ghstack-poisoned]
Copy link
pytorch-bot bot commented Feb 18, 2025

🔗 Helpful Links

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

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

✅ You can merge normally! (3 Unrelated Failures)

As of commit 200da36 with merge base bd370c1 (image):

FLAKY - The following jobs failed but were likely due to flakiness present on trunk:

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

@justinchuby justinchuby added module: onnx Related to torch.onnx topic: not user facing topic category labels Feb 18, 2025
@justinchuby justinchuby requested review from albanD and malfet February 18, 2025 20:24
justinchuby added a commit to justinchuby/pytorch that referenced this pull request Feb 18, 2025
Refactor dispatcher and registry to
1. Use a private field `_pt_onnx_signature` to store function signatures to avoid conflicts
2. Update the registry to record the signature in OnnxDecompMeta and update the dispatcher to leverage the data structure
3. Update registry to prepare for onnx op registration, and update the the onnx_impl decorator to support a no_compile option

Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>

ghstack-source-id: fea9b1d
Pull Request resolved: pytorch#147396
[ghstack-poisoned]
[ghstack-poisoned]
justinchuby added a commit to justinchuby/pytorch that referenced this pull request Feb 19, 2025
Refactor dispatcher and registry to
1. Use a private field `_pt_onnx_signature` to store function signatures to avoid conflicts
2. Update the registry to record the signature in OnnxDecompMeta and update the dispatcher to leverage the data structure
3. Update registry to prepare for onnx op registration, and update the the onnx_impl decorator to support a no_compile option

Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>

ghstack-source-id: 4e551da
Pull Request resolved: pytorch#147396

Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
@pytorch pytorch deleted a comment from pytorch-bot bot Feb 19, 2025
@justinchuby justinchuby added the ciflow/trunk Trigger trunk jobs on your pull request label Feb 19, 2025
justinchuby added a commit to justinchuby/pytorch that referenced this pull request Feb 19, 2025
Refactor dispatcher and registry to
1. Use a private field `_pt_onnx_signature` to store function signatures to avoid conflicts
2. Update the registry to record the signature in OnnxDecompMeta and update the dispatcher to leverage the data structure
3. Update registry to prepare for onnx op registration, and update the the onnx_impl decorator to support a no_compile option

Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>

ghstack-source-id: 4e551da
Pull Request resolved: pytorch#147396

Signed-off-by: Justin Chu <justinchuby@users.noreply.github.com>
@justinchuby
Copy link
Collaborator Author

@pytorchbot merge -i

@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged while ignoring the following 3 checks: linux-binary-manywheel / manywheel-py3_9-cuda12_4-test / test, linux-binary-manywheel / manywheel-py3_9-cuda12_6-test / test, linux-binary-manywheel / manywheel-py3_9-cuda12_8-test / test

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

pytorchmergebot pushed a commit that referenced this pull request Feb 19, 2025
Create scaffold for onnx op test data and common logic. This PR creates the scaffolding for new onnx decomp functions described in #139301. It adds two ops: abs and add, and enables the related tests.

#139301
Pull Request resolved: #147392
Approved by: https://github.com/titaiwangms
ghstack dependencies: #147396
@github-actions github-actions bot deleted the gh/justinchuby/109/head branch March 27, 2025 02:10
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: not user facing topic category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

0