Add challenge 88: Prefix-Cached Attention (Medium)#231
Open
claude[bot] wants to merge 1 commit intomainfrom
Open
Add challenge 88: Prefix-Cached Attention (Medium)#231claude[bot] wants to merge 1 commit intomainfrom
claude[bot] wants to merge 1 commit intomainfrom
Conversation
Chunked-prefill attention where new query tokens attend to a full KV cache prefix plus causally to each other — the core operation in LLM inference systems like vLLM and TensorRT-LLM. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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
Challenge description
Given:
Qshape(num_heads, new_len, head_dim)— queries for a chunk of new tokensK,Vshape(num_heads, cache_len + new_len, head_dim)— packed key/value buffer (cache prefix followed by new tokens)Compute scaled dot-product attention where query token
i(absolute positioncache_len + i) attends to keyjiffj ≤ cache_len + i. This gives full access to the cached prefix and causal access within the new chunk.Validation
run_challenge.py --action runagainst the live T4 GPU platform — all tests passTest plan
num_heads=32,cache_len=1024,new_len=512,head_dim=128— fits well within 16 GB VRAM (≈64 MB per test)🤖 Generated with Claude Code