Repository navigation
Conversation
This was referenced Nov 3, 2026
This was referenced Nov 3, 2026
2 tasks
shuhuayu
force-pushed
the
qwen3-8-fn-03-tp-ep
branch
from
November 4, 2026 01:54
b292f9c to
cbe9b3c
Compare
shuhuayu
force-pushed
the
users/shuhuayu/qwen3-8-fn-02-model
branch
from
November 4, 2026 01:54
e0aceb3 to
a925141
Compare
shuhuayu
force-pushed
the
qwen3-8-fn-03-tp-ep
branch
from
November 4, 2026 21:15
cbe9b3c to
e15a1f6
Compare
shuhuayu
force-pushed
the
users/shuhuayu/qwen3-8-fn-02-model
branch
from
November 4, 2026 21:15
a925141 to
f387642
Compare
shuhuayu
force-pushed
the
qwen3-8-fn-03-tp-ep
branch
from
November 5, 2026 08:21
e15a1f6 to
b4b0b68
Compare
shuhuayu
force-pushed
the
users/shuhuayu/qwen3-8-fn-02-model
branch
from
November 5, 2026 08:21
f387642 to
1232b90
Compare
shuhuayu
force-pushed
the
qwen3-8-fn-03-tp-ep
branch
from
November 5, 2026 20:05
b4b0b68 to
c339afc
Compare
shuhuayu
force-pushed
the
users/shuhuayu/qwen3-8-fn-02-model
branch
from
November 5, 2026 20:06
1232b90 to
3f39d6f
Compare
shuhuayu
force-pushed
the
qwen3-8-fn-03-tp-ep
branch
from
November 5, 2026 20:14
c339afc to
ac5a16a
Compare
shuhuayu
force-pushed
the
qwen3-8-fn-03-tp-ep
branch
from
November 6, 2026 00:55
ac5a16a to
7bba104
Compare
shuhuayu
force-pushed
the
users/shuhuayu/qwen3-8-fn-02-model
branch
from
November 6, 2026 00:55
3f39d6f to
48314a2
Compare
shuhuayu
force-pushed
the
qwen3-8-fn-03-tp-ep
branch
from
November 6, 2026 03:39
7bba104 to
ff98eea
Compare
shuhuayu
force-pushed
the
qwen3-8-fn-03-tp-ep
branch
from
November 7, 2026 02:07
ff98eea to
d9413c0
Compare
shuhuayu
force-pushed
the
users/shuhuayu/qwen3-8-fn-02-model
branch
from
November 7, 2026 02:07
0f6481b to
3bb96e0
Compare
shuhuayu
force-pushed
the
qwen3-8-fn-03-tp-ep
branch
from
November 9, 2026 07:55
d9413c0 to
62df501
Compare
shuhuayu
force-pushed
the
users/shuhuayu/qwen3-8-fn-02-model
branch
from
November 9, 2026 07:55
3bb96e0 to
0972e3a
Compare
shuhuayu
force-pushed
the
qwen3-8-fn-03-tp-ep
branch
from
November 9, 2026 10:21
62df501 to
b07872a
Compare
shuhuayu
force-pushed
the
users/shuhuayu/qwen3-8-fn-02-model
branch
from
November 9, 2026 10:21
0972e3a to
06c11e0
Compare
shuhuayu
force-pushed
the
qwen3-8-fn-03-tp-ep
branch
from
November 9, 2026 10:46
b07872a to
92ab189
Compare
shuhuayu
force-pushed
the
users/shuhuayu/qwen3-8-fn-02-model
branch
from
November 9, 2026 10:46
06c11e0 to
2854b18
Compare
shuhuayu
added a commit
that referenced
this pull request
Nov 10, 2026
## Summary (human-written)
<!-- Write this yourself, not with an AI tool. 2-5 sentences: the
problem, why
this approach, and what you checked yourself. -->
this pr is to add `deterministic ` option to gdn backend (an existing
bug) so gdn has reproducible numerics.
## Why
Independent prerequisite based on `main`. Merge this before #5782; the
model stack is based on this branch.
`torch.use_deterministic_algorithms(True)` does not reach Attention
Gym's GDN L2 normalization policy. Its forward schedule is fixed, but
backward autotuning benchmarks different tile schedules. Two
strict-deterministic runs can therefore choose different backward
schedules and train differently.
**Example.** The eight-GB300 Flash-Next first-step diagnostic observes a
difference in `kda_l2norm_bwd` before the PLE output gradient or any
lookup-gradient exchange. Hash IDs and selected vectors are identical.
Disabling normalization autotuning under PyTorch's existing
deterministic flag pins the schedule.
```python
autotune = not torch.are_deterministic_algorithms_enabled()
normalized_q = l2norm(q, cu_seqlens=cu_seqlens, autotune=autotune)
```
## What changed
Pass that policy through all shared GDN normalization callsites:
ordinary chunk/recurrent forward, recurrent backward's chunk-gradient
recomputation, and CP GDN. Nondeterministic runs retain autotuning. No
model flag or alternate kernel is added.
## User-facing changes
| Before | After |
| --- | --- |
| Strict determinism still allows GDN backward normalization autotuning
| The existing PyTorch deterministic flag selects a fixed schedule. |
## Numerics and testing
- The CUDA regression checks that deterministic backward bypasses the L2
autotuner and produces finite, nonzero gradients in ordinary and
batch-invariant GDN modes. It does not assert how many times upstream
internals run in nondeterministic mode.
- The shared GDN computation in this PR is unchanged by the PLE storage
refactor. Both native DTensor and plain-owned-row qualification sources
include this same committed policy.
- Two-GB300 controlled A/B runs match first-step logits and 190 gradient
shards per rank, all twenty ten-step loss/norm values, and all 763 final
model/optimizer tensors bitwise. Full remat and checkpoint resume
preserve the result.
- The restacked TP2/SP/EP2 registered GB300 regression matches all
twenty unchanged golden values bitwise. Runtime: PyTorch
`2.16.0.dev20261030+cu132`, revision
`bf270c3251d8e84723cedbf5b60eaa60cacaa3f2`; seed 42 and strict
determinism. No production kernel or runtime patch is used.
- Existing GDN integration coverage exercises the default path; all-file
lint/typechecking pass.
```bash
python -m pytest -q tests/unit_tests/gpu/models/qwen3_5/test_qwen3_5_deltanet.py
```
The fix intentionally chooses a fixed backward schedule in deterministic
mode; it does not claim bitwise equivalence to every autotuned schedule.
#5785 carries the registered strict numerical integration. EP remains in
#5782 and TP/SP in #5783.
## Rebase validation
Rebased onto `main` at `c62c6a7552137d10d4fc3927aa20dcd69925aaf2`. This
includes #5909's upstream RL golden-reference fix. All ten losses from
the old failing RL job exactly match that corrected reference; this PR
does not edit the RL golden.
- Runtime: PyTorch `2.16.0.dev20261108+cu132`, revision
`1392e1f8e4903657d4391f3bd8fcc9ca8a74b758`; Attention Gym
`0.0.19.dev10+g26beb363c`, pinned revision
`26beb363c6d1328851bfc5c9c8691fa2066bd1fa`.
- The retained
`test_deterministic_backward_bypasses_normalization_autotuner` passes on
a GB300, covering ordinary and batch-invariant GDN forward/backward with
finite, nonzero gradients.
- All-file pre-commit, including typechecking, passes on this PR and the
complete rebased stack. Typechecking uses this runtime and isolated
stubs for optional dependencies.
- The complete stack's targeted CPU suite passes 123 tests.
The earlier multi-GPU model qualification results above apply to their
recorded pre-rebase sources and October 30 runtime. They have not been
repeated after this rebase. GitHub CI for the new head is pending.
## Stack
Prerequisite: #5784, shared GDN deterministic normalization,
independently based on `main`. Merge it first.
1. #5782: Flash-Next model, native DTensor PLE, FSDP and EP, based on
the prerequisite.
2. #5783: TP/SP and PLE feature-column sharding, based on #5782.
3. #5785: PP, remat and registered numerical integration, based on
#5783.
Local all-file hooks pass; Pyrefly uses the pinned validation runtime
and isolated optional-dependency stubs. GitHub CI is pending.
Contributor
Author
|
Closing as stale: this was based on an older revision of 1/n. The Flash-Next stack now lives on upstream branches managed with |
This was referenced Nov 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary (human-written)
Why
Stacked on #5782; the main-based GDN prerequisite #5784 is already in its ancestry.
Flash-Next needs TP for its projections and attention. #5782 provides FSDP, EP and DP row ownership for PLE. Its lexical lookup must partition feature columns as well as the DP-owned rows added in #5782; replicating that table over TP wastes the available capacity.
Example. For an eight-row, 160-feature table with DP2 and TP2, each rank stores
[4, 80]weights. A request for row 6 goes to DP owner 1 within each TP column group. The selected 80-feature responses gather across TP to form the token's 160 features. No operation gathers table rows or the whole table.What changed
User-facing changes
Numerics and testing
2.16.0.dev20261030+cu132; the same shared GDN policy is used throughout. The golden is not regenerated.Limits
CP is rejected. Full released-model capacity and throughput remain unqualified. Strict shared GDN normalization comes from prerequisite #5784; pipeline ownership and registered numerical integration follow in #5785.
Rebase validation
Rebased onto
mainatc62c6a7552137d10d4fc3927aa20dcd69925aaf2, including the upstream RL golden-reference fix in #5909. The Flash-Next compatibility edits narrow config types and initialize the BF16 router test through the current meta-materialization lifecycle; they do not change model equations.2.16.0.dev20261108+cu132, revision1392e1f8e4903657d4391f3bd8fcc9ca8a74b758; Attention Gym0.0.19.dev10+g26beb363c, pinned revision26beb363c6d1328851bfc5c9c8691fa2066bd1fa.The earlier two/eight-GPU model qualification results above apply to their recorded pre-rebase sources and October 30 runtime. Those model training comparisons have not been repeated after this rebase. GitHub CI for the new heads is pending.
Stack
Prerequisite: #5784, shared GDN deterministic normalization, independently based on
main. Merge it first.Local all-file hooks pass; Pyrefly uses the pinned validation runtime and isolated optional-dependency stubs. GitHub CI is pending.