# xattn

- **ID:** 782
- **Kind:** code
- **URL:** https://github.com/ifm-ai/xattn
- **Authors:** Institute of Foundation Models (IFM AI)
- **Venue:** GitHub
- **Published:** 2026
- **Source:** github
- **Language:** en
- **Access:** public
- **License:** Apache-2.0
- **License family:** Permissive (auto-classified)
- **Tags:** attention, flashattention, cuda-kernels, long-context, pytorch
- **Topics:** attention kernels, LLM training infrastructure
- **Added:** 2026-09-29
- **Verified:** 2026-09-29
- **Research status:** done
- **Page:** https://papers.projxon.ai/entries/782

## Summary

Efficient attention modules for the xLLM framework, with Python APIs for use in other PyTorch projects. Features high-precision FP32 attention output state for backward (reducing BF16 gradient error) and flexible segment-aware masking (segment IDs or BOS masks) for packed sequences. Supports causal Flash Attention, sliding window, sliding chunk, and SoftDelta attention variants; FP16/BF16 inputs; MHA, GQA, and MQA.

## From the source (fetched 2026-10-03)

- **Repository:** ifm-ai/xattn (GitHub)
- **Created:** Sep 25, 2026 (GitHub)
- **Last push:** Sep 28, 2026 (GitHub)
- **Stars:** 8 (GitHub)
- **Forks:** 1 (GitHub)
- **Main language:** C++ (GitHub)

## Research notes

- Discovery: open-sourced by Xuezhe "Max" Ma (@MaxMa1987, Research Lead @ USC ISI / Asst. Prof. @ USC CS; PhD CMU) on 2026-09-28, quoting an @IFM_AI post on LLM pre-training/fine-tuning rework costs: https://x.com/MaxMa1987/status/2104650088610156753
- Method: CUDA attention kernels.
- Apache 2.0.
- Created 2026-09-25; 6 stars at research time.
- Led by Shicheng Wen (per announcement thread).
- SM90 builds supported; SM100+ not yet supported.

## Related entries

- Discussed in: [Long context: three bets and a weak spot in evaluation (overview)](https://papers.projxon.ai/entries/1208) (note, #1208)

## Similar entries

- [MoBA: Mixture of Block Attention for Long-Context LLMs](https://papers.projxon.ai/entries/707) (paper, #707)
- [KohakuFA: Attention Kernel with Fixed Backward-Pass Precision](https://papers.projxon.ai/entries/1217) (code, #1217)
- [Broken Symmetry in BF16 Attention: Why FlashAttention Gradients Blow Up Late in Training](https://papers.projxon.ai/entries/1230) (paper, #1230)
- [Screening Is Enough](https://papers.projxon.ai/entries/529) (paper, #529)
- [You Need Better Attention Priors](https://papers.projxon.ai/entries/1216) (paper, #1216)
- [xLLM: Light-weight infrastructure for express LLM pre-training](https://papers.projxon.ai/entries/733) (code, #733)
