Skip to content

[release/1.3] cherry-pick: finalize gradient & mHC composite metrics for internal medicine monitors (#4870)(#4871) - #4879

Merged
From00 merged 2 commits into
PaddlePaddle:release/1.3from
yuweivvv:cherry-pick/4870-4871
Aug 13, 2026
Merged

[release/1.3] cherry-pick: finalize gradient & mHC composite metrics for internal medicine monitors (#4870)(#4871)#4879
From00 merged 2 commits into
PaddlePaddle:release/1.3from
yuweivvv:cherry-pick/4870-4871

Conversation

@yuweivvv

@yuweivvv yuweivvv commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Merged in dev: #4870
Merged in dev: #4871

PR types

Bug fixes

PR changes

Others

Description

Cherry-pick #4870 and #4871 to release/1.3.

Both hooks early-return when self._setup_done is False, and use getattr(..., None) so monitors without these methods are unaffected.

Scope: paddleformers/trainer/trainer_callback.py only, +18 lines, no behavior change for users who don't enable the internal medicine monitors. Clean cherry-pick, no conflicts.

@risemeup1111 risemeup1111 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

序号 位置 优先级 状态
1 trainer_callback.py:1025 P1 🚧
2 trainer_callback.py:1034 P1 🚧
Powered by Nyanpasu with gpt-5.5 xhigh, please check the suggestions carefully.

return

for monitor in self._monitor_dict.values():
finalize = getattr(monitor, "finalize_composite_microbatch", None)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 当前锁定依赖的 PaddleFleet monitor 注册表没有 mhc_health,所以 _monitor_dict 不会包含实现 finalize_composite_microbatch 的 monitor,这个 hook 实际不会执行;梯度累积时的 mHC composite 快照仍可能被后续 micro-batch 覆盖。请同步包含该 monitor/方法的子模块版本,并增加精确依赖下 gradient_accumulation_steps>1 的回归测试。

return

for monitor in self._monitor_dict.values():
finalize = getattr(monitor, "finalize_scaled_grad_metrics", None)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 当前 release/1.3 锁定的 llm-internal-medicine 子模块并未提供 finalize_scaled_grad_metrics,因此这里的 capability 检测会静默跳过,h_res_logits 梯度指标不会被还原为 unscaled 值。请同步包含该方法的子模块版本(或在本仓库提供实现),并补充精确依赖下启用 AMP monitor 的回归测试,确认回调实际命中。

@From00 From00 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@From00
From00 merged commit a671709 into PaddlePaddle:release/1.3 Aug 13, 2026
28 of 32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants