Repository navigation
Fix profiler unit tests - #180380
Fix profiler unit tests#180380scotts wants to merge 15 commits into
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/180380
Note: Links to docs will display an error until the docs builds have been completed. ⏳ No Failures, 60 PendingAs of commit e88e065 with merge base c90ce2b ( UNSTABLE - The following jobs are marked as unstable, possibly due to flakiness on trunk:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
@pytorchbot merge -i |
|
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 |
|
@pytorchbot rebase |
|
@pytorchbot started a rebase job onto refs/remotes/origin/viable/strict. Check the current status here |
…ytorch#176345) Two indexing simplification improvements: 1. FloorDiv(ModularIndexing(b, d1, m), d2) now simplifies to ModularIndexing(b, d1*d2, m//d2) when d2 divides m. This collapses a nested FloorDiv-over-ModularIndexing into a single ModularIndexing, producing cleaner index expressions for reshape + reduction patterns. 2. remove_zero_terms in visit_indexing_div is generalized: the condition for dropping a variable v from the base changes from requiring gcd(rest, divisor) == divisor to v < gcd(rest, divisor). This handles more cases where v is small enough not to affect the FloorDiv. Also adds base < divisor → 0 simplification for visit_indexing_div. Authored with Claude. Pull Request resolved: pytorch#176345 Approved by: https://github.com/shunting314
Adding my name and Chen's Pull Request resolved: pytorch#180360 Approved by: https://github.com/JacobSzwejbka
This PR is to upgrade oneDNN to v3.11.2. ## Improvements - Improved fp32 matmul performance with fp4 compressed weights. - Improved fp32 matmul performance for cases when one of the tensors has a trivial dimension on processors with Intel AVX-512 instruction set support. - Improved fp16/bf16 matmul performance for large tensor cases on Intel Graphics for Intel Core Ultra processor Series 3 (formerly Panther Lake). - Improved matmul performance for cases with 4-byte alignment on Intel GPUs based on Xe2 architecture. - Improved performance of fp16/bf16 matmul with mxfp4 weights. - Introduced destination tensor [dynamic quantization](https://uxlfoundation.github.io/oneDNN/v3.11/dev_guide_attributes_quantization.html#dynamic-quantization) in matmul primitive following Open Compute Microscaling (MX) formats specification. - Introduced support for NVFP4 quantization scheme. The changes include support for fp8_e4m3 grouped scales and dynamic quantization support for destination tensor with NVFP4-specific formula for scales computation. - Introduced support for dropout as a primitive attribute for matmul, softmax and eltwise primitives. ## Validation results on Xeon CPU 1. Dynamo benchmarks The test results are based on the 3 dynamo benchmark suites with three data types. <img width="787" height="231" alt="image" src="https://github.com/user-attachments/assets/5e31dc94-4b36-4354-9aa4-3223888d126d" /> According to the local test results, we found that two torchbench models on AMP_BF16 show over 7% performance regression: - `torch_multimodal_clip` has 9% e2e regression. - `BERT_pytorch` has 22% e2e performance regression. # Validation results on Intel B60 Suite | Precision | Shape | Eager Speedup | Inductor Speedup -- | -- | -- | -- | -- Huggingface | BF16 | Static | 1.003 | 1.002 Timm | Bf16 | Static | 1.001 | 0.999 Torchbench | BF16 | Static | 1.003 | 1.000 ## Validation results on AArch64 ### Dynamo Suite: Geomean over latency - prev version vs new version (**Higher is better**) * for 16 Threads Highlights for **Neoverse-V2** : * MobileNetV3 1.15x lower latency with BF16. * Detectron2 **1.6x** lower latency with BF16. * AlexNet **6.2x** lower latency with BF16. | Suite | Precision | Shape | Neoverse-V1 Eager Geomean | Neoverse-V1 Inductor Geomean | Neoverse-V2 Eager Geomean | Neoverse-V2 Inductor Geomean | |------------|-----------|---------|---------------------------|------------------------------|--------------------------|-----------------------------| | HuggingFace | f32 | static | 0.992358837 | 0.995203121 | 1.0062 | 1.007 | | HuggingFace | f32 | dynamic | 0.991266938 | 0.993936984 | 1.0082 | 1.0081 | | HuggingFace | bf16 | static | 1.002295256 | 0.987069391 | 0.997 | 1.0134 | | HuggingFace | bf16 | dynamic | 0.999110791 | 0.993443274 | 1.00108 | 1.0089 | | Timm | f32 | static | 0.989609104 | 0.997575891 | 0.9168 | - | | Timm | f32 | dynamic | 0.988387827 | 0.998601957 | 0.92156 | - | | Timm | bf16 | static | 1.007171058 | 1.01461039 | 0.9925 | 0.9949 | | Timm | bf16 | dynamic | 1.008969741 | 1.016053648 | 0.9928 | 1.0321 | | Torchbench | f32 | static | 0.997158099 | 1.00775975 | 0.96 | - | | Torchbench | f32 | dynamic | 0.998372653 | 1.005439427 | - | - | | Torchbench | bf16 | static | 1.011766848 | 1.02951623 | 0.9815 | 0.98613 | | Torchbench | bf16 | dynamic | 1.017915309 | 1.028806584 | 0.9759 | 0.9831 | ### Torchbenchmark - Geomean over speedup (Higher is better) * on 16 Threads | Suite | Precision | Shape | Neoverse-V1 Eager Geomean | Neoverse-V1 TorchScript Geomean | Neoverse-V2 Eager Geomean | Neoverse-V2 TorchScript Geomean | |------------|-----------|---------|---------------------------|---------------------------------|--------------------------|---------------------------------| | Torchbench | amp_bf16 | inference | 1.00043 | 1.02446 | 1.023 | 1.059 | | Torchbench | amp_bf16 | training | 1.03322 | - | - | - | | Torchbench | fp32 | inference | 1.00452 | 1.00715 | 1.0675 | 1.1086 | | Torchbench | fp32 | training | 1.00121 | - | - | - | ### NLP - FP32 * on 16 threads | Suite | Neoverse-V1 Latency Geomean | Neoverse-V2 Latency Geomean | |-------|-----------------------------|-----------------------------| | NLP | 0.996510961 | 0.99651 | Pull Request resolved: pytorch#177607 Approved by: https://github.com/malfet, https://github.com/aditew01, https://github.com/atalman Co-authored-by: fengqing.lu <[email protected]>
…)" This reverts commit e45d3c5. Reverted pytorch#179999 on behalf of https://github.com/huydhn due to This works for OSDC, but fails on EC2 path ([comment](pytorch#179994 (comment)))
This reverts commit 796e116. Reverted pytorch#179994 on behalf of https://github.com/huydhn due to This works for OSDC, but fails on EC2 path ([comment](pytorch#179994 (comment)))
…ytorch#179518) (pytorch#179518) Summary: TSIA. New PR to take over the changes while yfeldblum is on leave. Old PR: pytorch#177897 Test Plan: CI. Reviewed By: malfet Differential Revision: D95726764 Pull Request resolved: pytorch#179518 Approved by: https://github.com/Skylion007, https://github.com/malfet
…h#180349) Summary: Default addmm path changes now to match NVIDIA/AMD and to prevent performance regressions. We fix the lookup table tests accordingly Test Plan: buck2 run mode/opt caffe2/test/inductor:lookup_table Reviewed By: njriasan Differential Revision: D100810662 Pull Request resolved: pytorch#180349 Approved by: https://github.com/njriasan
…180270) (pytorch#180270) Summary: Relanding D100157470 Test Plan: `test_addmm_1d_bias_no_reinterpret_tensor` Differential Revision: D100670723 Pull Request resolved: pytorch#180270 Approved by: https://github.com/atalman
CUDA 13.2.1 is released today, prepare PR while we wait for the package to be available on pypi Improvements in 13.2.1: **Cublas** — CUDA 13.2.1 New data type support: NVFP4 inputs + bias epilogues now work on Blackwell (CC 10.x/11.0). BF16/FP16/FP8 inputs now work on Hopper, with FP8 supporting both tensorwide and block scaling (VEC128, BLK128x128). Performance: Up to 20% faster Grouped GEMM on Blackwell for large problem sizes — directly benefits MoE model inference. Bug fix: Fixed an issue in cublasLtMatmulAlgoGetHeuristic() could return zero algorithm candidates for Grouped GEMM on Blackwell, making it unusable in those cases. Now fixed. [CUB-9657] Pull Request resolved: pytorch#180288 Approved by: https://github.com/Skylion007
pytorch#180070) …al_types Remove mypy suppressions. Add return type and parameter type annotations to constraint classes, generator, transformation, and z3 transform. Authored with Claude. Pull Request resolved: pytorch#180070 Approved by: https://github.com/Skylion007
The old implementation tagged backward nodes by running fx_traceback.annotate({"autograd_backward": True}) around traced autograd.grad. That stored autograd_backward in current_meta["custom"], which is also where user annotations such as {"ac_region_id": 0} live.
This was unsafe because some traceback save/restore paths only shallow-copy metadata. In particular, set_current_meta(node) does current_meta = node.meta.copy(), so current_meta["custom"] aliases node.meta["custom"]. A nested annotate({"autograd_backward": True}) then mutates that shared dict in place. When the nested scope exits, current_meta may be restored, but the source node metadata can stay polluted, which is how forward FlexAttention nodes ended up leaking autograd_backward.
Fix this by treating autograd_backward as internal tracing state instead of user custom metadata. Keep a dedicated current_meta["autograd_backward"] flag during tracing, stamp node.meta["autograd_backward"] on newly created nodes using setup_stacktrace_preservation_hook.
With this tagging, we can reorder backward nodes during partitioner, so regional_inductor now turns off remat pass. This is fine because, remat pass is intended to be consumed only after:
1. you torch.compile whole training step
2. you make_fx d whole training step
In relevant use cases, regional inductor will happen after SAC decision has been applied to the final graph.
Add non-strict tracing and FlexAttention regressions covering the leak.
Authored with Claude.
Pull Request resolved: pytorch#180251
Approved by: https://github.com/Skylion007, https://github.com/aorenste
)" This reverts commit 599c748. Reverted pytorch#177690 on behalf of https://github.com/jeanschmidt due to breaks some internal run of OSS tests, see D100653874 ([comment](pytorch#177690 (comment)))
Adds a deprecation warning for `metadata_json`, as we want to move away from using JSON as the default output for all things profiler and the info here is duplicated with `event_metadata`. I made it a property so that the warning prints when someone tries to use it. Pull Request resolved: pytorch#179417 Approved by: https://github.com/scotts
|
Successfully rebased |
d78b856 to
e88e065
Compare
|
This PR updates submodules third_party/ideep If those updates are intentional, please add "submodule" keyword to PR title/description. |
|
Closed in favor of #180454. |
Profiler unit tests were calling `os.environ["key"] = "value"` to change local behavior. But that changes the testing processes environment, polluting other tests. This causes strange failures, where running `python -m pytest test/profiler/test_memory_profiler.py` would succeed, but then tests in that file would fail when all tests were run with `python -m pytest test/profiler/`. Using `unittest.mock.patch` ensures these changes are isolated. Note that this PR is a redo of #180380 because that PR got hosed during a bad rebase. Pull Request resolved: #180454 Approved by: https://github.com/ryanzhang22
Profiler unit tests were calling `os.environ["key"] = "value"` to change local behavior. But that changes the testing processes environment, polluting other tests. This causes strange failures, where running `python -m pytest test/profiler/test_memory_profiler.py` would succeed, but then tests in that file would fail when all tests were run with `python -m pytest test/profiler/`. Using `unittest.mock.patch` ensures these changes are isolated. Note that this PR is a redo of pytorch#180380 because that PR got hosed during a bad rebase. Pull Request resolved: pytorch#180454 Approved by: https://github.com/ryanzhang22
Profiler unit tests were calling `os.environ["key"] = "value"` to change local behavior. But that changes the testing processes environment, polluting other tests. This causes strange failures, where running `python -m pytest test/profiler/test_memory_profiler.py` would succeed, but then tests in that file would fail when all tests were run with `python -m pytest test/profiler/`. Using `unittest.mock.patch` ensures these changes are isolated. Note that this PR is a redo of pytorch#180380 because that PR got hosed during a bad rebase. Pull Request resolved: pytorch#180454 Approved by: https://github.com/ryanzhang22
Profiler unit tests were calling
os.environ["key"] = "value"to change local behavior. But that changes the testing processes environment, polluting other tests.This causes strange failures, where running
python -m pytest test/profiler/test_memory_profiler.pywould succeed, but then tests in that file would fail when all tests were run withpython -m pytest test/profiler/. Usingunittest.mock.patchensures these changes are isolated.cc @gujinghui @PenghuiCheng @XiaobingSuper @jianyuh @jgong5 @mingfeima @sanchitintel @ashokei @jingxu10 @min-jean-cho @yanbing-j @Guobing-Chen @Xia-Weiwen @snadampal @mcarilli @ptrblck @leslie-fang-intel @EikanWang @voznesenskym @penguinwu @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @ipiszy @kadeng @muchulee8 @amjames @chauhang @aakhundov @coconutruben @jataylo @Lucaskabela @azahed98