Repository navigation
[ROCm][Perf] Kimi-K3 Remove prefill pipeline stall in chunk KDA - #51862
Conversation
Signed-off-by: kliuae <kuanfu.liu@embeddedllm.com>
Signed-off-by: kliuae <kuanfu.liu@embeddedllm.com>
|
I guess they are not completely duplicate but overlapping |
|
Thanks for pointing this to the #51540 PR @njhill. I believe this PR is not a duplicate, but it extends the coverage and enhances sync/stall removal for Kimi-K3 on ROCm. For ROCm KDA, #51540 only handles the Kimi-Linear path, and Kimi-K3 still uses This PR additionally wires This PR also builds |
|
/ci run |
|
✅ Triggered Buildkite CI #83506 for commit |
|
This pull request has merge conflicts that must be resolved before it can be |
There was a problem hiding this comment.
LGTM. For this PR it does not affect NVIDIA, and only affects AMD. This PR contains full necessary feature to reduce D2H and H2D on ROCm. We can ship this PR then only ship PR #51540 which is more general and affecting both NVIDIA and ROCm path.
NOTE: #51540 does not cover kimi k3 on ROCm so both PRs are orthogonal.
|
✅ @kliuae, CI is now available for this PR.
|
|
/ci run |
|
✅ Triggered Buildkite CI #83526 for commit |
…-project#51862) Signed-off-by: kliuae <kuanfu.liu@embeddedllm.com> Signed-off-by: Zhu, Zufang <zufang.zhu@intel.com>
…-project#51862) Signed-off-by: kliuae <kuanfu.liu@embeddedllm.com>
Purpose
On ROCm's Kimi-K3 path, each prefill/mixed step has a stall in
prepare_chunk_indices, caused by two interacting factors:tolist()D2H copy makes the host wait until the device queue is emptiedThe data that the host waits on is already sitting on the host. At each step,
GDNAttentionMetadataBuilderbuildschunk_indicesandchunk_offsetsfromquery_start_loc_cpuand saves them in attention metadata. However, the ROCm Kimi-K3 path does not use it, and the stall waiting on and rebuilding the data from the device is a duplication of the same work.This PR addresses this and removes the stall by
chunk_indicesandchunk_offsets. When they're provided, they don't need to be rebuilt throughprepare_chunk_indices.prepare_chunk_offsetscall in metadata builder, building them directly on the device, instead of having a synchronization point waiting on the host-side python loop and host-device copy before the next device workload can be queued.These remove the stall from
prepare_chunk_indices, and achieves TTFT and performance gain especially in low concurrency scenarios where the stall cannot be hidden by the heavy device workloads.Test Plan
E2E benchmark and lm_eval with gsm8k on MI355X
Server command
Benchmark
lm_eval
Test Result
gsm8k on MI355X
Benchmark results
Essential Elements of an Effective PR Description Checklist
supported_models.mdandexamplesfor a new model.