This PR removes the transformers forward-path machinery our trainer
models no longer use (`GenerationMixin`, `GradientCheckpointingLayer`,
KV-cache arguments, HF output types, `auto_docstring`) and replaces the
few live pieces with small local equivalents. Model structure, init and
numerics are unchanged.
- Inner models return `TextModelOutput` and vision encoders
`VisionModelOutput`, dataclasses in `models/base.py`.
- `convert_dcp_to_bf16` exports the source's `generation_config.json`,
where it used to derive one from `config.json` (or write none). vLLM now
serves an export with its source's sampling defaults and EOS list.
- `ForCausalLM.forward` drops the cache arguments and the unread
`**kwargs`, so stray arguments raise `TypeError`.
A temporary golden test captured on main (parameter structure, seeded
init, 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: ddd7c202e
- End-to-end harness, results and GPU noise study: a7fb6fbb4
🤖 Generated with [Claude Code](https://claude.com/claude-code)