메뉴
BL
r/LocalLLaMA 31일 전

Qwen, 고성능 선형 어텐션 커널 FlashQLA 공개

IMP
7/10
핵심 요약

Qwen이 TileLang 기반의 고성능 선형 어텐션(Linear Attention) 커널인 FlashQLA를 공개했습니다. 순방향 연산 속도를 2~3배, 역방향 연산 속도를 2배 향상시켰으며, 특히 개인 기기에서 작동하는 에이전트 AI 및 긴 문맥(Long-context) 처리 환경에 최적화된 것이 특징입니다. 메모리 제약이 심한 에지 디바이스 환경에서 실질적인 성능 향상을 이끌어내는 실무적인 하드웨어 최적화 기법을 적용했습니다.

번역된 본문

FlashQLA 소개: TileLang 기반의 고성능 선형 어텐션(Linear Attention) 커널.

순방향(Forward) 2~3배 속도 향상. 역방향(Backward) 2배 속도 향상.

💻 개인 기기에서 동작하는 에이전트 AI(Agentic AI)를 위해 특별히 제작되었습니다.

핵심 기술:

  1. 게이트 기반 자동 카드 내 CP(Context Parallelism).
  2. 하드웨어 친화적인 대수적 재구성.
  3. TileLang 퓨즈드 워프 특화(Fused warp-specialized) 커널.

FlashQLA는 자동 카드 내(Intra-device) CP를 통해 SM(스트리밍 멀티프로세서) 활용도를 극대화합니다. 이러한 성능 향상은 특히 TP(Tensor Parallelism) 설정, 소규모 모델, 긴 문맥(Long-context) 작업 환경에서 두드러집니다.

전체 GDN(Gate-driven) 흐름을 단일 커널로 융합하는 대신, CP 및 역방향 효율성에 최적화된 두 개의 커널로 분리했습니다. 대규모 배치(Batch) 환경에서는 완전히 융합된 방식에 비해 약간의 추가 메모리 I/O 오버헤드가 발생하지만, 에지 디바이스 및 긴 문맥 작업 환경에서는 더 나은 실제 성능을 제공합니다.

역방향 패스(Backward pass)는 가장 구현하기 어려운 부분이었습니다. 매우 엄격한 온칩 메모리(On-chip memory) 제약 조건 하에서 16단계 워프 특화 파이프라인을 구축하여 궁극적으로 커널 수준에서 2배 이상의 속도 향상을 달성했습니다.

이 기술이 커뮤니티에 유용하게 쓰이길 바랍니다!

더 알아보기:

📖 블로그: https://qwen.ai/blog?id=flashqla

💻 코드: https://github.com/QwenLM/FlashQLA

원문 보기
원문 보기 (영어)
Introducing FlashQLA: high-performance linear attention kernels built on TileLang. 2–3× forward speedup. 2× backward speedup. 💻 Purpose-built for agentic AI on your personal devices. Key insights: 1. Gate-driven automatic intra-card CP. 2. Hardware-friendly algebraic reformulation. 3. TileLang fused warp-specialized kernels. FlashQLA boosts SM utilization via automatic intra-device CP. The gains are especially pronounced for TP setups, small models, and long-context workloads. Instead of fusing the entire GDN flow into a single kernel, we split it into two kernels optimized for CP and backward efficiency. At large batch sizes this incurs extra memory I/O overhead vs. a fully fused approach, but it delivers better real-world performance on edge devices and long-context workloads. The backward pass was the hardest part: we built a 16-stage warp-specialized pipeline under extremely tight on-chip memory constraints, ultimately achieving 2×+ kernel-level speedups. We hope this is useful to the community! Learn more: 📖 Blog: https://qwen.ai/blog?id=flashqla 💻 Code: https://github.com/QwenLM/FlashQLA