Accelerating Mixture of Block Attention via Dynamic Routing, KV-Centric Execution and Runtime Pipelining

Yingqi Shi, Junru Lu, Yun Liu, Di Yin, Xing Sun

arXiv:2611.26268 · 2026-11-22 공개 · arXiv · PDF

long-context dynamic-routing ruler-score mixture-of-block-attention tensor-core kv-centric runtime-pipelining sparse-metadata

Abstract

Mixture of Block Attention (MoBA) reduces long-context computation by selecting key-value (KV) blocks for each query. FlashMoBA implements MoBA efficiently but retains a fixed Top-k budget and query-centric schedule. Fixed Top-k applies one budget across different score distributions and couples routing to task granularity; query-range ownership fragments K/V reuse when several ranges select the same column. We present LightningMoBA, which co-designs selection and execution through dynamic routing, KV-centric ownership, and runtime pipelining. Dynamic routing thresholds MoBA's per-query block scores and directly emits variable-cardinality sparse metadata. KV-centric ownership groups selected rows by (query head, KV block) column, splits high-fanout columns into bounded tasks, and reuses each task's loaded KV tile. On Hopper, pipelining overlaps regular K/V transfers and irregular query gathers with Tensor Core computation. Together, these mechanisms decouple retention from GPU scheduling granularity. At matched Top-16 retention across five checkpoints, LightningMoBA accelerates end-to-end generation by 1.20 to 1.60x while raising mean RULER score from 74.42 to 75.28.

한국어 요약

한 줄 요약

LightningMoBA는 동적 라우팅, KV 중심 실행, 런타임 파이프라인을 통해 MoBA 기반 어텐션 연산을 최대 1.6× 가속화한다.

핵심 기여도

핵심 아이디어

기존 FlashMoBA는 고정된 Top-k 블록 선택과 쿼리 중심 스케줄링으로 인해, 점수 분포에 따라 불필요한 블록이 선택되거나, KV 재사용이 제한된다. LightningMoBA는 이 문제를 해결하기 위해 **동적 라우팅**을 도입하여, 각 쿼리의 점수 분포에 따라 가변적으로 블록을 선택하고, 정렬된 후보 집합 없이 즉시 스파스 메타데이터를 생성한다. 또한, **KV 중심 소유권**(query head, KV block)을 기준으로 작업을 그룹화하여, 높은 팬아웃 컬럼을 제한된 작업으로 분할하고, KV 타일 재사용을 최적화한다. Hopper GPU에서는 **TMA 기반 K/V 전송**과 **Tensor Core 연산**을 중첩하는 **비대칭 파이프라인**을 통해 데이터 이동과 계산을 병렬화한다.

기술적 접근법

주요 결과

의의 및 한계

LightningMoBA는 기존 MoBA의 고정된 블록 선택과 쿼리 중심 스케줄링의 한계를 극복하고, GPU 작업과 라우팅 정책을 통합 최적화함으로써, **성능과 정확도를 동시에 향상**시킨다. 특히, **KV 중심 소유권과 런타임 파이프라인**은 GPU 자원 활용을 극대화하며, **동적 라우팅**은 다양한 점수 분포에 유연하게 대응할 수 있다. 그러나, **모든 점수 분포에서 동적 라우팅이 항상 최적**이라는 보장은 없으며, **임계값 설정에 따라 성능 변동**이 있을 수 있다.

실용적 활용

LightningMoBA는 **대규모 언어 모델의 추론 및 학습**에 적용 가능하며, 특히 **GPU 기반의 고성능 컴퓨팅 환경**에서 효과적이다. **Qwen3-4B, Llama-3.1-8B 등 대형 모델**의 효율적 처리에 활용할 수 있으며, **장기 컨텍스트 처리가 필요한 NLP 어플리케이션**에도 적합하다.