Repository navigation
perf(umbp): build transfer plans incrementally - #758
Conversation
Signed-off-by: BadrBasowid <badr.basowid@gmail.com>
Signed-off-by: BadrBasowid <badr.basowid@gmail.com>
Signed-off-by: BadrBasowid <badr.basowid@gmail.com>
Signed-off-by: BadrBasowid <badr.basowid@gmail.com>
46bd984 to
300657e
Compare
|
@BadrBasowid Thanks for the work! Could you please explain what does the "API latency" in your table mean? Is that total kvcache load latency or just the latency of building transfer plan? |
|
@TianDi101 Thanks for the review, API latency refers to the wall time of one complete |
|
I benchmarked the plan-building phase on its own: items are built as in
I will merge it soon. |
|
@BadrBasowid Did you check K3 output correcnetss? |
@TianDi101 I ran the following lm_eval task two times:
The first run populates DRAM and the second one reads from the cache:
The generated text was byte identical for 93% percent of the prompts, 7% had minor differences |
Conflict with #758 in BatchGetRanges: #758 replaced the local_items vector with an incremental plan builder, and this branch splits the local phase into resolve -> copy -> release rounds. Each round now gets its own builder, since its copies must finish before its holds are released. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Motivation
Large range restores create many
TransferItemobjects before transfer planning, increasing allocation, copying, and page-fault overhead.Technical Details
Test Plan
test_transfer_engine.moonshotai/Kimi-K3with TP8, FP8 KV cache, concurrency 1, and forcedGatherFragmentsKernel(TheGatherFragmentsKerneloutperforms hipMemcpy by at least 1.5x for all profiled shapes in my setup, see perf(umbp): keep large restore fragments on the gather kernel #717).Test Result
All 17 transfer-engine unit tests passed.
For a 999,936-token cached prefix on
moonshotai/Kimi-K3running on vllm, using median results from 12 samples:Submission Checklist