feat(megatron): add after-train-step hook#1682
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a new command-line argument --custom-megatron-after-train-step-hook-path and integrates a corresponding post-train-step hook into the Megatron training loop. It also adds unit tests to verify that the hook is correctly parsed and executed before logging. The review feedback highlights a critical issue where the hook is executed unconditionally, even when a training step is discarded. This could pass an empty loss dictionary to the hook and cause crashes, so it is recommended to only run the hook when the step outcome is normal.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
3658cfd to
54ae4cc
Compare
6bb2a2c to
20f7833
Compare
|
/gemini rereview |
|
I have completed the re-review of your pull request. The implementation of the |
Summary
Why
This gives training integrations a generic extension point for post-step diagnostics or metric enrichment without changing the core train loop for each use case.
Validation