[PR #770] Fix EP_BUFFER_DEBUG=0 enabling Python-side debug output #773

Open
opened 2026-10-27 21:06:13 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/deepseek-ai/DeepEP/pull/770
Author: @YidaWeng
Created: 10/1/2026
Status: 🔄 Open

Base: main ← Head: fix/ep-buffer-debug-parsing-718


📝 Commits (1)

  • 13b3aba Fix EP_BUFFER_DEBUG=0 enabling Python-side debug output

📊 Changes

2 files changed (+74 additions, -2 deletions)

View changed files

📝 deep_ep/buffers/ep.py (+2 -2)
➕ tests/utils/test_ep_buffer_debug_env.py (+72 -0)

📄 Description

Summary

Fixes #718.

EP_BUFFER_DEBUG=0 (the documented off value) was enabling the Python-side debug print paths because os.environ.get(...) returns the string '0', which is truthy. C++ get_env<int> already treated "0" as off.

Change

In deep_ep/buffers/ep.py, convert before testing at both call sites:

if int(os.environ.get('EP_BUFFER_DEBUG', 0)):

This matches every other boolean EP_* env flag in the package (EP_SUPPRESS_NCCL_CHECK, EP_USE_NVIDIA_TOOLS, EP_DISABLE_BARRIER_PROFILING, EP_REUSE_NCCL_COMM).

Test

Host-side only (no GPU, no CUDA toolkit, no compiled deep_ep._C):

python tests/utils/test_ep_buffer_debug_env.py
EP_BUFFER_DEBUG Before (Python) After (Python) C++ get_env<int>
unset off off off
0 on off off
1 on on on

Note on earlier PRs

#719 and #742 fixed the same bug in deep_ep/buffers/elastic.py, which no longer exists after the V2.5 buffer split. This PR applies the equivalent change to deep_ep/buffers/ep.py on current main.

What I could not test

Full EPBuffer construction on NVIDIA hardware. The defect and fix are pure Python environment-variable parsing around two print guards.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/deepseek-ai/DeepEP/pull/770 **Author:** [@YidaWeng](https://github.com/YidaWeng) **Created:** 10/1/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/ep-buffer-debug-parsing-718` --- ### 📝 Commits (1) - [`13b3aba`](https://github.com/deepseek-ai/DeepEP/commit/13b3abaa6a896e65fc9a11d8aedc83afd80804ee) Fix EP_BUFFER_DEBUG=0 enabling Python-side debug output ### 📊 Changes **2 files changed** (+74 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `deep_ep/buffers/ep.py` (+2 -2) ➕ `tests/utils/test_ep_buffer_debug_env.py` (+72 -0) </details> ### 📄 Description ## Summary Fixes #718. `EP_BUFFER_DEBUG=0` (the documented off value) was enabling the Python-side debug `print` paths because `os.environ.get(...)` returns the string `'0'`, which is truthy. C++ `get_env<int>` already treated `"0"` as off. ## Change In `deep_ep/buffers/ep.py`, convert before testing at both call sites: ```python if int(os.environ.get('EP_BUFFER_DEBUG', 0)): ``` This matches every other boolean `EP_*` env flag in the package (`EP_SUPPRESS_NCCL_CHECK`, `EP_USE_NVIDIA_TOOLS`, `EP_DISABLE_BARRIER_PROFILING`, `EP_REUSE_NCCL_COMM`). ## Test Host-side only (no GPU, no CUDA toolkit, no compiled `deep_ep._C`): ```bash python tests/utils/test_ep_buffer_debug_env.py ``` | `EP_BUFFER_DEBUG` | Before (Python) | After (Python) | C++ `get_env<int>` | |---|---|---|---| | unset | off | off | off | | `0` | **on** | off | off | | `1` | on | on | on | ## Note on earlier PRs #719 and #742 fixed the same bug in `deep_ep/buffers/elastic.py`, which no longer exists after the V2.5 buffer split. This PR applies the equivalent change to `deep_ep/buffers/ep.py` on current `main`. ## What I could not test Full `EPBuffer` construction on NVIDIA hardware. The defect and fix are pure Python environment-variable parsing around two `print` guards. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
deepseek-ai/DeepEP#773
No description provided.