github.com·2026/10/16·huggingface
TRL v1.16.0 增加 AWS Trainium 训练支持,官方在 Trainium2 上 20 步 SFT 测得 130 秒对 260 秒。AsyncGRPO 改用 prefix tree 打包共享前缀或嵌套分叉,Qwen3-1.7B 每 rollout 32K tokens 实测最高 3.10× 加速、峰值显存降至 13.5 GiB。新增 Muse Spark Open 816B 训练支持,在 8×H100 上 LoRA SFT 为 14.2 秒/步。工具调用参数按 JSON schema 类型化,AMD GPU 进入异步训练器。移除 SSD trainer 与 RewardTrainer 的 nn.DataParallel,提高 accelerate 版本下限,不再支持旧版 vLLM。修复 torch.compile 在 torch<2.11 下 Triton loss 静默错误、FSDP2 vLLM 权重同步及 VLM 占位符生成,并将 CI 从 mock 改为真实 trainer 对象、扩展跨设备测试。
pad_to_multiple_of 默认 128,GPU 不变为什么重要 Trainium 与 AMD 适配降低专用加速器门槛;树注意力减少共享前缀重复计算,长 rollout 训练提速明显,但依赖收紧与移除项需评估迁移。适合 用 TRL 做 GRPO/SFT 训练、关注 Trainium/AMD 或大模型 LoRA 的工程师
pad_to_multiple_of='auto'嵌套 fork 3.56
峰值显存 13.5 GiB
共享 prompt 3.37
峰值显存 13.6 GiB
共享 prompt 2.29
峰值显存 18.0 GiB
无共享 1.00
峰值显存 35.2 GiB
注释 · Qwen3-1.7B,32K tokens/rollout,前向+反向,与序列打包对比出自 §Features·Tree attention
注释 · 同一 32K tokens rollout,Qwen3-1.7B 前向+反向出自 §Features·Tree attention
v1.15 中的 fused LM head 使 Neuron 变得易处理;剩余的缺口在此处被关闭。随附一份指南。
Neuron 会为每种输入形状重新编译一次,因此未 padding 的运行在每遇到新的序列长度时会停滞约一分钟。pad_to_multiple_of 现在默认为 "auto":在 Neuron 上为 128,在其他环境中为 None,因此 GPU 上没有任何变化。Trainium2、Qwen3-0.6B SFT、20 steps:默认设置下 130 s,而没有该设置时 260 s。
pad_to_multiple_of 默认为 "auto" by @qgallouedec in https://github.com/huggingface/trl/pull/7724trl env 和遥测中报告 Neuron 设备 by @qgallouedec in https://github.com/huggingface/trl/pull/7672AsyncGRPO 现在将每个 micro-batch 行打包为 prefix tree,而不是扁平序列。多轮和多生成 rollout 会重复大量前缀:在共享 prompt 上,这些 token 以前每行都要前向一次。Tree packing 前向。
The fused LM head from v1.15 is what made Neuron tractable; the remaining gaps are closed here. There is a guide to go with it.
Neuron recompiles once per input shape, so an unpadded run stalls about a minute on every new sequence length. pad_to_multiple_of now defaults to "auto": 128 on Neuron, None elsewhere, so nothing changes on GPU. Trainium2, Qwen3-0.6B SFT, 20 steps: 130 s with the default against 260 s without.
pad_to_multiple_of to "auto" by @qgallouedec in https://github.com/huggingface/trl/pull/7724trl env and telemetry by @qgallouedec in https://github.com/huggingface/trl/pull/7672AsyncGRPO now packs every micro-batch row as a prefix tree instead of a flat sequence. Multi-turn and multi-generation rollouts repeat a lot of prefix: on a shared prompt, those tokens used to be forwarded once per row. Tree packing forwards them once.
rollout 0: [ prompt ] [ completion A ] prompt ──┬── completion A ─…
EVIDENCE / METHODS
参数清单
Trainium2 20 步 130s;Muse 64×H100 每步 14.2s
注释 · 术语解释AWS Trainium 的编译与执行栈,按输入 shape 重编译 默认填充 128;Muse 使用 8 节点 8×H100出自 §Features·AWS Trainium / Mus