Repository navigation
Fix failing integration tests on Intel XPU (Arc Pro B60) - #49846
Open
jiqing-feng wants to merge 7 commits into
Open
jiqing-feng wants to merge 7 commits into
jiqing-feng wants to merge 7 commits into
Conversation
jiqing-feng
marked this pull request as ready for review
October 22, 2026 06:35
yao-matrix
reviewed
Oct 27, 2026
- gemma3n test_model_4b_bf16: add @require_deterministic_for_xpu (3 runs without it gave 3 different outputs) and record the resulting deterministic B60 output. Note ROCm already expects 'turquoise' here, so this token is a known cross-device divergence point. - llava_next_video batch_matches_single: record both XPU expectations.
test_eager_matches_sdpa_generate overrode the common test with a strict torch.testing.assert_close on token ids. The tiny fp16 checkpoint produces exactly tied top-2 logits for one prompt (eager: 17.0 vs 16.98438, sdpa: 17.0 vs 17.0), so argmax tie-breaking is arbitrary even though both kernels agree to within a single fp16 ULP: over non-pad positions max|eager-sdpa| is 0.015625, exactly 1 ULP at that magnitude. Use assert_similar_generate_outputs (as the common test does), which allows a token mismatch when the scores at the first mismatch are numerically equivalent. atol is sized for fp16 rather than the 1e-3 default. Verified on Intel Arc Pro B60: 8/8 passes, vs 3/6 before.
The test sharded the model with device_map="auto" and asserted a single hardcoded string, which alternated between two outputs across runs on XPU. Adding @require_deterministic_for_xpu makes it reproducible (4/4 identical runs), and the stable XPU output is recorded via Expectations.
jiqing-feng
force-pushed
the
xpu-integration-test-fixes
branch
from
October 27, 2026 01:31
87c4db5 to
6725cd7
Compare
Contributor
|
[For maintainers] Suggested jobs to run (before merge) run-slow: deepseek_v2, deepseek_v3, emu3, ernie4_5_vl_moe, falcon_h1, fast_vlm, gemma3n, internvl, kosmos2_5, llava, llava_next_video, llava_onevision, phi4_multimodal, qwen2_5_vl, voxtral_realtime |
This branch has not been deployed
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.
Fixes 13 slow integration tests that were failing on Intel XPU. Verified on 8x Intel Arc Pro B60 (
get_device_properties()returns("xpu", 5)), torch 2.14.0+xpu: 22/22 pass, 9/22 before.Expected values for XPU gen-5
These tests already had expectations for other devices (and in a few cases for gen-3 Arc, whose values differ from B60). Added an
("xpu", 5)entry; no existing key was modified, so no other device is affected.emu3—test_model_generation_batched(needs torch >= 2.16 nightly; on 2.14/2.15 the fp32 SDPA kernel hits a device-side fault at this sequence length)ernie4_5_vl_moe—test_small_model_integration_test_batchfalcon_h1—test_falcon_h1_hardfast_vlm—test_model_integrationinternvl—test_llama_small_model_integration_generatekosmos2_5—test_sdpallava—test_pixtral_batchedllava_next_video—test_small_model_integration_test_batch_matches_singlellava_onevision—test_small_model_integration_test_multi_imageqwen2_5_vl—test_small_model_integration_test_with_videovoxtral_realtime—test_batched_longformphi4_multimodal—test_vision_text_generation: the existing("xpu", 5)value was recorded on different XPU hardware and does not reproduce on B60; updated to the B60 output.Non-deterministic tests
Two tests produced a different output on nearly every run on XPU. Added the existing
@require_deterministic_for_xpudecorator (already used byhiggs_audio_v2and elsewhere intests/) to make them reproducible, then recorded the resulting stable output.gemma3n—test_model_4b_bf16: three runs without the decorator gave three different outputs; three runs with it gave identical output. Note that ROCm already expectsturquoisehere instead of CUDA'sclear blue, so this token is a known cross-device divergence point rather than an XPU defect.deepseek_v2—test_batch_fa2: the model is sharded withdevice_map="auto"and the test asserted a single hardcoded list. Converted toExpectationsand added the decorator.deepseek_v3::test_eager_matches_sdpa_generateThis test overrides the common one with a strict
torch.testing.assert_closeon token ids. The tiny fp16 checkpoint produces exactly tied top-2 logits for one of the prompts (eager sees17.0vs16.98438, sdpa sees17.0vs17.0), so argmax tie-breaking is arbitrary even though both kernels agree to within a single fp16 ULP — over non-pad positionsmax|eager - sdpa|is0.015625, exactly 1 ULP at that magnitude. One flipped token at position 14 then cascades through the remaining 30. The large raw difference seen before masking comes entirely from fully-masked pad rows, which never reach the output.This is not a new relaxation: the common
test_eager_matches_sdpa_generateinGenerationTesterMixinalready compares withassert_similar_generate_outputs, which accepts a token mismatch when the scores at the first mismatch are numerically equivalent. The override had opted out of it. Switched back to the shared helper (return_dict_in_generate/output_scoresare needed to give it the scores), withatolsized for fp16 rather than the fp32-oriented1e-3default — a genuine kernel discrepancy is far above that. Result: 8/8 passes, vs 3/6 before.Testing