{
  "id": 782,
  "kind": "code",
  "title": "xattn",
  "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.",
  "body": "",
  "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.",
  "url": "https://github.com/ifm-ai/xattn",
  "links": [],
  "authors": [
    "Institute of Foundation Models (IFM AI)"
  ],
  "tags": [
    "attention",
    "flashattention",
    "cuda-kernels",
    "long-context",
    "pytorch"
  ],
  "topics": "attention kernels, LLM training infrastructure",
  "venue": "GitHub",
  "publisher": "",
  "source": "github",
  "language": "en",
  "access": "public",
  "license": "Apache-2.0",
  "published_year": 2026,
  "added_at": "2026-09-29T00:00:00.000Z",
  "verified_at": "2026-09-29T00:00:00.000Z",
  "attrs": {
    "hf": {
      "kind": "repo",
      "name": "xattn",
      "namespace": "ifm-ai"
    }
  },
  "enrichment": {
    "github": {
      "forks": 1,
      "stars": 8,
      "pushed": "2026-09-28",
      "created": "2026-09-25",
      "license": "Apache-2.0",
      "archived": false,
      "language": "C++",
      "full_name": "ifm-ai/xattn",
      "fetched_at": "2026-10-03T14:33:42.626Z"
    }
  },
  "enriched_at": "2026-10-03T14:33:42.663Z",
  "license_class": "permissive",
  "langs": [
    "en"
  ],
  "modalities": [],
  "size_class": null,
  "provenance": {
    "channel": "random-papers",
    "legacy_paper_id": "863",
    "pipeline_status": "done",
    "research_status": "done"
  },
  "visibility": "public",
  "status": "active",
  "duplicate_of": null,
  "origin": "legacy",
  "created_at": "2026-10-03T12:29:06.561Z",
  "updated_at": "2026-10-03T14:33:42.663Z",
  "page": "https://papers.projxon.ai/entries/782",
  "markdown": "https://papers.projxon.ai/entries/782.md",
  "api": "https://papers.projxon.ai/api/entries/782",
  "relations": [
    {
      "relation": "about",
      "direction": "in",
      "note": "",
      "via": "manual",
      "entry": {
        "id": 1208,
        "kind": "note",
        "title": "Long context: three bets and a weak spot in evaluation (overview)",
        "summary": "An overview of the 33 entries on long-context modelling: cheaper attention, memory beside attention, and managing context from outside, plus what the benchmarks do and do not show. Written by Claude Opus 5.5.",
        "url": "",
        "authors": [
          "Claude Opus 5.5"
        ],
        "tags": [
          "synthesis",
          "ai-written",
          "long-context"
        ],
        "venue": "",
        "source": "",
        "license": "",
        "published_year": null,
        "added_at": "2026-10-03T15:08:53.361Z",
        "has_dataset_profile": false,
        "license_class": "unknown",
        "langs": [],
        "modalities": [],
        "size_class": null,
        "citation_count": null,
        "downloads": null,
        "stars": null,
        "page": "https://papers.projxon.ai/entries/1208",
        "markdown": "https://papers.projxon.ai/entries/1208.md",
        "api": "https://papers.projxon.ai/api/entries/1208"
      }
    }
  ],
  "duplicates": [],
  "similar": [
    {
      "id": 707,
      "kind": "paper",
      "title": "MoBA: Mixture of Block Attention for Long-Context LLMs",
      "summary": "Proposes Mixture of Block Attention (MoBA), which applies mixture-of-experts principles to the attention mechanism: the model learns where to attend across blocks rather than using predefined sparse patterns like sink or window attention. It claims superior long-context performance with seamless switching between full and sparse attention, and has been deployed for Kimi's long-context serving.",
      "url": "https://arxiv.org/abs/2502.13189",
      "authors": [
        "Enzhe Lu",
        "Zhejun Jiang",
        "Jingyuan Liu",
        "Yulun Du",
        "Tao Jiang",
        "Chao Hong",
        "Shaowei Liu",
        "Weiran He",
        "Enming Yuan",
        "Yuzhi Wang",
        "Zhiqi Huang",
        "Huan Yuan",
        "Suting Xu",
        "Xinran Xu",
        "Guokun Lai",
        "Yanru Chen",
        "Huabin Zheng",
        "Junjie Yan",
        "Jianlin Su",
        "Yuxin Wu",
        "Neo Y. Zhang",
        "Zhilin Yang",
        "Xinyu Zhou",
        "Mingxing Zhang",
        "Jiezhong Qiu"
      ],
      "tags": [
        "attention",
        "long-context",
        "mixture-of-experts",
        "efficient-inference",
        "kimi"
      ],
      "venue": "arXiv (cs.LG)",
      "source": "arxiv",
      "license": "",
      "published_year": 2025,
      "added_at": "2026-09-29T00:00:00.000Z",
      "has_dataset_profile": false,
      "license_class": "unknown",
      "langs": [
        "en"
      ],
      "modalities": [],
      "size_class": null,
      "citation_count": 215,
      "downloads": null,
      "stars": null,
      "page": "https://papers.projxon.ai/entries/707",
      "markdown": "https://papers.projxon.ai/entries/707.md",
      "api": "https://papers.projxon.ai/api/entries/707"
    },
    {
      "id": 1217,
      "kind": "code",
      "title": "KohakuFA: Attention Kernel with Fixed Backward-Pass Precision",
      "summary": "New attention kernel claiming severe backward-pass precision bugs in cuDNN SDPA, FlashAttention-4, and flex attention: when attention logits get huge (DINOv3 reportedly hits ~1e5 out of the box), backward gradients can be wrong by 10-1000x or become inf, while forward and loss look completely normal — so instability surfaces only late in training when reruns are expensive. Implication: some reported fp16 instability, QKNorm benefits, or 'failed runs' may be kernel artifacts, not model-design flaws. KohakuFA fixes 3 precision bugs, keeping gradients at the fp16 error floor for ~5% extra cost; fast for ViT/DiT/video. Figures: DINOv3 ViT-B/16 fine-tuning backward error over training — FA4 highest error (~0.05-0.6), KohakuFA tracks the fp64 correct-kernel floor; whole-model fp16 gradient vs fp64 across 50k-200k steps — cuDNN SDPA gradients collapse after ~100k-125k steps (cosine→0, relative error >10x), KohakuFA stays near-correct. Blackwell (SM100) only for now; sm120 support planned (flex attention reportedly has the same issue on sm120). Directly relevant to user's training-run debugging (CUDA OOMs aside, kernel-precision bugs are the same class of hard-to-diagnose training instability).",
      "url": "https://github.com/KohakuBlueleaf/KohakuFA",
      "authors": [
        "Kohaku Blueleaf (KohakuLab / ComfyOrg)"
      ],
      "tags": [
        "kohakufa",
        "attention-kernel",
        "backward-precision",
        "flashattention",
        "cudnn",
        "fp16-instability",
        "qknorm",
        "training-stability"
      ],
      "venue": "GitHub release, announced 3 Oct 2026",
      "source": "github",
      "license": "",
      "published_year": 2026,
      "added_at": "2026-10-03T00:00:00.000Z",
      "has_dataset_profile": false,
      "license_class": "unknown",
      "langs": [
        "en"
      ],
      "modalities": [],
      "size_class": null,
      "citation_count": null,
      "downloads": null,
      "stars": null,
      "page": "https://papers.projxon.ai/entries/1217",
      "markdown": "https://papers.projxon.ai/entries/1217.md",
      "api": "https://papers.projxon.ai/api/entries/1217"
    },
    {
      "id": 1230,
      "kind": "paper",
      "title": "Broken Symmetry in BF16 Attention: Why FlashAttention Gradients Blow Up Late in Training",
      "summary": "Diagnoses a late-training blow-up training a 450M transformer on 50B tokens with FlashAttention-3 in BF16: healthy for 25B tokens, then gradient norm grows 1000x and loss ends 0.2 nats above FP32 attention — with no NaNs at all. Recomputing just two layers' attention backward in FP32 removes almost all excess gradient. Part of the cause is known (a fused multiply-add in the forward softmax, never fixed in FA3); repairing it stops the blow-up but leaves the query gradient wrong by more than its own size (219% median error). The deeper cause is a broken conservation law: the softmax score gradient dS sums to zero along every row, making dQ blind to where the keys sit as a group; rounding dS to BF16 leaves a small nonzero sum that leaks the mean key into dQ — and the leak grows exactly as late training makes keys large and attention sharp. Fix: GProj (gauge projection), which restores the zero row sum after the cast with two rank-one corrections per row — cuts median dQ/dK errors from 219%/13% to 0.34%/0.37% (FP32-attention level) for 4.7% more step time; in matched from-scratch runs it reaches the same loss as FP32 attention while FA3 and key smoothing destabilize. KohakuBlueleaf replied on the thread reporting the same class of precision bug in FA4/cuDNN/flex attention and their KohakuFA fix. If a BF16 run blows up late with no NaNs, check the attention backward. Directly relevant to the user's LLM training-run debugging work.",
      "url": "https://arxiv.org/abs/2609.34272",
      "authors": [
        "Junlin Chen",
        "Daize Dong",
        "Huanwei Di",
        "Haolong Jia",
        "Jiawei Wu",
        "Haotian Xie",
        "Mingkai Zheng",
        "Yang Li",
        "Leshang Chen",
        "Huishu Wang",
        "Eric P. Xing",
        "Hongyi Wang"
      ],
      "tags": [
        "flashattention",
        "bf16",
        "gradient-stability",
        "attention-backward",
        "precision",
        "gproj",
        "gauge-projection",
        "kohakufa"
      ],
      "venue": "arXiv:2609.34272 (cs.LG), submitted 28 Sep 2026",
      "source": "arxiv",
      "license": "",
      "published_year": 2026,
      "added_at": "2026-10-04T00:00:00.000Z",
      "has_dataset_profile": false,
      "license_class": "unknown",
      "langs": [
        "en"
      ],
      "modalities": [],
      "size_class": null,
      "citation_count": null,
      "downloads": null,
      "stars": null,
      "page": "https://papers.projxon.ai/entries/1230",
      "markdown": "https://papers.projxon.ai/entries/1230.md",
      "api": "https://papers.projxon.ai/api/entries/1230"
    },
    {
      "id": 529,
      "kind": "paper",
      "title": "Screening Is Enough",
      "summary": "Multiscreen screens unit-normalized QK similarities with Trim (exact zero below threshold) and a learned causal Softmask window, then aggregates surviving values without competition; MiPE rotates only two dims and turns off for large windows. On SlimPajama (2^38 tokens, seq 2^12) it matches Transformer val loss with ~30% fewer params, stays stable at LR 2^{-4} (Transformer diverges), holds long-context PPL past train length, and on ABCDigits retrieval a 286M Multiscreen beats a 1.3B Transformer (99.18% vs 95.98% at train ctx; little degradation to 2^17). Full-context forward latency lower than FlashAttention Transformer at long ctx (RTX 4090, no KV cache). ABCDigits generator https://github.com/ken-nakanishi/abcdigits.",
      "url": "https://arxiv.org/abs/2604.01178",
      "authors": [
        "Ken M. Nakanishi"
      ],
      "tags": [
        "multiscreen",
        "screening",
        "long-context",
        "attention",
        "abcdigits",
        "rope",
        "mamba-alternative",
        "riken"
      ],
      "venue": "arXiv / RIKEN CEMS / The University of Tokyo",
      "source": "",
      "license": "",
      "published_year": 2026,
      "added_at": "2026-10-01T16:45:05.207Z",
      "has_dataset_profile": false,
      "license_class": "unknown",
      "langs": [],
      "modalities": [],
      "size_class": null,
      "citation_count": 1,
      "downloads": null,
      "stars": null,
      "page": "https://papers.projxon.ai/entries/529",
      "markdown": "https://papers.projxon.ai/entries/529.md",
      "api": "https://papers.projxon.ai/api/entries/529"
    },
    {
      "id": 1216,
      "kind": "paper",
      "title": "You Need Better Attention Priors",
      "summary": "Generalizes attention through the lens of Entropic Optimal Transport (EOT): standard attention corresponds to a transport problem regularized by an implicit uniform prior. GOAT (Generalized Optimal Transport Attention with Trainable priors) replaces that naive assumption with a learnable, continuous prior that decouples spatial geometry from token semantics — standard positional encodings (e.g., RoPE) entangle position with meaning and corrupt semantic representations when forced to handle structural biases like attention sinks. The prior maintains full compatibility with optimized kernels like FlashAttention (zero compute overhead). GOAT also provides an EOT-based explanation of attention sinks and a solution that avoids standard attention's representational trade-offs. By absorbing spatial information into the core attention computation, GOAT learns an extrapolatable prior combining the flexibility of learned positional embeddings with the length generalization of fixed encodings — strong long-context extrapolation beyond training length.",
      "url": "https://arxiv.org/abs/2601.15380",
      "authors": [
        "Elon Litman",
        "Gabe Guo"
      ],
      "tags": [
        "goat",
        "attention-priors",
        "entropic-optimal-transport",
        "rope",
        "attention-sinks",
        "long-context-extrapolation",
        "flashattention"
      ],
      "venue": "arXiv:2601.15380 (cs.LG), submitted 21 Jan 2026, v2 23 Aug 2026",
      "source": "arxiv",
      "license": "",
      "published_year": 2026,
      "added_at": "2026-10-03T00:00:00.000Z",
      "has_dataset_profile": false,
      "license_class": "unknown",
      "langs": [
        "en"
      ],
      "modalities": [],
      "size_class": null,
      "citation_count": null,
      "downloads": null,
      "stars": null,
      "page": "https://papers.projxon.ai/entries/1216",
      "markdown": "https://papers.projxon.ai/entries/1216.md",
      "api": "https://papers.projxon.ai/api/entries/1216"
    },
    {
      "id": 733,
      "kind": "code",
      "title": "xLLM: Light-weight infrastructure for express LLM pre-training",
      "summary": "Apache-2.0 PyTorch framework for long-context LLM pretraining supporting dense, MoE, and MoVA architectures, with FSDP1/FSDP2, data/model/context parallelism, custom CUDA kernels, FlashAttention, online tokenization and packing, evaluation, HuggingFace export, and vLLM support.",
      "url": "https://github.com/ifm-ai/xllm",
      "authors": [],
      "tags": [
        "pretraining",
        "infrastructure",
        "long-context",
        "moe",
        "cuda",
        "open-source"
      ],
      "venue": "GitHub (ifm-ai)",
      "source": "github",
      "license": "Apache-2.0",
      "published_year": 2026,
      "added_at": "2026-09-29T00:00:00.000Z",
      "has_dataset_profile": false,
      "license_class": "permissive",
      "langs": [
        "en"
      ],
      "modalities": [],
      "size_class": null,
      "citation_count": null,
      "downloads": null,
      "stars": 98,
      "page": "https://papers.projxon.ai/entries/733",
      "markdown": "https://papers.projxon.ai/entries/733.md",
      "api": "https://papers.projxon.ai/api/entries/733"
    }
  ]
}
