pytorch - ✅(Solved) Fix DISABLED test_captured_scalar_grad_xpu_float16 (__main__.TestFlexAttentionXPU) [1 pull requests, 1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
pytorch/pytorch#181335Fetched 2026-04-24 10:35:55
View on GitHub
Comments
1
Participants
2
Timeline
37
Reactions
0
Timeline (top)
mentioned ×13subscribed ×13labeled ×7added_to_project_v2 ×1

Root Cause

This test was disabled because it is failing on main branch (recent examples).

Fix Action

Fixed

PR fix notes

PR #181354: [xpu][fix] Guard CUDA-only calls in _run_test_captured_scalar_grad for XPU

Description (problem / solution / changelog)

Fixes #181335 This PR wrap CUDA specific call with if torch.cuda.is_available():

Co-authored with Claude Sonnet 4.6 Co-authored-by: Copilot [email protected]

cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @ipiszy @kadeng @muchulee8 @amjames @chauhang @aakhundov @coconutruben @jataylo @gujinghui @fengyuan14 @guangyey

Changed files

  • test/inductor/test_flex_attention.py (modified, +10/-4)
RAW_BUFFERClick to expand / collapse

Platforms: xpu

This test was disabled because it is failing on main branch (recent examples).

cc @mruberry @chauhang @penguinwu @gujinghui @EikanWang @fengyuan14 @guangyey @Chillee @drisspg @yanboliang @BoyuanFeng @liangel-02 @howardzhang-cv

extent analysis

TL;DR

The test test_captured_scalar_grad_xpu_float16 in test_flex_attention.py is failing on the main branch and needs to be investigated and fixed.

Guidance

  • Review the recent failure examples on torch-ci.com to understand the failure pattern and potential causes.
  • Investigate the test_captured_scalar_grad_xpu_float16 test case in test_flex_attention.py to identify the root cause of the failure.
  • Check the test's dependencies and environment to ensure they are correctly set up for the xpu platform.

Notes

The issue lacks detailed information about the failure, so a more specific fix or workaround cannot be provided.

Recommendation

Apply workaround: Investigate and fix the failing test case, as it is currently disabled and may be causing issues on the main branch.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

pytorch - ✅(Solved) Fix DISABLED test_captured_scalar_grad_xpu_float16 (__main__.TestFlexAttentionXPU) [1 pull requests, 1 comments, 2 participants]