Skip to content

legacy: allow build-time override of watchdog timeout constants#678

Open
dmvevents wants to merge 1 commit into
deepseek-ai:mainfrom
dmvevents:legacy-timeout-build-override
Open

legacy: allow build-time override of watchdog timeout constants#678
dmvevents wants to merge 1 commit into
deepseek-ai:mainfrom
dmvevents:legacy-timeout-build-override

Conversation

@dmvevents

Copy link
Copy Markdown

Summary

Wraps LEGACY_NUM_CPU_TIMEOUT_SECS / LEGACY_NUM_TIMEOUT_CYCLES in #ifndef so integrators can raise the watchdog at build time (e.g. -DLEGACY_NUM_CPU_TIMEOUT_SECS=1800) without patching sources. Defaults unchanged.

Motivation

On first run, frameworks that JIT-compile their expert GEMMs hold some ranks inside dispatch while peers finish compiling. Concretely: SGLang's DeepGEMM warmup (10–20 min cold, per its own log banner) exceeds the hardcoded 100 s watchdog, which then kills the run with DeepEP error: timeout (dispatch CPU) although no communication fault exists.

Measured on 2× p5en.48xlarge (H200, 16 EFA NICs, EP16, Qwen3-30B-A3B-FP8, SGLang 0.5.5.post3): with the constant raised to 1800 s the identical workload completes and serves; write-up with numbers: https://dmvevents.github.io/deepep-efa-guidance/sections/08-v1-nvshmem-backend.html

Notes

  • Touches only the legacy (deep_ep.Buffer) path where the constant lives; happy to extend the same guard to the EPv2 tree if wanted.
  • An env-var runtime override would be nicer but the constants are compiled into device code; #ifndef is the minimal non-breaking step.
  • Draft for maintainer direction.

Wrap LEGACY_NUM_CPU_TIMEOUT_SECS / LEGACY_NUM_TIMEOUT_CYCLES in #ifndef so
integrators can raise them via compile flags without patching sources.

Motivation: on first run, frameworks that JIT-compile their expert GEMMs
(e.g. SGLang's DeepGEMM warmup, 10-20 min cold) hold some ranks inside
dispatch while peers finish compiling. The hardcoded 100 s watchdog then
kills the run with 'DeepEP error: timeout (dispatch CPU)' even though no
communication fault exists. Measured on 2x p5en.48xlarge (H200, EFA):
raising the constant to 1800 s rides out the warmup and the same workload
completes; defaults are unchanged for everyone else.

Signed-off-by: Anton Alexander <dmvevents@gmail.com>
@dmvevents
dmvevents marked this pull request as ready for review July 20, 2026 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant