Repository navigation
[Test] [XPU] kv_canary: Make kernel tests device-agnostic - #46775
dayanandav wants to merge 12 commits into
Conversation
… on XPU Use get_device()/get_device_module() instead of hard-coded CUDA in the kv_canary kernel tests and helpers, register them on the XPU suite, and skip the CUDA-JIT-only launch check on non-CUDA devices. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This comment has been minimized.
This comment has been minimized.
|
@siju-samuel help to review the change, thanks. |
…changes The main_package filter skips python/sglang/kernels/ and python/sglang/test/kernels/, so a PR touching only the torch reference kernels XPU runs (verify_ref.py, plan_ref.py, ...) or the shared kv_canary test helpers never ran the kv_canary kernel tests on XPU. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@dayanandav — consolidation CI feedback from GitHub Actions: https://github.com/sgl-project/sglang/actions/runs/41680983915/job/126090441319 |
- _fixtures.py resolved the device at import time, which raises on a
CPU-only runner and broke test_self_unit_canary_info.py; resolve it
inside the three helpers that need it.
- Import get_device / get_device_module from sglang.srt.utils, since
common.py no longer defines them.
- Make the new test_canary_info_{hand,fuzz}.py device-agnostic and
register them on the XPU suite.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… lane Keep them device-agnostic but leave XPU CI registration out to avoid loading the XPU lane. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The tests stay device-agnostic for manual runs; XPU CI registration is left out of this PR. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Fixed in 9683448. The device is now resolved inside the helpers and not at import, so the CPU-lane import works. Verified on CPU-only, XPU and A100. |
--pp is ambiguous between --pp-size, --pp-max-micro-batch-size and --pp-async-batch-depth, so the server exits with code 2 at argument parsing. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
@airMeng could you please run |
|
/tag-and-rerun-ci |
|
For this week’s XPU consolidation (#49356, week of November 9), #46775 is excluded on scope grounds at source head The remaining patch makes the shared KV-canary test helpers/device synchronization device-agnostic, retains the CUDA/AMD CI registrations, and corrects the existing manual XPU pipeline-parallel test argument. It does not add an XPU CI registration or change an XPU production operator. The consolidation job classified this residual as generic test-harness portability rather than XPU-specific production enablement or regression/registration coverage, so it remains for independent review in this source PR. The earlier CPU-lane import failure is not the reason for this exclusion: the updated |
|
@airMeng thanks for the scope note. Understood that this stays for independent review here. CI ran on head 48d494a: the kv_canary files all finished on AMD, and the remaining failures look unrelated (AMD job hit its 30-min limit in |
Motivation
The kv_canary kernel tests hard-code
torch.device("cuda")andtorch.cuda.synchronize(), so they fail on XPU withTorch not compiled with CUDA enabled._fixtures.pyalso resolved the device at import time, which broke CPU-only runners that import_canary_helpers.Modifications
_fixtures/_differentialhelpers get the device fromget_device()and sync viaget_device_module()._fixtures.pyresolves the device inside its helpers, not at import.test_disabled_assert_inputs_passes_none_to_cudaskips off CUDA (CUDA JIT launch path only).test/manual/kv_canary/test_xpu_kv_canary_pp.py: pass--pp-size 2instead of--pp 2, which is ambiguous between--pp-size,--pp-max-micro-batch-sizeand--pp-async-batch-depthand made the server exit at argument parsing.On XPU the kernels run their byte-equal torch reference (
kv_canary._dispatch). CUDA behavior is unchanged.Accuracy Tests
N/A (test-only change).
Testing
test/registered/kernels/ops/kv_canary/260 passed, 1 skippedtest/registered/kv_canary/+mock_modelunit tests 193 passedtest/registered/kernels/ops/kv_canary/261 passed, 0 skippedtest/registered/kv_canary/+mock_modelunit tests 193 passedtest/manual/kv_canary/test_xpu_kv_canary_pp.py1 passedtest_self_unit_canary_info.py36 passed; fails on the previous import-time device lookupSpeed Tests and Profiling
N/A (test-only change).
🤖 Generated with Claude Code
CI States
Latest PR Test (Base): ❌ Run #43063072517
Latest PR Test (Extra): ❌ Run #43063071377
Latest PR Test (AMD ROCm 10): ❌ Run #43063072116
Tip
Base CI only covers the core cases, and its workload may not exercise your change. Use
/rerun-testto run the tests your change touches, or copy this prompt for an agent: