-
Notifications
You must be signed in to change notification settings - Fork 393
[Enhance] enhance logging (mostly on token stats) #1333
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
nil0x9
wants to merge
2
commits into
InternLM:main
Choose a base branch
from
nil0x9:linty/dev-enhance-tok-logs
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里命名要注意保持和loss在代码中和日志中的一致。
比如 total_loss表示单卡上总loss(llm, balance, zloss), reduced_llm_loss表示各卡聚合后llm_loss。
所以建议 要么保留原来的 reduced_consumed_tokens命名,要么将 loss的命名也改成和这里一致。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里确实有歧义,在现在的 codebase 里,
total_被用来表示时间维度上的总和 (e.g.,total_[step|epoch|iter]),也有被用来表达空间上的总和(total_GPU_per_node),total_loss是表示几种 loss 的聚合, 显得有点混乱。感觉是应该有个好的 naming convention 来把这些统一的区分开。这里的
_reduced_consumed_tokens其实同时兼有 时间维度上的累积,和空间维度的聚合两个含义,所以感觉有点奇怪,我想一想要怎么改善这个 PR。There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
我现在把
total_loss修改为local_loss,同时还附带把原来extra_log_info里的一个叫loss的 key 重新命名(这个值对 pt/sft 而言是 reduce_sum 之前的 ce_loss,在 tensorboard 上很容易引发歧义).我理想来讲,step vs. 整个训练周期、单 rank vs. 所有 rank、 单个值 vs. 总和,都要有个前缀做区分,但是这样每个变量都会显得非常冗余,个人浅见只能退而求其次,做一些合理的省略(只要上下文是清晰的):
local_前缀表示;