-
Notifications
You must be signed in to change notification settings - Fork 682
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
one_embedding amp default fp16 #8174
Conversation
View latest API docs preview at: https://staging.oneflow.info/docs/Oneflow-Inc/oneflow/pr/8174/ |
Speed stats:
|
View latest API docs preview at: https://staging.oneflow.info/docs/Oneflow-Inc/oneflow/pr/8174/ |
Speed stats:
|
View latest API docs preview at: https://staging.oneflow.info/docs/Oneflow-Inc/oneflow/pr/8174/ |
Speed stats:
|
CI failed when running job: cpu-module. PR label automerge has been removed |
CI failed when running job: cuda-benchmark. PR label automerge has been removed |
View latest API docs preview at: https://staging.oneflow.info/docs/Oneflow-Inc/oneflow/pr/8174/ |
将embedding_lookup_placeholder加入白名单,因此amp时variable输入shadow会插入cast_f2h,本op根据shadow的data_type推导输出data_type。 在amp时,前后向输入输出均为half类型
shadow的输入可能是variable或cast
在replace_embedding_ops pass中:
对于后向操作
如果ONEFLOW_ONE_EMBEDDING_GRADIENT_SHUFFLE_USE_FP16设为false,即gradient shuffle不使用fp16计算,则先插入cast h2f op
如果ONEFLOW_ONE_EMBEDDING_GRADIENT_SHUFFLE_USE_FP16为true,但是ONEFLOW_ONE_EMBEDDING_NOT_FUSE_CAST_TO_UPDATE,则在update op前插入cast h2f op