Repository navigation
fix(hicache): handle tensor device buffers - #42785
Closed
AnkitNakhawa wants to merge 1 commit into
Closed
AnkitNakhawa wants to merge 1 commit into
AnkitNakhawa wants to merge 1 commit into
Conversation
AnkitNakhawa
requested review from
Ying1123,
alphabetc1,
hanming-lu,
hnyls2002,
huangtingwei9988,
hzh0425,
ispobock,
merrymercy,
xiezhq-hermann and
yizhang2077
as code owners
October 6, 2026 16:55
5 tasks done
3 of 5 tasks
Collaborator
|
/tag-and-rerun-ci |
ping1jing2
approved these changes
Oct 9, 2026
Collaborator
|
/rerun-failed-ci |
5 tasks done
AnkitNakhawa
force-pushed
the
fix/npu-hicache-tensor-buffer
branch
from
October 13, 2026 18:45
c83d581 to
f2f028a
Compare
Contributor
|
Original issue has been fixed with PR #43711. Can be withdrawn |
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.
Motivation
Fixes #42672.
NPU HiCache without FIA exposes
k_bufferandv_bufferas multi-layer tensors.MHATokenToKVPoolHostusedgetattr(..., None) or ()before iterating them, which evaluates the tensor as a boolean and raisesRuntimeError: Boolean value of Tensor with more than one value is ambiguousduring host-pool construction.Modifications
Accuracy Tests
Not applicable. This changes buffer discovery during HiCache initialization and does not change model computation or outputs.
Speed Tests and Profiling
Not applicable. The change runs only during host-pool construction.
Testing
pre-commit run --files python/sglang/srt/mem_cache/pool_host/mha.py test/registered/unit/mem_cache/test_mem_pool_host.pypython -m py_compile python/sglang/srt/mem_cache/pool_host/mha.py test/registered/unit/mem_cache/test_mem_pool_host.pyNonebuffer representationsThe registered test was not collected locally because the minimal macOS environment does not contain the full SGLang development dependency set. Ascend NPU end-to-end validation was not run locally and should be covered by NPU CI.
Checklist
CI States
Latest PR Test (Base): ❌ Run #38449365184
Latest PR Test (Extra): ❌ Run #38449365223
Latest PR Test (AMD ROCm 10): ❌ Run #38449365306