Skip to content

[XPU CI] Optimize PR CI per-file timeouts and fail hanging tests fast - #42048

Merged
mingfeima merged 10 commits into
sgl-project:mainfrom
arathi-hlab:xpu-ci-timeout-optimization
Oct 12, 2026
Merged

mingfeima merged 10 commits into
sgl-project:mainfrom
arathi-hlab:xpu-ci-timeout-optimization

Conversation

@arathi-hlab

@arathi-hlab arathi-hlab commented Oct 1, 2026 •

Copy link
Copy Markdown
Collaborator

Motivation

XPU PR CI ran each test file with the default 1200s limit plus 600s on retry. Several files intermittently hang right after XPU device init with no output, so each hang burned the full 30 min before a retry that passes in seconds. Across 156 recent XPU stage-a jobs there were 45 such hangs.

Split out of #41857 so that PR only carries the nightly kernel-main/release split.

Modifications

  • pr-test-xpu.yml: cap every file at 600s for both attempts (--timeout-per-file 600 --retry-timeout-increase 0), and pass per-file overrides for the 7 files seen hanging.
  • run_suite.py: add a repeatable --timeout-override PATH=SECONDS, matched by path suffix. It does nothing unless passed, and only pr-test-xpu.yml passes it.
  • ci_utils.py: an override caps only the first attempt. The retry gets the full --timeout-per-file, so a slow-but-healthy run still gets a fair second chance.

Overrides are ~3x each file's observed max passing runtime:

File Normal Hangs seen First-attempt timeout
xpu/test_xpu_basic.py 21-41s 7 180s
kv_canary/test_self_unit_req_to_expected_token_ids_manager.py 8-74s 3 120s
kernels/ops/kvcache/test_hisparse.py 6-9s 11 120s
kv_canary/test_self_unit_plan_input.py 7-11s 6 120s
xpu/test_layernorm_xpu.py 7-11s 4 120s
e2e/xpu/test_xpu_fp8_linear.py 8-72s 7 240s
xpu/test_intel_xpu_backend.py 58-112s 7 360s

A hang on one of these now costs about 3 min (cap + 60s wait + normal retry) instead of about 31 min.

No test file or register_*_ci change, so other vendors' CI behaviour is unchanged.

Testing

  • Ran run_unittest_files on dummy tests with a 2s override and a 10s base: attempt 1 was killed at 2s, the retry ran 3s (longer than the override) and passed; a non-hanging overridden file passed on attempt 1.
  • --timeout-override rejects x.py, x.py=0, =5, x.py=abc.
  • pre-commit (isort, ruff, ruff format, codespell, check-yaml) passes.

CI States

Latest PR Test (Base): ❌ Run #38026054009
Latest PR Test (Extra): ❌ Run #38026053877
Latest PR Test (AMD ROCm 10): ❌ Run #38026054002

XPU PR CI ran each file with the default 1200s limit plus 600s on retry,
so a silent hang cost up to 30 min before the retry that passes in seconds.

- Cap every file at 600s for both attempts (--timeout-per-file 600
  --retry-timeout-increase 0).
- Add a repeatable `run_suite.py --timeout-override PATH=SECONDS` that
  caps only the first attempt; the retry keeps the full --timeout-per-file
  so a slow-but-healthy run still gets a fair second chance. Inert unless
  passed; only pr-test-xpu.yml passes it.
- Override the 7 files seen hanging across 156 recent XPU stage-a jobs,
  each at ~3x its observed max runtime:

  file                                                normal   hangs  timeout
  xpu/test_xpu_basic.py                               21-41s     7     180
  kv_canary/test_self_unit_req_to_expected_...py      8-74s      3     120
  kernels/ops/kvcache/test_hisparse.py                6-9s      11     120
  kv_canary/test_self_unit_plan_input.py              7-11s      6     120
  xpu/test_layernorm_xpu.py                           7-11s      4     120
  e2e/xpu/test_xpu_fp8_linear.py                      8-72s      7     240
  xpu/test_intel_xpu_backend.py                       58-112s    7     360

@mingfeima mingfeima left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The separation looks right: XPU-specific timeout values stay in the XPU workflow, while the shared runner behavior is opt-in. The XPU PR job passes at this head.

  • python/sglang/test/ci/ci_utils.py:269-273,345-358: Could you add a hardware-independent regression test for a matched first attempt, its retry using the base timeout, and an unmatched file? The passing XPU job did not hit a timeout, so it does not exercise the new retry behavior. Since this is described as a cap, min(base_timeout, override) would also prevent an override from accidentally extending the first attempt.
  • test/run_suite.py:440-448: Please reject non-finite values with math.isfinite(timeout). Both nan and inf currently pass the positivity check and can interfere with timeout handling.

…ite values

An override now only shortens the first attempt (min with --timeout-per-file), and --timeout-override rejects nan/inf.
@arathi-hlab

arathi-hlab commented Oct 6, 2026 •

Copy link
Copy Markdown
Collaborator Author

@mingfeima Thanks! Addressed in b1de55a:

  • Applied min(base_timeout, override) so an override can only shorten the first attempt.
  • Added a math.isfinite() check so --timeout-override rejects nan/inf.

For the retry path I verified locally with dummy tests (10s base, 2s override): attempt 1 was killed at 2s, the retry got the full 10s, ran 3s (longer than the override) and passed; a non-hanging overridden file passed on attempt 1, and an unmatched file used the base timeout. I kept it out of the suite since it's CI-runner tooling with no existing test harness.

@arathi-hlab

Copy link
Copy Markdown
Collaborator Author

/tag-and-rerun-ci

@mingfeima
mingfeima merged commit 8ce76b8 into sgl-project:main Oct 12, 2026
126 of 142 checks passed
Liwansi added a commit to Liwansi/sglang_vans that referenced this pull request Oct 13, 2026
…n_allgather

* 'main' of https://github.com/sgl-project/sglang: (236 commits)
  [NPU] Stabilize HiCache and registered CI tests (sgl-project#43308)
  [Docs] Cookbook: refresh SemiAnalysis AgentX launches (GLM-5.2 B300, DeepSeek-V4.1 GB300) (sgl-project#43799)
  [Docs] Update GLM-5.3-Flash playground: B300 default, CP8, EP and PD (sgl-project#43802)
  [DSV4.1][PD][1/N] Support prefill node use cp parallel strategy (sgl-project#40323)
  [BCG][DSV4-Flash][CP] Support DeepSeek V4 prefill with interleave CP and breakable CUDA graphs (sgl-project#38603)
  [XPU] Support decode context parallelism (DCP) on Intel XPU (sgl-project#34355)
  Keep NIXL Mamba checkpoint keys separate by TP rank (sgl-project#43594)
  Capture KV host transfer buffers (sgl-project#43711)
  [CI] Move tests that do not need GB300 off the per-PR GB300 suite (sgl-project#43784)
  [HiCache] Preserve all MTP KV and recurrent state (sgl-project#40223)
  [HiCache] Support Mamba in buffer-only host memory mode (sgl-project#36345)
  [PD] Poison the deferred abort ack when a Mooncake send fails (sgl-project#43719)
  [Perf] Route BF16 mixed-batch decode tails through decode attention (sgl-project#43238)
  [Fix] Link cuda_ipc JIT against CUDA driver stubs dir (sgl-project#43764)
  docs: clarify prefill CP terminology and simplify wording (sgl-project#43787)
  [diffusion][xpu] FLUX.2: enable the bit-exact Triton SwiGLU on XPU (sgl-project#41940)
  [Fix] Adapt to transformers 5.18 / 5.19 changes (sgl-project#43688)
  [XPU CI] Optimize PR CI per-file timeouts and fail hanging tests fast (sgl-project#42048)
  [Deps] Bump FlashInfer to 0.7.1 (sgl-project#43494)
  docs: sync LMSYS SGLang blog cards (sgl-project#43462)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

intel run-ci CI: run the baseline test suite on this PR xpu intel gpu with device `torch.xpu`

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants