Repository navigation
[Performance][A5] Limit the host-offloaded Engram grid on prefill - #21827
linfeng-yuan wants to merge 3 commits into
Conversation
Signed-off-by: linfeng-yuan <1102311262@qq.com>
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request implements a performance optimization for A5 prefill workers by limiting the resource consumption of host-offloaded Engram lookups. By capping the grid size to three-quarters of the available vector cores, the system ensures that sufficient resources remain available for the main stream during multi-stream Engram overlap, resulting in improved input throughput. Highlights
New Features🧠 You can now enable Memory (public preview) to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a new configuration option, engram_prefill_uva_aiv_limit, which caps the host-offloaded Engram lookup grid to three-quarters of the available vector cores during prefill. To support this, the Triton kernel _engram_host_uva_gather_dequant_kernel was updated to use a grid-stride loop. The review feedback requests updating the pull request's title and summary to comply with the repository's style guide, providing a suggested title and summary.
| get_current_hardware_profile().device_adaptor_family == DeviceAdaptorFamily.FP8_OPTIMIZED | ||
| ) | ||
| ) | ||
| engram_prefill_uva_aiv_limit: bool = False |
There was a problem hiding this comment.
The Pull Request Title and Summary do not adhere to the repository's style guide. Please update them to match the required formats.
Suggested PR Title:
[Ops][Feature] Limit the host-offloaded Engram grid on prefillSuggested PR Summary:
### What this PR does / why we need it?
Let A5 prefill workers reserve AIV capacity for the main stream while the host-offloaded Engram gather runs on the auxiliary stream. With `engram_prefill_uva_aiv_limit=true`, the lookup launches at most three quarters of the vector cores (48 on the tested 950DT) and each program gathers its strided rows. The flag defaults to false. Keep it off on decode workers.
### Does this PR introduce _any_ user-facing change?
Yes, introduces a new additional configuration option `engram_prefill_uva_aiv_limit` (boolean, defaults to `False`) to cap the host-offloaded Engram lookup grid.
### How was this patch tested?
- Historical paired 950DT prefill run with Engram overlap and the same three-quarter cap: steady input throughput +2.02%, 512/512 first-token outputs matched. The same cap on decode reduced throughput by 1.56%.
- Ruff lint and format checks passed for touched Python files. Device validation of this draft on current main is pending.References
- The Pull Request Title and Summary must follow the specific formats defined in the Pull Request Summary Style Guide. (link)
|
👋 Hi! Thank you for contributing to the vLLM Ascend project. The following points will speed up your PR merge:
If CI fails, you can run linting and testing checks locally according Contributing and Testing. |
Signed-off-by: linfeng-yuan <1102311262@qq.com>
Signed-off-by: linfeng-yuan <1102311262@qq.com>
|
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
What this PR does / why we need it
Let A5 prefill workers reserve AIV capacity for the main stream while the host-offloaded Engram gather runs on the auxiliary stream. With
engram_prefill_uva_aiv_limit=true, the lookup launches at most three quarters of the vector cores (48 on the tested 950DT) and each program gathers its strided rows. The flag defaults to false. Keep it off on decode workers.How was this patch tested?
Related: linfeng-yuan#19 used a fixed eight-program launch.
Maintainer validation (2026-11-14)
Ascend 950DT: 48 actual device cases passed, covering registered UVA memory, BF16/INT8/MXFP8, int32/int64 IDs, T=0/1/7/129, strided inputs, opt-in on/off, and graph replay. CPU-only execution was not substituted for these device checks. This remains an opt-in Prefill path; no general serving-throughput claim is inferred from the operator tests.
bash format.sh cipassed on the reviewed source; no formatter changes remain. Combined vLLM 0.33.0 P/D integration and same-condition throughput acceptance remain pending.Integrated validation on Ascend 950DT
Validated the combined stack with vLLM 0.33.0 editable installs and the native CANNBotDSL 0.8.2 operator package. The figures below compare complete stacks.
This verifies functional requests and throughput in the paired configuration. It does not establish long-output exact agreement or benchmark accuracy.
The integrated configuration applied the Engram grid cap to prefill only.