PyTorchKR Papers

업데이트된 논문

총 2편
태그·기간 등 상세 필터

카테고리 탐색

로그인 후 이 태그 구독

arXiv:2607.11976v5cs.LG

LiteTopK: 장문맥 희소 어텐션용 통합 Indexer-TopK 커널을 위한 차원의 저주 활용

LiteTopK: Exploiting the Curse of Dimensionality for a Fused Indexer-TopK Kernel in Long-Context Sparse Attention

Indexer-TopK, which computes scores and selects the top-$k$ candidates, is a key primitive in long-context sparse attention for large language models, vector retrieval for recommendation systems, and vector databases. However, existing GPU-based Indexer-TopK kernels like DeepSeek Sparse Attention (DSA) typically separate scoring from selection and materialize the full score matrix in high-bandwidth memory. This strategy is inefficient for large score matrices, such as those encountered in long-context sparse attention, due to excessive global-memory traffic, costly synchronization, and prohibitive memory overhead. In this study, motivated by the curse of dimensionality, we observe that sparse attention scores exhibit a score concentration phenomenon, with scores falling within a narrow range. Based on this observation, we propose LiteTopK, a sample-filter-select framework that estimates query-data score ranges from a small subset of the data. It uses these estimates to filter scores as they are computed, materializes only the candidates that pass the filter, and selects from the surviving candidates. In particular, we develop two implementations of LiteTopK. The first uses a conservative threshold estimate, while the second pairs a predicted threshold with a fallback strategy. Building on LiteTopK, we further propose LiteDSA, which reuses overlapping key/value entries across neighboring queries to accelerate attention computation. We integrate LiteTopK into vLLM, SGLang, and Megatron-LM. Our evaluation on eight B200 GPUs demonstrates prefill speedups of up to 1.49$\times$ across GLM-5.2, DeepSeek-V4-Flash, and Hy-4-Preview at a context length of 1M tokens, without compromising model capabilities.

arXiv:2607.21535v2cs.LG

Windowed-MTP: 백만 토큰 컨텍스트에서 전체 컨텍스트 Draft-KV 부담 제거

Windowed-MTP: Removing the Full-Context Draft-KV Tax at Million-Token Context

추측 디코딩(speculative decoding)은 드래프트가 토큰을 제안하고 타깃이 이를 병렬로 검증하게 하여 자기회귀 생성을 가속한다. 최신 프런티어 모델은 검증에 비해 비용이 적다고 가정되는 다중 토큰 예측(MTP) 드래프트 헤드를 점점 더 많이 내장하여 출시한다. 그러나 출시된 풀 어텐션 MTP 헤드는 긴 컨텍스트에서 하이브리드 타깃에 비해 불균형적으로 비싸질 수 있다. 이 헤드는 디코드 단계마다 $\gamma$번의 드래프트 순전파 각각에서 전체 KV 캐시에 어텐션을 수행하는 반면, 타깃 레이어 중 풀 어텐션을 유지하는 것은 9-25%에 불과하므로, 단일 드래프트 레이어가 타깃 전체와 맞먹는 속도로 컨텍스트 읽기를 발생시킬 수 있다. 수락률이 낮은 어려운 워크로드에서는 심층 네이티브 MTP가 순손실이 되어, 추측을 하지 않는 경우보다 느려진다. 우리는 StreamingLLM 방식의 윈도와 어텐션 싱크를 드래프트에만 적용한다(Windowed-MTP). 타깃 검증은 전체 컨텍스트로 유지되므로 타깃 분포는 보존된다. 이 개입은 추가 학습이 필요 없으며 그대로 끼워 쓸 수 있다. SGLang에서 GPU 한 대로 1M 컨텍스트의 두 하이브리드 계열(Gated DeltaNet과 Mamba2) 모델 세 가지에 적용했을 때, 네이티브 MTP 대비 수락률과 무관하게 디코드 단계당 1.28-1.44배의 속도 향상을 보인다. 속도 향상은 컨텍스트가 길수록 커지며, 수락률이 같을 때 TPOT도 동일한 배율로 개선된다. 윈도는 드래프트 작업 집합의 대부분을 제거하고, 소형 링 버퍼는 이 감소를 실제 용량으로 전환한다. 즉, 그렇지 않으면 쓰이지 않는 드래프트 풀을 회수하는데, 이는 1M에서 전체 KV의 측정치 7.7-11.1%에 해당하며, Qwen-35B 배치 스윕에서 1M 요청 하나를 추가로 동시 처리할 여유를 만든다.