Reproduce “HiFA4: Training-Free 4-bit FlashAttention on Ascend HIF4 NPUs for LLM Inference” on OpenResearch

Run Claude Code, Codex or any coding agent as a research agent: literature, hypotheses and experiments on your laptop, cluster or cloud GPUs.

Universal app for Apple silicon and Intel. Requires macOS 11 or later.

About this paper

Hui Dong, Yanzhao Li, Jie Gao, Chunlu Li, Zhiyuan Zhang, Yupeng Sun, Zhenyuan Chen, Zhiqiang Zou

HiFA4 enables efficient and accurate 4-bit quantization for Large Language Model inference within the FlashAttention kernel on Ascend HIF4 NPUs. The method recovers 37.5% of the accuracy loss from direct 4-bit quantization on Qwen3-8B, projects a 35.4% reduction in critical-path latency, and stabilizes long-context performance.

Key insights

  • K-activation outliers, often stemming from fixed model parameters, can be effectively mitigated by per-channel rescaling without incurring online overheads.
  • A mismatch in precision between softmax normalizer accumulation and the PV GEMM introduces a systematic output-scaling error, necessitating a consistent approach.
  • Specific, hardware-tailored solutions are required for 4-bit quantization within FlashAttention on Ascend HIF4 NPUs due to their unique hierarchical block-floating-point format.

Summary by alphaXiv.

Tip: change arxiv.org to autoarxiv.org in any arXiv abstract link to open the paper here.