This PR rebases `PreTrainedModelPrimeRL` on `nn.Module` and replaces the
HF auto class with a registry function, so no trainer model class
depends on transformers. The base reproduces what HF's `PreTrainedModel`
did for our models, so behaviour is unchanged.
- `post_init`, `tie_weights`, `from_config` and `initialize_weights`
follow HF's order, dtype scope and traversal.
- `custom_causal_lm_from_config` replaces `AutoModelForCausalLMPrimeRL`
and keeps its `Qwen3_5Config` text-config substitution.
- The FA3 default now reaches vision sub-configs built without an
attention setting, which used to crash.
- `test_moe_custom_impl` uses a seeded scratch init: main's load left
every MoE weight of `PrimeIntellect/GLM-0.5B` random.
The golden test captured on main (parameter structure, seeded init on
meta and on CPU in fp32 and bf16, weight conversion and a GPU forward
and backward for every model) passes on the implementation commit.
End-to-end SFT and RL runs on dense, MoE and VLM models, run before the
latest rebase, match main bit for bit where main repeats itself and stay
within main's run-to-run spread elsewhere. Weights received by vLLM,
exported weights and compile events are identical to main.
Test commits:
- Goldens captured on main: 195d128ad
- Goldens passing on the implementation: b9b43cb43
- End-to-end harness, results and GPU noise study: a7fb6fbb4
🤖 Generated with [Claude Code](https://claude.com/claude-code)