large-language-models llama-3 multi-token-prediction h100 tensor-parallelism transmla transgqla group-query
Abstract
Multi-head Latent Attention (MLA), the attention used in DeepSeek-V2/V3, jointly compresses keys and values into a low-rank latent and matches the H100 roofline almost perfectly. Its trained weights, however, expose only one decoding path - an absorbed MQA form - which ties efficient inference to H100-class compute-bandwidth ratios, forfeits tensor parallelism along the head axis, and yields no Multi-Token Prediction (MTP) gain on commodity inference GPUs such as the export-restricted H20. We propose Group-Query Latent Attention (GQLA), a minimal modification of MLA whose trained weights expose two algebraically equivalent decoding paths over the same parameters: an MQA-absorb path identical to MLA's, and a GQA path with a per-group expanded cache. The runtime picks the path that matches the target hardware - no retraining, no custom kernels - so a single set of GQLA weights pins the rooflines of both H100 (MQA-absorb, s_q=1) and H20 (GQA + MTP, s_q=2), while supporting up to 8-way zero-redundancy tensor parallelism on the GQA path. To avoid pretraining from scratch we extend TransMLA into TransGQLA, which converts a pretrained GQA checkpoint into a GQLA model; on LLaMA-3-8B it compresses the per-token KV cache to 28.125% of the GQA baseline on the MQA-absorb path while structurally preserving GQA-level traffic on the per-group path.
한국어 요약
📋 한 줄 요약
**[LLM 추론 효율]** 하나의 가중치로 두 디코딩 경로를 노출해 H100과 H20 양쪽 하드웨어에서 최적 성능을 내는 Group-Query Latent Attention.
🎯 핵심 기여도
- MLA(DeepSeek-V2/V3의 어텐션)를 최소 수정해 **두 개의 대수적 등가 디코딩 경로**(MQA-absorb / GQA + 그룹별 확장 캐시)를 노출하는 GQLA 제안
- 런타임이 타겟 하드웨어에 맞춰 경로를 선택 → **단일 가중치 세트로 H100과 H20 모두 루프라인 달성**, 재학습·커스텀 커널 불필요
- GQA 경로에서 헤드 축을 따라 최대 **8-way 제로 리던던시 텐서 병렬화** 지원
- 사전학습된 GQA 체크포인트를 GQLA로 변환하는 **TransGQLA** 제공 (LLaMA-3-8B 기준 KV 캐시 28.125%로 압축)
💡 핵심 아이디어
MLA는 H100급 compute-bandwidth 비율에 강하게 묶여 있어 H20 같은 수출 제한 GPU에서는 헤드 축 텐서 병렬화 손실과 MTP 이득 부재를 야기한다. GQLA는 같은 파라미터에서 두 가지 디코딩 패스를 노출하여 하드웨어별 최적 경로를 선택하게 한다.
🔬 기술적 접근법
- **모델/방법론**: MLA의 최소 수정 버전으로, 동일 가중치를 두 알고리즘으로 해석
- **핵심 기법**: (1) MQA-absorb 경로(s_q=1, MLA와 동일, H100 최적), (2) GQA 경로(그룹별 확장 캐시, MTP s_q=2, H20 최적, 텐서 병렬화 지원), (3) TransGQLA로 GQA → GQLA 변환해 사전학습 불필요
📊 주요 결과
- 단일 가중치로 H100(MQA-absorb, s_q=1)과 H20(GQA+MTP, s_q=2) 루프라인 동시 달성
- LLaMA-3-8B에서 MQA-absorb 경로 KV 캐시를 GQA 베이스라인의 28.125%로 압축
- GQA 경로에서 GQA 수준 트래픽 구조적 보존, 최대 8-way 텐서 병렬화
💭 의의 및 한계
**의의**: 하드웨어 다양성을 가중치 차원에서 흡수하는 "하드웨어 적응형 어텐션" 패러다임을 제시한다. **한계**: MLA/GQA 변환 기반이라 새로운 어텐션 변형으로의 확장은 추가 분석이 필요하며, 비-MLA 사전학습 모델의 호환성은 제한적이다.
🚀 실용적 활용
- 글로벌 LLM 서빙 인프라에서 GPU 다양성 대응
- 수출 제한 환경(H20 등)에서 H100과 동등한 모델 활용
- 기존 GQA 체크포인트의 KV 캐시 압축 후처리