mirror of
https://github.com/deepseek-ai/DeepEP.git
synced 2026-11-05 00:47:32 +00:00
[PR #644] Warn if Linux automatic NUMA balancing is enabled at buffer init #684
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
deepseek-ai/DeepEP#684
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/deepseek-ai/DeepEP/pull/644
Author: @toffee-desuwa
Created: 5/26/2026
Status: 🔄 Open
Base:
main← Head:numa-balancing-warning📝 Commits (3)
15bac18Warn if Linux automatic NUMA balancing is enabled at buffer initf26be9fSoften NUMA balancing warning wording based on counter-evidenced389e22Explain the actual NUMA balancing cost mechanism in warning and README📊 Changes
2 files changed (+44 additions, -0 deletions)
View changed files
📝
README.md(+13 -0)📝
deep_ep/__init__.py(+31 -0)📄 Description
Summary
Adds a startup-time warning when
/proc/sys/kernel/numa_balancing != 0, plus a new## Performance gotchassection in the README documenting the mitigation. Fixes #624.Background
@wenjianhnreported in #624 that Linux automatic NUMA balancing (kernel.numa_balancing != 0, default on most 5.x kernels) periodically rewrites PTEs at the user/kernel boundary viatask_numa_work, which is directly visible on thedeep_ep::Buffer::internode_dispatchhot path.funclatency -d 60 -m -p <pid> task_numa_workover 60 s on an SGLang workload:139 invocations in 60 s, with 2 samples reaching the 16-31 ms bucket — added directly to the EP critical path.
Change
deep_ep/__init__.py: newcheck_numa_balancing()helper, called betweencheck_nccl_so()andinit_jit()in the existing init block. Mirrors thecheck_nccl_sopattern (env-var suppress, silent skip on non-Linux, single warning emit).kernel.numa_balancingis a bitmask, so the check isvalue != '0'(covers modes 1, 2, and OR-ed combinations, all of which runtask_numa_work).README.md: new## Performance gotchassection documenting the issue and thesysctl kernel.numa_balancing=0mitigation, plus anEP_SUPPRESS_NUMA_CHECKentry in the env var listing.The check is opt-out via
EP_SUPPRESS_NUMA_CHECK=1for CI / containerized environments where the user cannot toggle the sysctl.Validation
kernel.numa_balancingis non-zero:kernel.numa_balancing=0:EP_SUPPRESS_NUMA_CHECK=1:/proc/sys/kernel/numa_balancing):OSErrorcaught silently.python -m py_compile deep_ep/__init__.pypasses;git diff --checkclean; file is excluded from the repository ruff target so no lint conflicts.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.