Repository navigation
[Perf] engram: Read host-table rows in address order on GPUs without host page tables - #45879
Merged
Merged
Conversation
hnyls2002
requested review from
BBuf,
DarkSharpness,
Edwardf0t1,
Fridge003,
HaiShaw,
HydraQYH,
Ying1123,
celve,
ch-wan,
ispobock,
merrymercy and
yuan-luo
as code owners
October 22, 2026 19:32
Collaborator
Author
|
/rerun-test test_engram_history.py test_deepseek_v41_flash_gb300_dp2ep2.py test_deepseek_v41_flash_gb300_tp2ep2.py |
Collaborator
Author
|
/tag-and-rerun-ci |
Contributor
|
🚀 🚀 |
Open
5 tasks
ll2088
added a commit
to ll2088/sglang
that referenced
this pull request
Nov 2, 2026
#2) perf(engram): add optional sorted host-table reads to engram_gather (from sgl-project#45879)
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.
engram_gathertakessort_ids: it sorts the ids, reads the rows in address order and stores each row at its original position. Output is bitwise identical.EngramEmbeddingturns it on for host tables only whenCU_DEVICE_ATTRIBUTE_PAGEABLE_MEMORY_ACCESS_USES_HOST_PAGE_TABLESis 0, i.e. the GPU maps pinned host memory in its own page tables (PCIe hosts). On NVLink-C2C hosts the attribute is 1, reads go through the host page tables, sorting only adds work, and the path is unchanged. Device tables and HIP are unchanged. No new flag.No behavior change except the order of host-table reads on GPUs without host page tables.
Verification: bitwise-equal gather output; DeepSeek-V4.1-Flash DEP4 with host Engram tables on a PCIe host is faster in prefill, and on an NVLink-C2C host the path is not taken (throughput unchanged); GSM8K unchanged.
CI States
Latest PR Test (Base): 🚫 Run #39841033519
Latest PR Test (Extra): ❌ Run #39841032986
Latest PR Test (AMD ROCm 10): 🚫 Run #39841033377