Remove CUDA-only restriction for multi-tensor model updates in optimizer#10564
Open
Remove CUDA-only restriction for multi-tensor model updates in optimizer#10564
Conversation
fpzh2011
approved these changes
Nov 14, 2024
Contributor
|
View latest API docs preview at: https://oneflow-staging.oss-cn-beijing.aliyuncs.com/docs/Oneflow-Inc/oneflow/pr/10564/ |
Contributor
Speed stats: |
| warnings.warn("Fused Adamw is not supported when amsgrad=True.") | ||
| param_group["fused"] = False | ||
|
|
||
| if param_group["fused"] and not param.is_cuda: |
Contributor
There was a problem hiding this comment.
这个去掉,是不是cpu device会有影响,是否需要用param.is_cpu判断一下?
Flowingsun007
approved these changes
Nov 15, 2024
Contributor
|
CI failed when running job: cuda-module. PR label automerge has been removed |
Contributor
|
CI failed when running job: cuda-misc. PR label automerge has been removed |
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.
This PR removes the CUDA-only restriction in the multi-tensor model update pass within both multi_tensor_model_update.cpp and adamw.py.
By commenting out the device type checks, we allow multi-tensor and fused updates to run on non-CUDA devices as well.