arXiv:2604.20819v2 cs.LG

Stream-CQSA: 어텐션의 정확한 메모리 부족(OOM) 복구

Stream-CQSA: Exact Out-of-Memory Recovery for Attention

Yiming Bian, Joshua M. Akey

제출 2026-04-22

한국어 초록

장문맥 대규모 언어 모델(LLM)은 어텐션 비용뿐 아니라 메모리 부족(out-of-memory, OOM) 실패에도 제약을 받는다. 커널이 최적화되어 있어도 선택된 어텐션 호출이 사용 가능한 디바이스 메모리에 들어가지 못할 수 있다. 정확 및 근사 어텐션 방법은 메모리 사용을 줄이지만, 고정된 구현마다 여전히 디바이스별 용량 경계가 있다. 우리는 순환 쿼럼 집합(cyclic quorum sets, CQS) 이론에서 유도된 CQS 분해에 기반한 어텐션 수준 OOM 복구 프레임워크인 Stream-CQSA를 제안한다. Stream-CQSA는 실행 불가능한 어텐션 호출을 독립적인 부분 서열(subsequence) 작업으로 재귀적으로 분할하고, 각각을 호환되는 내부 커널로 실행한 뒤, 지역 통계를 재결합하여 전체 어텐션 출력을 복구한다. 이 복구는 래핑된 어텐션 커널이 정확하든 근사이든, 해당 커널에 대해 정확(exact)하다. 주요 기준선인 FlashAttention-2와 비교하면, 네이티브 Stream-CQSA 커널은 dense float64 기준 대비 16비트 순전파(forward) 출력 오차를 개선하고, FlashAttention-2가 GPU 메모리에 들어가는 경우 16비트 역전파(backward) 그래디언트 오차와 일치한다. 기준선이 실행 가능한 최장 길이에서 순전파 런타임은 $1.5$--$1.9\times$, 순전파–역전파 런타임은 $2.1$--$2.4\times$이다. 그 서열 길이 경계를 넘어서면 FlashAttention-2는 OOM이 발생하는 반면, 본 방법은 계속 출력을 반환한다. 따라서 Stream-CQSA는 더 빠른 어텐션 방법이 아니다. 대신 추가 연산, 호스트–디바이스 전송, 재결합을 대가로 완료(completion)를 얻으며 메모리 용량 실패를 복구 가능한 실행 경로로 전환한다.

원문 초록

Long-context large language models are limited not only by attention cost but also by out-of-memory (OOM) failures. A selected attention call may not fit in available device memory even when the kernel is optimized. Exact and approximate attention methods reduce memory use, but every fixed implementation still has a device-specific capacity boundary. We introduce Stream-CQSA, an attention-level OOM recovery framework based on CQS decomposition, derived from the theory of cyclic quorum sets (CQS). Stream-CQSA recursively partitions an infeasible attention call into independent subsequence tasks, executes each with a compatible inner kernel, and recomposes the local statistics to recover the full attention output. This recovery is exact relative to the wrapped attention kernel, whether that kernel is exact or approximate. Compared with FlashAttention-2, the major baseline, our native Stream-CQSA kernel improves 16-bit forward-output error relative to a dense float64 reference and matches 16-bit backward-gradient error where FlashAttention-2 fits in the GPU memory. At the longest feasible baseline length, it costs $1.5$--$1.9\times$ the forward runtime and $2.1$--$2.4\times$ the forward--backward runtime. Beyond that sequence length boundary, our method continues to return an output while FlashAttention-2 OOMs. Stream-CQSA is therefore not a faster attention method. Instead, it converts memory-capacity failure into a recoverable execution path by trading extra compute, host-device transfer, and recomposition for completion.

제출 이력

확인된 버전만 표시합니다. 전체 제출 이력은 arXiv 원문에서 확인하세요.

  1. arXiv:2604.20819v2제출 시각 미확인

함께 살펴볼 논문

공통 태그를 근거로 연결했습니다. 실제 인용 관계나 논문의 우수성을 뜻하지 않습니다.

공통 태그로 연결된 공개 논문이 아직 없습니다.

토론

이 논문과 연결된 포럼 글이 아직 없습니다.