Open
[test] 跟踪 0.4.0 迁移后独立处理的 smoke fixture/API 修复 #238
hanboyouAdd on  6 days ago
hanboyou
hanboyouCollaborators
6 days ago Create

迁移 PR !1433 当前提交 9e4b2d1e 中与本 issue 关联的临时跳过共 27 个用例实例。以下清单按测试函数列出,多参数用例列出 pytest 参数 ID。升级总跟踪见 #207。

A3 smoke(9 个实例,7 个函数)

tests/smoke_tests/anticipatory_routing/test_anticipatory_routing_smoke.py(1 个实例)

  • test_loss_spike_rollback_and_route_replay

tests/smoke_tests/sdc/test_sdc_smoke.py(8 个实例)

  • test_compiled_controls_are_typed_without_installing_the_eager_wrapper([gradient]、[gradient-checksum-hccl])
  • test_invalid_compiled_sdc_business_config_is_rejected
  • test_compiled_gradient_checks_real_bf16_gradients
  • test_compiled_hccl_covers_forward_and_backward_collectives
  • test_three_gradient_strikes_activate_checksum_without_recompiling([bf16]、[fp32])
  • test_fp32_checksum_preserves_compiled_results_and_detects_output_faults

Anticipatory routing smoke 要适配 0.4.0 的 TrainingEngine、TrainingMicrobatch 和 checkpoint fixture。SDC smoke 要使用原生 compile.model 配置,更新错误断言及 FP32 checksum 输出解析。test_compiled_consumer_observes_checksum_output_mutation 仍运行。历史共享库映射错误应单独复验环境。

Anticipatory routing CPU 单测(18 个实例,10 个函数)

tests/unit_tests/extensions/experiment/anticipatory_routing/test_anticipatory_routing.py(18 个实例)

  • test_forward_only_preserves_batch_and_forwards_model_metadata
  • test_rollback_restores_training_state_and_restarts_iterator
  • test_spike_recovery_warmup_active_drain_and_normal
  • test_replay_failure_cleans_state_and_blocks_checkpoint
  • test_recording_failure_resets_routing_before_next_forward([initialization]、[capture]、[snapshot])
  • test_compiled_routes_share_graphs_across_layers_modes_and_microbatches([False-all-compiled]、[False-mixed-eager-compiled]、[True-all-compiled]、[True-mixed-eager-compiled])
  • test_capture_compile_failure_preserves_upstream_entry_and_state
  • test_compiled_capture_preserves_hooks_and_rng
  • test_compiled_spike_recovery_runs_capture_and_replay_without_recompiling
  • test_compiled_capture_keeps_disabled_hooks_outside_graph([False-False]、[False-True]、[True-False]、[True-True])

原单测文件可正常收集 31 项。18 项在执行时访问旧 microbatch token-count 字段或缺少 global_routing_token_counts 参数。其他 13 项继续运行,routing 目录定向验证为 28 passed、18 skipped。后续补齐 0.4.0 fixture 和调用接口,并恢复 step 范围 token counts、DP 归约和 capture/replay 的断言。

复验和恢复

  • Smoke 的临时跳过定义在 tests/smoke_tests/conftest.py。在 A3 环境用 --run-deferred-smoke 复验。通过后移除对应 _DEFERRED_SMOKE_TESTS 条目并重跑默认 smoke。
  • CPU 单测的临时跳过定义在 tests/unit_tests/conftest.py。修复后移除对应 _DEFERRED_ROUTING_TESTS 条目,重跑整个 routing 单测目录。
  • Triton-Ascend 版本门禁单独跟踪,见 #221、!1321 和 上游 #1411。mHC 公共 fixture 的整理可以独立 review。
python3.12 -m pytest -q -rs --run-deferred-smoke \
  tests/smoke_tests/anticipatory_routing/test_anticipatory_routing_smoke.py \
  tests/smoke_tests/sdc/test_sdc_smoke.py

TORCH_DEVICE_BACKEND_AUTOLOAD=0 python3.12 -m pytest -q -rs \
  tests/unit_tests/extensions/experiment/anticipatory_routing
likedislike
hanboyouhanboyouCollaborators
6 days ago Modify description of issue
hanboyouhanboyouCollaborators
6 days ago Modify description of issue
hanboyouhanboyouCollaborators
5 days ago Assign hitwdy as responsible person
hanboyou
hanboyouCollaborators
5 days ago Comments:

@hitwdy 本 issue 从迁移 PR !1433 拆出,用于跟踪 0.4.0 迁移后独立处理的 smoke fixture/API 修复,作为 #207 升级跟踪的配套事项,指派给你跟进。

待处理要点回顾:

  • Anticipatory routing smoke 的旧 Trainer、batch 和 checkpoint fixture 需适配 TrainingEngine / TrainingMicrobatch 接口;
  • SDC smoke 需要原生 compile.model 配置、对应错误断言及稳健的 FP32 checksum 输出解析;
  • 公共 NPU fixture 和 mHC 测试辅助函数的作用域整理独立处理。

验收口径(见正文):逐项在真实 NPU 环境用 --run-deferred-smoke 复验并记录通过/跳过/环境失败结果后,移除对应临时 skip,不复用 OpenCANN run 43 的历史结果。

处理计划建议:迁移 PR 合入后按上述三项拆独立修复 PR 逐项推进;anticipatory routing 的 fixture 语义可请 @MissingPompeii 协助确认,SDC 的 compile.model 配置可请 @zhenyu10 协助确认。请确认或修正以上评估,并给出你的处理计划、下一步和预计更新时间。

likedislike
hanboyouhanboyouCollaborators
5 days ago Modify description of issue
hanboyouhanboyouCollaborators
5 days ago Modify description of issue
hanboyouhanboyouCollaborators
5 days ago Modify description of issue
hanboyouhanboyouCollaborators
5 days ago Assign mystri as responsible person
hanboyou
hanboyouCollaborators
3 days ago Comments:

/assign zhangguoguang

likedislike
hanboyou
hanboyouCollaborators
3 days ago Comments:

@zhangguoguang 收到 PR #1467(适配本 issue 第 1 项 anticipatory routing smoke 在 0.4.0 迁移后的 Trainer/batch/checkpoint fixture 接口,并移除对应 CPU 与 smoke 用例的临时跳过),与 12-01 的拆分计划一致,感谢推进。

两点说明:

  1. 今天 16:18 的 /assign zhangguoguang 指派未生效(机器人未处理,API 侧修改本 issue 负责人返回 403 受限)。麻烦你在看板上自行接受/确认指派,或由有权限的维护者将你加入负责人列表;hitwdy 仍为整体负责人。
  2. 按拆分计划,本 issue 剩余两项仍待处理:SDC smoke 的原生 compile.model 配置与对应错误断言(此前已建议请 zhenyu10 协助确认)、公共 NPU fixture 与 mHC 测试辅助函数的作用域整理。#1467 合入后,请在本 issue 同步第 1 项的复验结果(--run-deferred-smoke 逐项记录通过/跳过/环境失败)。

请确认指派与后续安排,并给出剩余两项的处理计划、下一步和预计更新时间。

likedislike
zhangguoguang
zhangguoguang
2 days ago Comments:

Anticipatory routing 部分已完成 TorchTitan 0.4.0 的测试适配,相关修改见 PR1467

本次修改更新了 CPU 单测和 NPU smoke test 中的 Microbatch、token count、数据预处理及训练引擎接口,移除了对应的临时跳过逻辑,并补充了录制与重放过程中 routing token count 传递一致性的回归用例。

在 TorchTitan 0.4.0 环境中验证结果如下:

  • CPU 单测:49 passed,无跳过用例。
  • 单卡 NPU smoke test:1 passed,覆盖异常 loss 触发检测、checkpoint 回滚、WARMUP → ACTIVE → DRAIN → NORMAL,以及录制与重放时 microbatch 数据和专家 ID 的一致性。
  • DeepSeek V4 真实训练入口集成测试:通过。在第 6 步注入一次 loss 扰动,由检测器识别异常并回滚到第 4 步 checkpoint,随后完成路由录制、重放与排空,恢复正常训练并运行至第 10 步。
likedislike
jiangna1111jiangna1111Collaborators
2 days ago Associated pull request
jiangna1111
jiangna1111Collaborators
2 days ago Comments:

@mystri 第 2 项(SDC smoke 的 0.4.0 适配)已提独立修复 PR #1482:

  • tests/smoke_tests/sdc/test_sdc_smoke.py 改用原生 compile.model 配置,更新错误断言,并加固 FP32 checksum 分支输出解析;
  • 移除 tests/smoke_tests/conftest.py 中对应 6 个函数(8 个实例)的临时跳过,同步清理两篇 sdc.md 中的旧配置示例。

本地 910B4(CANN 9.2.2 + torch 2.15 + torchtitan 0.4.0)移除临时 skip 后默认运行 tests/smoke_tests/sdc/test_sdc_smoke.py,12 passed / 0 skipped(FP32 分支 V-ABFT),CPU 单测 35 passed。

likedislike
hanboyou
hanboyouCollaborators
2 days ago Comments:

@jiangna1111 收到 PR #1482(适配本 issue 第 2 项:SDC smoke 改用 0.4.0 原生 compile.model 配置、更新错误断言、加固 FP32 checksum 输出解析,并同步清理两篇 sdc.md 旧配置示例),与 12-01 的拆分计划一致,感谢推进。本地 910B4(CANN 9.2.2 + torch 2.15 + torchtitan 0.4.0)12 passed / 0 skipped、CPU 单测 35 passed 的验证结果已记录。

后续安排:

  1. PR #1482 门禁当前运行中,请以跑绿为准;如命中与本改动无关的存量基线问题,参照 #1461 / #1462 的处理方式在 PR 中说明并复跑。
  2. 门禁跑绿后进入人工检视:SDC compile.model 配置口径此前已按 12-01 计划建议请 @zhenyu10 协助确认,届时请在检视中重点核对 CompileConfig(model=ModelCompileConfig(backend="inductor")) 与 0.4.0 原生校验语义的一致性;测试与文档清理部分随检视一并复核。
  3. 按本 issue 的验收口径,#1482 合入后请在 issue 同步第 2 项的复验结果(--run-deferred-smoke 逐项记录通过 / 跳过 / 环境失败)。
  4. 第 3 项(公共 NPU fixture 与 mHC 测试辅助函数的作用域整理)仍待处理;对 zhangguoguang 的处理计划请求(12-03 送达)继续等待回复。

说明:本 issue 整体负责人为 hitwdy;第 1 项已由 PR #1467 完成,第 2 项由你以 PR #1482 推进。API 侧追加指派受限(此前 403),你的实现负责人身份先在本评论记录,如需正式指派可在看板侧确认。

likedislike