-
Notifications
You must be signed in to change notification settings - Fork 25.7k
[ONNX] Remove enable_fake_mode and exporter_legacy #161222
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
Conversation
Signed-off-by: Justin Chu <justinchu@microsoft.com>
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/161222
Note: Links to docs will display an error until the docs builds have been completed. ⏳ No Failures, 12 PendingAs of commit 9e08dfe with merge base bbc7c03 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR removes the enable_fake_mode function and legacy exporter infrastructure from PyTorch's ONNX export module. The removal addresses compatibility issues with the latest transformers library versions and simplifies the codebase by eliminating deprecated functionality.
- Removes
enable_fake_modefunction and related fake tensor export capabilities - Deletes legacy FX-based serialization and patching utilities
- Removes corresponding test cases and documentation references
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| torch/onnx/_internal/fx/serialization.py | Entire file deleted - contained external data serialization utilities |
| torch/onnx/_internal/fx/patcher.py | Entire file deleted - contained PyTorch patching context manager |
| torch/onnx/_internal/fx/passes/_utils.py | Entire file deleted - contained FX pass utility functions |
| torch/onnx/_internal/fx/init.py | Entire file deleted - package initialization |
| torch/onnx/_internal/_exporter_legacy.py | Entire file deleted - contained enable_fake_mode implementation |
| torch/onnx/init.py | Removes enable_fake_mode import and export |
| test/onnx/exporter/test_api.py | Removes fake tensor export tests, reorganizes remaining tests |
| docs/source/onnx_export.md | Removes enable_fake_mode documentation reference |
| docs/source/onnx.md | Removes enable_fake_mode documentation reference |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Signed-off-by: Justin Chu <justinchu@microsoft.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is it no longer compatible with latest transformers? What's the error?
I got a module not found error - but I need to double check if it is due to my environment |
|
I got transformers.modeling_utils was not found. Maybe it needs to be imported differently because the source code was still there. In any case there are better weights to get a config-only model, and we should not encode too much knowledge about hf libraries as patches here. |
|
@pytorchbot merge |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
|
@pytorchbot merge -f "all relevant tests passed" |
|
The merge job was canceled or timed out. This most often happen if two merge requests were issued for the same PR, or if merge job was waiting for more than 6 hours for tests to finish. In later case, please do not hesitate to reissue the merge command |
Merge startedYour change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes). Please use Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Remove enable_fake_mode and exporter_legacy entirely. Even though this is bc breaking, `enable_fake_mode` is no longer compatible with the latest version of transformers, and so it is no longer useful. Pull Request resolved: pytorch#161222 Approved by: https://github.com/titaiwangms
Remove enable_fake_mode and exporter_legacy entirely. Even though this is bc breaking,
enable_fake_modeis no longer compatible with the latest version of transformers, and so it is no longer useful.cc @titaiwangms