Repository navigation
feat(qwen38): add full-length 32K MoK MXFP8 Muon SFT - #813
Conversation
Initialize native MoK MXFP8 weights through Bridge and route mixed QSA through the DoSA boundary selector. Enable grouped FlashQLA on Blackwell and keep the standard BF16 vocabulary projection.
Megatron normalizes the distributed optimizer flag for Muon before the model is constructed. Validate that normalized mode for native MXFP8 weights and cover the startup failure with a regression test.
|
Thanks for contributing to Relax, @Lemon-412! 感谢你为 Relax 做出贡献! 📚 Contribution guide / 贡献指南Describe the problem, your changes, and how you validated them. Keep each PR focused and run 请说明问题、改动和验证方式,保持 PR 聚焦,并在提交前运行 🛠️ CI commands / CI 指令
Put one command on the first line of a new PR comment. Rerun/cancel require PR authorship or repository write access. 在新 PR 评论的首行写一条指令。PR 作者或有仓库写权限的贡献者可以重跑、取消 CI。 🔎 Merge requirements / 合入条件GitHub:✅ 满足合入条件
|
Nyanpasu 审查看板审查状态: ✅ 已通过 审查版本: 8e5b76e 目标分支: main F16 已解决。新版测试从 CP1 生产入口覆盖回退分块上限,H20 单卡 CI 通过。
审查发现待处理
已解决或已取代
改进建议(非阻塞)相关 PR💡 实现与合入建议#815 可复用本 PR 的 MoK 精度校验和 Ray 库路径保留方式。两个训练配方可独立合入。 https://github.com/redai-studio/Relax/pull/815 · 实现取舍: 构造前传递 MoK 权重配置,并在通用精度校验后仅为 MoK、MXFP8、Muon 和 layer-wise 优化器组合跳过重复的模块配置。运行时动态库路径优先读取 ray-job.sh 已补齐的值。 当前 PR 调整: 本 PR 保留现有的精度校验与路径合并。#815 可复用这两处逻辑,并根据长上下文配置保留各自的 CP 对齐、MoK 容量及 DoSA 参数。 合入顺序: 两个配方可按各自准备情况合入。后合入的一方应整合同一 model_provider.py 中的 MoK 初始化分支,保留精度冲突检查。 依据与验证范围: 对照固定版本的源码与讨论 https://github.com/redai-studio/Relax/pull/815#discussion_r4715523649 和 https://github.com/redai-studio/Relax/pull/815#discussion_r4715523017 。本 PR 的库路径合并经脚本 dry-run 核对。跨配方合并后的 GPU 行为仍待验证。
Powered by Nyanpasu with gpt-6.2-sol high, please check the suggestions carefully.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Wait for Ray's terminal status by default, honor the Jobs address, keep the launcher library paths for the driver and actors, and save to the resume directory. The MoK path has no HybridEP installation dependency. Let FLA select the grouped GDN backend. For two Q/K heads and six V heads the indices are [0, 0, 0, 1, 1, 1], matching repeat_interleave. With normalization enabled the FlashQLA wrapper applies l2norm_fwd before grouped GDN. Keep the Qwen3.5 preprocessing contract intact. 20-step comparison on 7c20557 used identical logical packing, model, seed, data and LR. Max absolute loss delta was 0.01440. Steps 3–19 averaged 5463.25 vs 5568.06 tokens/s/GPU. This measurement predates the FLA dispatch change.
| + and self.config.linear_cp_mode == "headwise" | ||
| + and not self.gdn_pre_gated_delta_rule_fusion | ||
| + and not self.config.deterministic_mode | ||
| + and not getattr(self.config, "_relax_qwen35_optimized", False) |
There was a problem hiding this comment.
Blackwell 段应用前,镜像已应用 common 段。该段为 TransformerConfig 声明了 _relax_qwen35_optimized: bool = False,这里可直接读取该字段,沿用同一处默认值。字段声明 · 镜像应用顺序
| + and not getattr(self.config, "_relax_qwen35_optimized", False) | |
| + and not self.config._relax_qwen35_optimized |
There was a problem hiding this comment.
已核对 c2b405fb,这里已改为直接读取字段。将镜像的 common、cu13 和 Blackwell 段依次应用于固定版 Megatron 后,TransformerConfig 的默认值和 GDN 调用处均通过语法检查。
NINGBENZHE
left a comment
There was a problem hiding this comment.
在 e1ea8b4c 上补两条非阻塞建议,分别涉及 recipe 的环境变量和 DoSA 回退的临时显存开销。
NINGBENZHE
left a comment
There was a problem hiding this comment.
已复查 8e5b76ec。严格环境校验与 CP1 DoSA 回退分块两项均已修复,并确认相关 CPU 和 H20 CI 用例通过。


feat(qwen38): add full-length 32K MoK MXFP8 Muon SFT
为 Qwen38 Flash Next 新增 32 卡满长 32K 文本 SFT recipe,使用 Muon 和 MoK MXFP8 路由专家。满长 32K 的 QSA 由 DoSA boundary 选块、CuTe 执行稀疏 attention,GDN 使用 grouped FlashQLA。
Add a 32-GPU recipe for full-length 32K text SFT on Qwen38 Flash Next with Muon and MoK MXFP8 routed experts. For full-length documents, QSA uses DoSA boundary selection and CuTe sparse attention. GDN uses grouped FlashQLA.
What
Why
Qwen38 Flash Next 在满长 32K 文本 SFT 中需要同时使用分布式 Muon、MoK MXFP8 和参数收集重叠。主干的 FP8 精度检查会拒绝这一组合,mixed QSA 入口也无法选择已有的 DoSA 实现。长序列 GDN 在调用 gated delta rule kernel 前还会显式复制 Q/K heads。这个 PR 补齐三处接入,并提供一个可直接启动的 32 卡 recipe。
How
Testing
c2b405fb在 32 卡上完成 20 个满长 32K 更新。与上一版7c20557a使用相同的模型权重、输入、逻辑 packing、种子和学习率计划。每步 4,194,304 tokens,20 步共 83,886,080 tokens。逐步 loss、梯度范数和 4 组学习率全部一致。目标设备日志确认 FLA 将 GDN 分发给 FlashQLA。Ray 作业最终状态为SUCCEEDED。最后一个更新的 checkpoint 已落盘,包含 32 个分片与分布式元数据,latest 指针为 19。本轮未执行断点续训。7c20557ac2b405fb整步吞吐按该窗口的总输入 tokens 除以总耗时及 32 张卡。此次实测较上一版高 1.31%。此前独立实验在相同窗口为 5568.06 tokens/s/卡。
git apply --check并成功应用。RAY_JOBS_ADDRESS。启动脚本默认等待终态,driver 和训练 actor 均收到入口补齐的动态库路径。Type of Change