Repository navigation
Warn at load when Ring's Lightning Attention-2 backward runs in torch on Hopper - #331
Conversation
… on Hopper On H100 and H200 under Triton 3.4.0 to 3.7.0, Ring-mini-linear-2.0 trains its Lightning Attention-2 backward on the torch kernel from #312: its remote code calls fla's chunk_simple_gla with a per-token gate, and that op's backward calls chunk_bwd_dqkwg. The load warning looked only for GatedDeltaNet layers in the config, and Ring's config declares layer_group_size with no layer_types, so Ring took the slow path without a word. The warning now asks one predicate, _has_gated_chunk_backward_layers: GatedDeltaNet layers read off the config, or a module holding Lightning Attention-2's decay slope. That module test is the one the slope repair already used, now named is_lightning_attention in buffer_repair. The config cannot tell Ring apart: Ling 3.0's remote config declares the same layer groups, and its KDA backward never calls chunk_bwd_dqkwg in fla 0.6.0. The warning text says "fla's gated chunk backward" now, since both ops share that kernel. I ran these on CPU in the 1.3.0 image: - tests/cpu/kernels/test_gated_delta_backward.py: 37 passed - tests/cpu/kernels and tests/cpu/model_loading: 1594 passed, 48 skipped - tests/cpu/conventions: 767 passed - ruff check and ruff format --check (0.9.10, the uv.lock pin), and ./scripts/docs/check_links.sh The new test fails on 68ecc4b (ring_main_rank logs 0 warnings, expected 1). With a layer-group check in place of the slope test, ling3_kda_layers fails instead. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Approval
.github/APPROVED_CONTRIBUTORS, or I have write access).What & why
Follow-up to #312, where the review asked for the load warning to cover Ring too.
On H100 and H200 under Triton 3.4.0 to 3.7.0, Ring-mini-linear-2.0 trains its Lightning Attention-2 backward on the torch kernel from #312. Its remote code calls fla's
chunk_simple_glawith a per-token gate at lines 1048 to 1052 ofmodeling_bailing_moe_linear_v2.py. In fla 0.6.0 that op's backward callschunk_bwd_dqkwgat line 108 offla/ops/simple_gla/chunk.py. The load warning looked only for GatedDeltaNet layers in the config. Ring's config declareslayer_group_sizeand nolayer_types, so Ring ran the slow path with no warning._warn_on_torch_gated_backwardnow asks one predicate,_has_gated_chunk_backward_layers. It is true for GatedDeltaNet layers read off the config, as before, and for any module that holds Lightning Attention-2's decayslope. That module test is the one the slope repair inbuffer_repair.pyalready used; I moved it intois_lightning_attentionso both callers share it. A config check cannot single Ring out: Ling 3.0's remote config declares the same layer groups, and its KDA backward never callschunk_bwd_dqkwg(I grepped every caller in fla 0.6.0). The warning text now says "fla's gated chunk backward", because both ops share that kernel. The bailing and Qwen3.5 pages say what happens now.Type of change
Proof of Value
original checkpoint still loads.
Environment (optional)
halo:blackwell1.3.0AI assistance
CLAUDE.mdand the project standards (no unreviewed AI-slop).Checklist
make lintandmake formatpassmake test-cpu(andmake test-gpu-coreif GPU-affecting) passmake docsis green)git rebase --exec 'git commit --amend --no-edit -S' <base>and force-pushThe whole
make test-cpuran on147a7de68in the 1.3.0 image: 22,817 passed and 0 failed acrosstests/cpu, and 1,868 passed intests/cpu/environments, which ran apart.🤖 Generated with Claude Code
Summary by CodeRabbit
Bug Fixes
Documentation