Conversation
Parse EP_BUFFER_DEBUG with int() before truth-testing, matching the documented 0/1 contract, C++ get_env<int>, and every other EP_* boolean env flag in the package. The raw string '0' is truthy in Python, so the documented off value incorrectly enabled the two print paths in EPBuffer. Add a host-side regression test that does not require CUDA or the compiled extension. Fixes deepseek-ai#718
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #718.
EP_BUFFER_DEBUG=0(the documented off value) was enabling the Python-side debugprintpaths becauseos.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: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):EP_BUFFER_DEBUGget_env<int>01Note 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 todeep_ep/buffers/ep.pyon currentmain.What I could not test
Full
EPBufferconstruction on NVIDIA hardware. The defect and fix are pure Python environment-variable parsing around twoprintguards.