-
Notifications
You must be signed in to change notification settings - Fork 25.7k
Fix SVD forward-mode AD multiplication priority #161027
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
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/161027
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 8b78279 with merge base 3c8c509 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
Signed-off-by: redwrasse <mail@redwrasse.io>
0cb10f2 to
8b78279
Compare
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.
Thanks!
|
@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 |
Multiplication order priority for the SVD JVP appears to have been the opposite of the optimal one. Results from a crude CPU benchmark on my laptop for random matrices of various ratios: ``` Performance Results Table | Test Case | Matrix Size | Aspect Ratio | Before JVP (ms) | After JVP (ms) | Change (ms) | % Change | Status | |----------------------------------|-------------|--------------|-----------------|----------------|-------------|----------|---------------------| | Tall matrix (10:1 ratio) | 1000×100 | 10:1 tall | 3.13 | 3.24 | +0.11 | -3.5% | ❌ Regression | | Tall matrix (10:1 ratio, larger) | 2000×200 | 10:1 tall | 15.72 | 14.66 | -1.06 | +6.7% | ✅ Improvement | | Tall matrix (10:1 ratio, large) | 5000×500 | 10:1 tall | 105.97 | 101.84 | -4.13 | +3.9% | ✅ Improvement | | Wide matrix (1:10 ratio) | 100×1000 | 1:10 wide | 5.90 | 4.64 | -1.26 | +21.4% | ✅ Major Improvement | | Wide matrix (1:10 ratio, larger) | 200×2000 | 1:10 wide | 18.29 | 17.78 | -0.51 | +2.8% | ✅ Improvement | | Wide matrix (1:10 ratio, large) | 500×5000 | 1:10 wide | 137.40 | 128.70 | -8.70 | +6.3% | ✅ Improvement | | Square matrix (baseline) | 1000×1000 | 1:1 square | 116.16 | 106.09 | -10.07 | +8.7% | ✅ Improvement | | Square matrix (larger baseline) | 2000×2000 | 1:1 square | 714.30 | 673.23 | -41.07 | +5.7% | ✅ Improvement | ``` Pull Request resolved: pytorch#161027 Approved by: https://github.com/soulitzer
Multiplication order priority for the SVD JVP appears to have been the opposite of the optimal one.
Results from a crude CPU benchmark on my laptop for random matrices of various ratios: