[TIPC-Benchmark]Support @to_static traing for Benchmark #1756
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.
What's New?
此 PR 基于新Benchmark规范实现了 @to_static 动转静训练监控机制,在现有的功能上,为兼容性升级。
1. 使用方式
在动态图训练的基础上,开启动转静训练的方法如下:
to_static
(不能拼写错误,大小写敏感)2. 验证日志
此 PR 基于 RestNet和MobileNet 模型进行了单机单卡、多卡验证。
可以根据日志中的
Successfully to apply @to_static with specs XX
来判断动转静是否生效,日志如下:3. 方案介绍
现有的 Benchmark 方案是通过执行
bash test_train_inference_python.sh
脚本实现的。通过解析
test_tipc/config/test_xxx.txt
中trainer:norm_train
(第15行)来分发训练配置。此处我们扩展了第20行的配置,新增了动转静trainer:to_static_train:-o Global.to_static=True
此处会复用
trainer:norm_train
的配置,在其后追加-o Global.to_static=True
来实现开启动转静训练,以保证动转静训练和动态图训练的基本配置参数是对齐的。