Derive CAM HCCL buffer sizes per role - #234
Draft
ShwStone wants to merge 1 commit into
Draft
Conversation
ShwStone
commented
Aug 13, 2026
| CAM_BUFFER_SAFETY_FACTOR_DENOMINATOR = 10 | ||
| CAM_MEMORY_RESERVE_FACTOR_NUMERATOR = 5 | ||
| CAM_MEMORY_RESERVE_FACTOR_DENOMINATOR = 2 | ||
| HCCL_BYTES_PER_MB = 1024 * 1024 |
Contributor
Author
There was a problem hiding this comment.
BYTES_PER_MB is kind of stupid
| logger = init_logger(__name__) | ||
|
|
||
|
|
||
| def derive_async_cam_hccl_buffer_plan( |
Contributor
Author
There was a problem hiding this comment.
this hccl-buffer auto planning should not just use for Async. pls impl for both async & p2p
ShwStone
force-pushed
the
agent/cam-auto-hccl-buffer
branch
from
August 13, 2026 02:16
5b88ed6 to
e49bc17
Compare
Signed-off-by: ShwStone <haowenshi@outlook.com>
ShwStone
force-pushed
the
agent/cam-auto-hccl-buffer
branch
from
August 13, 2026 02:18
e49bc17 to
68af65c
Compare
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
gpu_memory_utilizationis less than 2.5x the role-local CAM buffer, without changing the configured utilizationHCCL_BUFFSIZEsetting for unrelated HCCL groupsMotivation
HCCL_BUFFSIZEis process-wide, so increasing it for CAM also enlarges unrelated TP, DP, PCP, or EP communication buffers. The derived size is now scoped to connector-owned HCCL process groups.HCCL_BUFFSIZEis neither overwritten nor unset, so users can still tune other HCCL groups intentionally.The derived requirements are:
The FFN formula intentionally has no
topk + 1multiplier.num_npus_per_dp_groupdescribes the total NPU count within one Attention DP group; the currently supported topology realizes that dimension with TP.Validation
uv run --locked ruff check .uv run --locked ruff format --check .uv run --locked pytest -q tests/unit -m 'not gpu and not vllm_runtime'python3 -m compileall -q afd_plugin testsbash -n recipe/npu/CAMAsyncAFDConnector/deepseek_v3_2/v0_26_accuracy/attention_dp2tp8.sh recipe/npu/CAMAsyncAFDConnector/deepseek_v3_2/v0_26_accuracy/ffn_ep16.sh recipe/npu/CAMP2pAFDConnector/deepseek_v3_2/afd_attention.sh recipe/npu/CAMP2pAFDConnector/deepseek_v3_2/afd_ffn.shgit diff --checkNPU end-to-end validation is still pending.