pytorch - 💡(How to fix) Fix DISABLED test_correctness_Adafactor_use_closure_False_xpu_float32 (__main__.CompiledOptimizerParityTestsXPU) [2 comments, 3 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#178746Fetched 2026-04-08 01:52:35
View on GitHub
Comments
2
Participants
3
Timeline
132
Reactions
0
Author
Timeline (top)
mentioned ×60subscribed ×60labeled ×7commented ×2

Root Cause

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

RAW_BUFFERClick to expand / collapse

Platforms: xpu

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

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

extent analysis

Fix Plan

The fix involves re-enabling and updating the test case test_correctness_Adafactor_use_closure_False_xpu_float32 in test_compiled_optimizers.py to ensure compatibility with the XPU platform.

Steps to Fix

  • Re-enable the disabled test case.
  • Update the test case to handle XPU-specific requirements.
  • Verify the test case passes on the XPU platform.

Example Code

import unittest
import torch

class CompiledOptimizerParityTestsXPU(unittest.TestCase):
    def test_correctness_Adafactor_use_closure_False_xpu_float32(self):
        # Initialize Adafactor optimizer
        optimizer = torch.optim.Adafactor(params=[torch.randn(10)], lr=0.01)
        
        # Set up XPU device
        device = torch.device("xpu" if torch.xpu.is_available() else "cpu")
        optimizer.to(device)
        
        # Run test case
        # ... (rest of the test case code)

if __name__ == "__main__":
    unittest.main()

Verification

Run the test case using the command python -m unittest test_compiled_optimizers.py and verify that the test case passes.

Extra Tips

  • Ensure the XPU device is properly set up and available.
  • Update the test case to handle any XPU-specific requirements or limitations.

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 - 💡(How to fix) Fix DISABLED test_correctness_Adafactor_use_closure_False_xpu_float32 (__main__.CompiledOptimizerParityTestsXPU) [2 comments, 3 participants]