{
  "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).",
  "body": "",
  "notes": "Discovery: @KBlueleaf (Kohaku Blueleaf, graduate student in Taiwan, leader of KohakuLab, researcher/dev in ComfyOrg) X thread 2026-10-03 1:51 PM ET (https://x.com/KBlueleaf/status/2106441948722868685), ~1.8K views, 3 self-thread replies | No arXiv/HF/blog links at announcement time",
  "url": "https://github.com/KohakuBlueleaf/KohakuFA",
  "links": [],
  "authors": [
    "Kohaku Blueleaf (KohakuLab / ComfyOrg)"
  ],
  "tags": [
    "kohakufa",
    "attention-kernel",
    "backward-precision",
    "flashattention",
    "cudnn",
    "fp16-instability",
    "qknorm",
    "training-stability"
  ],
  "topics": "attention kernels, mixed-precision, backward pass, FlashAttention, cuDNN, flex attention, training stability, fp16",
  "venue": "GitHub release, announced 3 Oct 2026",
  "publisher": "",
  "source": "github",
  "language": "en",
  "access": "free",
  "license": "",
  "published_year": 2026,
  "added_at": "2026-10-03T00:00:00.000Z",
  "verified_at": "2026-10-03T00:00:00.000Z",
  "attrs": {},
  "enrichment": {},
  "enriched_at": null,
  "license_class": "unknown",
  "langs": [
    "en"
  ],
  "modalities": [],
  "size_class": null,
  "provenance": {
    "channel": "random-papers",
    "legacy_paper_id": "1526"
  },
  "visibility": "public",
  "status": "active",
  "duplicate_of": null,
  "origin": "legacy",
  "created_at": "2026-10-03T22:07:56.168Z",
  "updated_at": "2026-10-03T22:07:56.168Z",
  "page": "https://papers.projxon.ai/entries/1217",
  "markdown": "https://papers.projxon.ai/entries/1217.md",
  "api": "https://papers.projxon.ai/api/entries/1217",
  "relations": [],
  "duplicates": [],
  "similar": [
    {
      "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": 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": 500,
      "kind": "paper",
      "title": "DualKV: Shared-Prompt Flash Attention for Efficient RL Training with Large Rollouts and Long Contexts",
      "summary": "Standard FA2 packs N same-prompt rollouts as N(P+R) tokens, recomputing the prompt N times. DualKV repacks to P+NR and splits attention into one prompt self-attention plus a fused kernel that reads shared KV once and accumulates N-way dK/dV with fp32 atomics; mathematically equivalent, no approximation. On Qwen3-8B GRPO (8xH100, N=32, 8K-context) policy-update is 1.63–2.09x faster, MFU 36%→76%; DAPO 2.47x / 77% MFU. At 30B MoE on 16xH100, 3.82x policy-update and 3.38x step vs FA2 that needs 4-way Ulysses SP. Also supports Gemma-4 hybrid d=512 / sliding-window at 64K. Code https://github.com/amazon-science/dualkv-flash-attn-for-rl.",
      "url": "https://arxiv.org/abs/2605.15422",
      "authors": [
        "Jiading Gai",
        "Shuai Zhang",
        "Xiang Song",
        "Bernie Wang",
        "George Karypis"
      ],
      "tags": [
        "dualkv",
        "flashattention",
        "grpo",
        "dapo",
        "kv-cache",
        "rl-training",
        "verl",
        "amazon",
        "prefix-sharing"
      ],
      "venue": "arXiv / Amazon Web Services",
      "source": "",
      "license": "",
      "published_year": 2026,
      "added_at": "2026-10-01T16:45:04.296Z",
      "has_dataset_profile": false,
      "license_class": "unknown",
      "langs": [],
      "modalities": [],
      "size_class": null,
      "citation_count": 2,
      "downloads": null,
      "stars": null,
      "page": "https://papers.projxon.ai/entries/500",
      "markdown": "https://papers.projxon.ai/entries/500.md",
      "api": "https://papers.projxon.ai/api/entries/500"
    },
    {
      "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.",
      "url": "https://github.com/ifm-ai/xattn",
      "authors": [
        "Institute of Foundation Models (IFM AI)"
      ],
      "tags": [
        "attention",
        "flashattention",
        "cuda-kernels",
        "long-context",
        "pytorch"
      ],
      "venue": "GitHub",
      "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": 8,
      "page": "https://papers.projxon.ai/entries/782",
      "markdown": "https://papers.projxon.ai/entries/782.md",
      "api": "https://papers.projxon.ai/api/entries/782"
    },
    {
      "id": 792,
      "kind": "paper",
      "title": "EasyPPO: Stabilizing the Critic Is Key",
      "summary": "Argues PPO's learned critic is a major source of instability in RL for LLMs, and identifies two critic failure modes. First, filtering truncated rollouts from both actor and critic shifts the policy objective to reward conditioned on completion, letting truncation grow even as conditional reward improves. Second, heterogeneous return noise lets high-variance prompts dominate critic updates in finite batches. Introduces EasyPPO: actor-only overlong filtering (critic trains on returns from completed and truncated rollouts), noise-normalized critic regression (each prompt's critic loss weighted by the inverse standard deviation of its sampled returns, balancing noise contributions across prompts), and moderately smaller critic minibatches to confine outlier influence during gradient clipping. No new actor loss, no new policy algorithm; actor update unchanged. Across continuous-reward coding on FrontierCS, binary-reward math reasoning on AIME24, and multi-turn search on Search-R1, using Qwen3.5-9B with rollout batch sizes 512-1024, EasyPPO stays stable through the full training horizon with zero training collapse and beats vanilla PPO, VAPO, and HL-Gauss PPO; best validation scores show relative gains of 14.89%, 2.28%, and 9.47% over PPO respectively.",
      "url": "https://arxiv.org/abs/2609.36802",
      "authors": [
        "Xuanyi Zhou",
        "Qiuyang Mang",
        "Huanzhi Mao",
        "Dacheng Li",
        "Wenhao Chai",
        "Mayank Mishra",
        "Yichuan Wang",
        "Karthik Narasimhan",
        "Alvin Cheung",
        "Joseph E. Gonzalez"
      ],
      "tags": [
        "ppo",
        "reinforcement-learning",
        "post-training",
        "critic",
        "training-stability",
        "value-function",
        "grpo"
      ],
      "venue": "arXiv",
      "source": "arxiv",
      "license": "",
      "published_year": 2026,
      "added_at": "2026-09-29T00:00:00.000Z",
      "has_dataset_profile": false,
      "license_class": "unknown",
      "langs": [
        "en"
      ],
      "modalities": [],
      "size_class": null,
      "citation_count": 0,
      "downloads": null,
      "stars": null,
      "page": "https://papers.projxon.ai/entries/792",
      "markdown": "https://papers.projxon.ai/entries/792.md",
      "api": "https://papers.projxon.ai/api/entries/792"
    },
    {
      "id": 833,
      "kind": "paper",
      "title": "ID Balancing: Stable Training of Extremely Sparse MoE via PID-Based Load Control",
      "summary": "Addresses expert load imbalance when scaling LLMs via Mixture-of-Experts with increasingly sparse routing. ID Balancing: an Integral-Derivative load-control method built on the observation that two existing auxiliary-loss-free methods are incomplete PID controllers -- DeepSeek's loss-free method is a fixed-step integral controller and Kimi K3's Quantile Balancing is a generalized proportional controller. ID Balancing scales its integral term with load error and activates its derivative term only when imbalance worsens, giving stronger corrections for large/worsening errors and smaller updates near balance. Results (Top-10/Top-5/Top-3 routing over 768 experts): in Top-3, worst-case backbone MaxVio reduced by over 50% and training-average backbone MinVio by over 12% vs the best baselines. Scaling 18.9B -> 69.9B total params (Top-10-of-768), worst-case backbone MaxVio stays nearly unchanged, ~89.6% lower than the auxiliary-loss baseline. Maintains competitive language-modeling and downstream performance; advantages grow as sparsity increases.",
      "url": "https://arxiv.org/abs/2609.39137",
      "authors": [
        "Peng Jin",
        "Zihan Qiu",
        "Zekun Wang",
        "Bo Zheng",
        "Yang Xu",
        "Tian Xie",
        "Xiao Li",
        "Huaqing Zhang",
        "Haoran Lian",
        "Rui Men",
        "Dayiheng Liu"
      ],
      "tags": [
        "mixture-of-experts",
        "moe",
        "load-balancing",
        "pid-control",
        "sparse-routing",
        "training-stability"
      ],
      "venue": "arXiv 2026-09-30 (cs.LG)",
      "source": "paper",
      "license": "",
      "published_year": 2026,
      "added_at": "2026-10-01T00:00:00.000Z",
      "has_dataset_profile": false,
      "license_class": "unknown",
      "langs": [
        "en"
      ],
      "modalities": [],
      "size_class": null,
      "citation_count": 0,
      "downloads": null,
      "stars": null,
      "page": "https://papers.projxon.ai/entries/833",
      "markdown": "https://papers.projxon.ai/entries/833.md",
      "api": "https://papers.projxon.ai/api/entries/833"
    }
  ]
}
