sharq
SharQ: Bridging Activation Sparsity and FP4 Quantization for LLM Inference
Meng, Haoqian, Luo, Yilun, Zhao, Yafei, Liu, Wenyuan, Zheng, Huaqing, Ma, Xindian, Zhang, Peng
Abstractalso exposed as hardware execution paths. Block-scaled FP4 formats such as NVFP4, MXFP4, and HiF4 improve comLow-bit floating-point formats and semi-structured spar-pute density while retaining a floating-point-like dynamic range, and N:M semi-structured sparsity enables sparse ma-sity are increasingly supported by modern accelerators, trix multiplication on modern Tensor Cores (NVIDIACor-yet combining them for LLM activation compression remains challenging: activations contain input-dependentporation, 2024; Darvish Rouhani et al., 2023a,b; Luo et al., outliers that dominate block scales in FP4 quantization, 2026; NVIDIA, 2024). These trends suggest an appealing and directly applying N:M sparsity masks discards mod-target for LLM inference: combine FP4 quantization with erate values, coupling sparsification loss with quantiza-hardware-supported sparse computation. We introduce SharQ, a training-free inference method that bridges activation sparsity and FP4 quantiza-However, applying FP4 quantization to activations remains difficult. A sparse FP4 GEMM processesnate the scale and reduce the effective precision available to the backbone while a dense FP4 GEMM compensates forordinary activation values. The two paths share a single FP4 weight Quant, QuaRot, and SpinQuant, has shown from different payload with path-specific scale views, and a fusedangles that outliers and activation distributions are central obpreparation kernel absorbs mask generation, residualstacles for low-bit inference (Dettmers et al., 2022; Xiao et al., construction, and layer normalization into one operator. Mixed-precision or 7B, Qwen3-30B-A3B, and Qwen3-VL-8B, SharQ re-outlier-aware paths can reduce this error, but they often incovers 43-63% of the NVFP4-to-FP16 accuracy gaptroduce extra storage, irregular data movement, or additional kernels that are less attractive for an FP4 execution pipeline.across On an Activation sparsity offers a tempting alternative. In many RTX 5090, SharQ delivers 2.2-2.4 latency reduction LLM layers, the largest activation values are sparse and carry over FP16 and 1.2-1.4