2606.26587v1 Jun 25, 2026 cs.LG

SharQ: LLM 추론을 위한 활성화 희소성과 FP4 양자화의 통합

SharQ: Bridging Activation Sparsity and FP4 Quantization for LLM Inference

Xindian Ma
Xindian Ma
Citations: 285
h-index: 7
Peng Zhang
Peng Zhang
Citations: 36
h-index: 4
Haoqian Meng
Haoqian Meng
Citations: 15
h-index: 2
Yilun Luo
Yilun Luo
Citations: 15
h-index: 2
Yafei Zhao
Yafei Zhao
Citations: 10
h-index: 2
Wenyuan Liu
Wenyuan Liu
Citations: 32
h-index: 3
Hua Zheng
Hua Zheng
Citations: 8
h-index: 2

최신 가속기는 점점 더 낮은 비트 부동 소수점 형식과 반정형 희소성을 지원하고 있지만, 이를 결합하여 LLM 활성화를 압축하는 것은 여전히 어려운 과제입니다. 활성화에는 입력에 따라 달라지는 이상치들이 포함되어 있어 FP4 양자화에서 블록 스케일을 지배하며, 직접적으로 N:M 희소 마스크를 적용하면 중간 값이 손실되어 희소화로 인한 손실과 양자화 오류가 결합됩니다. 본 논문에서는 훈련 없이 작동하는 추론 방법인 SharQ를 소개합니다. SharQ는 온라인의 희소-밀도 분해를 통해 활성화 희소성과 FP4 양자화를 연결합니다. 각 활성화 텐서에 대해, SharQ는 입력에 적응적인 N:M 마스크를 생성하여 이상치 중심의 희소 핵심을 추출하고, 이를 FP4로 양자화합니다. 또한 양자화된 희소 핵심을 기준으로 밀도 잔차를 정의합니다. 희소 FP4 행렬-벡터 곱셈은 핵심을 처리하고, 밀도 FP4 행렬-벡터 곱셈은 마스크로 인한 활성화 손실과 희소 경로의 양자화 오류를 보정합니다. 두 경로는 단일 FP4 가중치를 공유하며, 경로별 스케일 뷰를 사용합니다. 또한 통합된 준비 커널은 마스크 생성, 잔차 구성 및 레이어 정규화를 하나의 연산으로 흡수합니다. SharQ는 어떠한 교정 데이터, 재훈련 또는 모델 특정 튜닝도 필요하지 않습니다. Llama-3.1-8B, Qwen2.5-7B, Qwen3-30B-A3B 및 Qwen3-VL-8B 모델을 사용하여 평가한 결과, SharQ는 언어 및 시각-언어 작업에서 NVFP4와 FP16 간의 정확도 격차를 43~63% 회복했으며, NVFP4, HiF4 및 MXFP4 형식에 걸쳐 일반화됩니다. RTX 5090에서 SharQ는 FP16 대비 2.2~2.4배의 지연 시간 감소와 FP8 대비 1.2~1.4배의 처리량 향상을 제공합니다. 또한 SageAttention과 결합하여 Wan2.2-T2V-A14B 비디오 생성에서 최대 1.58배의 속도 향상을 달성했습니다. SharQ 코드는 https://github.com/actypedef/SharQ 에서 확인할 수 있습니다.

Original Abstract

Low-bit floating-point formats and semi-structured sparsity are increasingly supported by modern accelerators, yet combining them for LLM activation compression remains challenging: activations contain input-dependent outliers that dominate block scales in FP4 quantization, and directly applying N:M sparsity masks discards moderate values, coupling sparsification loss with quantization error. We introduce SharQ, a training-free inference method that bridges activation sparsity and FP4 quantization through an online sparse--dense decomposition. For each activation tensor, SharQ generates an input-adaptive N:M mask to extract an outlier-dominated sparse backbone, quantizes it to FP4, and defines a dense residual relative to the quantized sparse backbone rather than the unquantized sparse values. A sparse FP4 GEMM processes the backbone while a dense FP4 GEMM compensates for both mask-induced activation loss and sparse-path quantization error. The two paths share a single FP4 weight payload with path-specific scale views, and a fused preparation kernel absorbs mask generation, residual construction, and layer normalization into one operator. SharQ requires no calibration data, retraining, or model-specific tuning. Evaluated on Llama-3.1-8B, Qwen2.5-7B, Qwen3-30B-A3B, and Qwen3-VL-8B, SharQ recovers 43--63% of the NVFP4-to-FP16 accuracy gap across language and vision-language tasks, and generalizes across NVFP4, HiF4, and MXFP4 formats. On an RTX 5090, SharQ delivers 2.2--2.4$\times$ latency reduction over FP16 and 1.2--1.4$\times$ throughput improvement over FP8 in language model serving, and up to 1.58$\times$ speedup on Wan2.2-T2V-A14B video generation when combined with SageAttention. Our code is available at https://github.com/actypedef/SharQ.

0 Citations
0 Influential
32.45879734614 Altmetric
0.0 Score
Original PDF
5

No Analysis Report Yet

This paper hasn't been analyzed by Gemini yet.

Log in to request an AI analysis.

댓글

댓글을 작성하려면 로그인하세요.

아직 댓글이 없습니다. 첫 번째 댓글을 남겨보세요!