Add GLM5 SFT support - #1844
Open
samaritan1998 wants to merge 3 commits into
Open
Conversation
samaritan1998
commented
Apr 20, 2026
samaritan1998
left a comment
Author
There was a problem hiding this comment.
Local validation passed for GLM5 loss mask behavior and script syntax.
samaritan1998
marked this pull request as ready for review
April 20, 2026 04:52
Contributor
|
Hi samaritan1998, this might be a duplicate of #1824 |
Author
|
Contributor
|
ahh yes you're right, closed #1824 in favor of this PR |
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
<|user|>for normal replies and<|observation|>for final tool calls.sft_lossand the existing GLM5 Megatron model config.step_loss_maskhandling.Details
The GLM5 mask generation renders the full chat template, supervises assistant spans, and treats
<|user|>,<|observation|>, and<|endoftext|>as stop boundaries. This mirrors GLM5 chat-template behavior: regular assistant replies learn the<|user|>boundary, while assistant tool calls learn the<|observation|>boundary so the model stops before tool results are appended externally.Validation
/tmp/slime-precommit-venv/bin/pre-commit run --all-files --show-diff-on-failure --color=alwaystransformersstub, because this local environment does not havepytestortransformersinstalled.bash -n scripts/run-glm5-744B-A40B-sft.shgit diff --checkCould not run
python -m pytestdirectly becausepytestis not installed in this local environment.