You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
NNX: fix Linen-parity gaps on the default path + unit tests
With pure_nnx/enable_nnx/pure_nnx_decoder defaulting to True, several
train/loss/decoder/metrics/GRPO paths diverged from Linen. Fixes:
- skip_step_on_spikes: forward loss/grad_norm through apply_gradients to the
optax skip-step optimizer; read is_skipped back off the NNX optimizer.
- loss_fn: check the indexer dense-warmup before num_vocab_tiling (Linen order).
- decoder logits guards: use the model_mode call-arg, not self.model_mode.
- routed_bias read: dispatch the Linen intermediates path vs an NNX suffix match.
- record_activation_metrics: collect by path suffix so it works for Linen and
NNX, scanned and unscanned (also fixes a pre-existing Linen KeyError).
- nnx_attrs_to_linen_vars: skip non-Variable attrs (qwix bookkeeping) not raise.
- config: error when qwix quant can't reach a bridged Linen decoder under pure_nnx.
- maxengine.set_engine_vars_from_base_engine: skip the quant copy and use the NNX
kv-cache annotations on the NNX path.
- GRPO _train_step_nnx: gradient-accumulation scan loop; fix the GA loss metric.
- GRPO pathways reshard: drop the scan_layers=False NotImplementedError.
- GRPO host-offload: move optimizer state to device before the in-place update.
Tests: train_nnx_test, grpo_nnx_test, maxengine_nnx_test, nnx_quant_guard_test.
0 commit comments