Repository navigation
Conversation
Related to #98467 After: 9:45? [ghstack-poisoned]
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/127061
Note: Links to docs will display an error until the docs builds have been completed. ✅ You can merge normally! (1 Unrelated Failure)As of commit 32fea7b with merge base 194950c ( UNSTABLE - The following job failed but was likely due to flakiness present on trunk and has been marked as unstable:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
aorenste
marked this pull request as ready for review
May 24, 2024 15:13
peterbell10
reviewed
May 24, 2024
Related to #98467 The tacotron2 benchmark creates a lot of nodes which fusion then checks. This improves some of the perf of that checking. `can_fuse_vertical` calls `fusable_read_and_write` on O(read deps * write deps) combinations - but only cares about write deps that are MemoryDeps - so do the isinstance check outside the inner loop to save O(read deps) when it won't matter anyway. Also moves `fusable_read_and_write` to a instance method (instead of a closure) since it doesn't actually capture any variables. I also tried pre-splitting the read deps into `StarDep` vs `MemoryDep` but that didn't actually make any perf difference. Testing: ``` time python benchmarks/dynamo/torchbench.py --accuracy --inference --amp --backend inductor --disable-cudagraphs --device cuda --only tacotron2 ``` Before this change: 10m15s After this change: 9m31s Related to #98467 After: 9:45? cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx peterbell10 ipiszy yf225 chenyang78 kadeng muchulee8 ColinPeppler amjames desertfire chauhang [ghstack-poisoned]
peterbell10
approved these changes
May 24, 2024
Related to #98467 The tacotron2 benchmark creates a lot of nodes which fusion then checks. This improves some of the perf of that checking. `can_fuse_vertical` calls `fusable_read_and_write` on O(read deps * write deps) combinations - but only cares about write deps that are MemoryDeps - so do the isinstance check outside the inner loop to save O(read deps) when it won't matter anyway. Also moves `fusable_read_and_write` to a instance method (instead of a closure) since it doesn't actually capture any variables. I also tried pre-splitting the read deps into `StarDep` vs `MemoryDep` but that didn't actually make any perf difference. Testing: ``` time python benchmarks/dynamo/torchbench.py --accuracy --inference --amp --backend inductor --disable-cudagraphs --device cuda --only tacotron2 ``` Before this change: 10m15s After this change: 9m31s Related to #98467 After: 9:45? cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx peterbell10 ipiszy yf225 chenyang78 kadeng muchulee8 ColinPeppler amjames desertfire chauhang [ghstack-poisoned]
jansel
approved these changes
May 24, 2024
Related to #98467 The tacotron2 benchmark creates a lot of nodes which fusion then checks. This improves some of the perf of that checking. `can_fuse_vertical` calls `fusable_read_and_write` on O(read deps * write deps) combinations - but only cares about write deps that are MemoryDeps - so do the isinstance check outside the inner loop to save O(read deps) when it won't matter anyway. Also moves `fusable_read_and_write` to a instance method (instead of a closure) since it doesn't actually capture any variables. I also tried pre-splitting the read deps into `StarDep` vs `MemoryDep` but that didn't actually make any perf difference. Testing: ``` time python benchmarks/dynamo/torchbench.py --accuracy --inference --amp --backend inductor --disable-cudagraphs --device cuda --only tacotron2 ``` Before this change: 10m15s After this change: 9m31s Related to #98467 cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx peterbell10 ipiszy yf225 chenyang78 kadeng muchulee8 ColinPeppler amjames desertfire chauhang [ghstack-poisoned]
Related to #98467 The tacotron2 benchmark creates a lot of nodes which fusion then checks. This improves some of the perf of that checking. `can_fuse_vertical` calls `fusable_read_and_write` on O(read deps * write deps) combinations - but only cares about write deps that are MemoryDeps - so do the isinstance check outside the inner loop to save O(read deps) when it won't matter anyway. Also moves `fusable_read_and_write` to a instance method (instead of a closure) since it doesn't actually capture any variables. I also tried pre-splitting the read deps into `StarDep` vs `MemoryDep` but that didn't actually make any perf difference. Testing: ``` time python benchmarks/dynamo/torchbench.py --accuracy --inference --amp --backend inductor --disable-cudagraphs --device cuda --only tacotron2 ``` Before this change: 10m15s After this change: 9m31s Related to #98467 cc voznesenskym penguinwu EikanWang jgong5 Guobing-Chen XiaobingSuper zhuhaozhe blzheng wenzhe-nrv jiayisunx peterbell10 ipiszy yf225 chenyang78 kadeng muchulee8 ColinPeppler amjames desertfire chauhang [ghstack-poisoned]
Contributor
Author
|
@pytorchbot merge |
Collaborator
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 |
Collaborator
Merge failedReason: 1 jobs have failed, first few of them are: trunk / linux-focal-cuda12.4-py3.10-gcc9 / test (jit_legacy, 1, 1, linux.4xlarge.nvidia.gpu) Details for Dev Infra teamRaised by workflow job |
Contributor
Author
|
@pytorchbot merge |
Collaborator
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 |
titaiwangms
pushed a commit
to titaiwangms/pytorch
that referenced
this pull request
May 28, 2024
Related to pytorch#98467 The tacotron2 benchmark creates a lot of nodes which fusion then checks. This improves some of the perf of that checking. `can_fuse_vertical` calls `fusable_read_and_write` on O(read deps * write deps) combinations - but only cares about write deps that are MemoryDeps - so do the isinstance check outside the inner loop to save O(read deps) when it won't matter anyway. Also moves `fusable_read_and_write` to a instance method (instead of a closure) since it doesn't actually capture any variables. I also tried pre-splitting the read deps into `StarDep` vs `MemoryDep` but that didn't actually make any perf difference. Testing: ``` time python benchmarks/dynamo/torchbench.py --accuracy --inference --amp --backend inductor --disable-cudagraphs --device cuda --only tacotron2 ``` Before this change: 10m15s After this change: 9m31s Related to pytorch#98467 Pull Request resolved: pytorch#127061 Approved by: https://github.com/peterbell10, https://github.com/jansel ghstack dependencies: pytorch#127060
pytorchmergebot
pushed a commit
that referenced
this pull request
May 30, 2024
It seems that while #127060 improved the speed for tacotron2 it introduced a compilation_latency regression for some of the TIMM benchmarks. The original change was to precompute the Dep metadata - but apparently some benchmarks have few enough overlaps that precomputing O(n) deps was slower than ignoring O(n^2) deps. So change it to go back to computing the Dep metadata on demand but to then cache the result. `dm_nfnet_f0` was a good example because on the dashboard it showed an increase from 140s -> 154s. ``` python benchmarks/dynamo/timm_models.py --performance --cold-start-latency --training --amp --backend inductor --dynamic-shapes --dynamic-batch-only --device cuda --total-partitions 5 --partition-id 1 --output timm-0.csv --only dm_nfnet_f0 ``` Looking at the compilation_latency result. On viable (d6e3e89): 172.777958 176.725071 177.907955 On viable with #127060 and #127061 fully backed out: 158.305166 158.688560 160.791187 On viable w/ this change: 160.094164 160.201845 161.752157 I think that's probably close enough considering the variance. Pull Request resolved: #127326 Approved by: https://github.com/oulgen
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related to #98467
The tacotron2 benchmark creates a lot of nodes which fusion then checks. This improves some of the perf of that checking.
can_fuse_verticalcallsfusable_read_and_writeon O(read deps * write deps) combinations - but only cares about write deps that are MemoryDeps - so do the isinstance check outside the inner loop to save O(read deps) when it won't matter anyway.Also moves
fusable_read_and_writeto a instance method (instead of a closure) since it doesn't actually capture any variables.I also tried pre-splitting the read deps into
StarDepvsMemoryDepbut that didn't actually make any perf difference.Testing:
Before this change: 10m15s
After this change: 9m31s
Stack from ghstack (oldest at bottom):
Related to #98467
cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @peterbell10 @ipiszy @yf225 @chenyang78 @kadeng @muchulee8 @ColinPeppler @amjames @desertfire @chauhang