-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
[Eager] print gpu mem info #42616
[Eager] print gpu mem info #42616
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
if (FLAGS_enable_gpu_memory_usage_log) { | ||
std::cout << "[Memory Usage (Byte)] gpu " << dev_id_ << " : " | ||
<< MEMORY_STAT_PEAK_VALUE(Reserved, dev_id_) << std::endl; | ||
std::cout << "[Memory Usage (MB)] gpu " << dev_id_ << " : Reserved = " |
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.
对于一些显存小的,用MB为单位的话可能会出现大量的0
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.
我又加了一个FLAGS_enable_gpu_memory_usage_log_mb开关。默认打印MB,FLAGS_enable_gpu_memory_usage_log_mb=false时,打印Byte
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.
LGTM
PR types
Others
PR changes
Others
Describe
修改CI显存监控逻辑,即使在非TESTING下,也编译该逻辑,使用FLAGS_enable_gpu_memory_usage_log控制开关。
在程序结束时打印模型显存实际使用峰值和模型申请显存峰值,单位MB,格式如下:
其中Allocated为模型显存实际使用峰值。Reserved为模型向显卡申请显存峰值。