test: add XPU regression test for flash attention dynamic shape generalization (#3007)#3679
test: add XPU regression test for flash attention dynamic shape generalization (#3007)#3679Copilot wants to merge 3 commits into
Conversation
Add test/xpu/dynamo/test_cuda_repro_xpu.py with test_flash_attention_dynamic to validate that torch.compile(dynamic=True) + XPU flash attention produces exactly 2 Dynamo frames (no over-specialisation on seq_len). Also add test/repro/test_flash_attention_dynamic.py as standalone reproducer and register the new dynamo test file in skip_list_common.py. Root cause was in pytorch's xpu/sdp_utils.cpp where check_flash_attention_head_dim_size used concrete .size() instead of .sym_size(), materializing the head-dim dimension as a static guard and preventing Dynamo from generalising seq_len after the second recompilation. Fixed upstream in pytorch commit fd1d1b0. Agent-Logs-Url: https://github.com/intel/torch-xpu-ops/sessions/2acbff39-ce65-4690-80a9-20b71096b0a3 Co-authored-by: Stonepia <12094956+Stonepia@users.noreply.github.com>
|
@copilot The Python lint (flake8/ruff) check failed. Please fix the lint errors in this PR. Important: Do NOT update the plan in the PR description directly. Use reply comments to update the status. Lint job log: https://github.com/intel/torch-xpu-ops/actions/runs/25898977896 Instructions:
|
…tion_dynamic.py Fix two lintrunner errors: - TEST_HAS_MAIN: replace unittest.main() with run_tests() from torch.testing._internal.common_utils - PYFMT: remove extra blank line between imports and module-level code - Use torch's TestCase base class instead of unittest.TestCase Agent-Logs-Url: https://github.com/intel/torch-xpu-ops/sessions/c871ddab-679b-49e2-8620-824352689370 Co-authored-by: chuanqi129 <13608516+chuanqi129@users.noreply.github.com>
Fixed in f203f4e. Two lintrunner errors in
|
|
@copilot New UT failures detected in xpu_distributed tests (0 total). Please check these new failures and analyze whether they are caused by the PR changes. Important: Do NOT update the plan in the PR description directly. Use reply comments to update the status. Job log: https://github.com/intel/torch-xpu-ops/actions/runs/25899102823 New failures: Instructions:
|
Reviewed the xpu_distributed report. The notification lists 0 new failures — the "New failures:" section is empty. There are no test failures attributable to this PR's changes. |
Performance outliers, please check!
|
test_flash_attention_dynamicfailing on XPUcheck_flash_attention_head_dim_sizeused concrete.size()instead of.sym_size()pytorch/maintest/xpu/dynamo/test_cuda_repro_xpu.pywithtest_flash_attention_dynamicregression testtest/xpu/skip_list_common.pytest/repro/test_flash_attention_dynamic.pystandalone repro testunittest.main()withrun_tests()fromtorch.testing._internal.common_utilsdevice_typeunittest.TestCaseto torch'sTestCase