-
Notifications
You must be signed in to change notification settings - Fork 124
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
multi device demo #258
multi device demo #258
Conversation
|
||
if __name__ == '__main__': | ||
if cmd_args.save: | ||
run_sd(cmd_args, "cuda: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.
cuda 0 compile and save
devices = ("cuda:0", "cuda:1") | ||
procs = [] | ||
for device in devices: | ||
p = mp.get_context("spawn").Process(target=run_sd, args=(cmd_args, device)) |
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.
cuda 0 and 1 load and run
state_dict = flow.load(file_path) | ||
if device is not None: | ||
state_dict = flow.nn.Graph.runtime_state_dict_to(state_dict, device) |
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.
change runtime_state_dict device
Support changing runtime_state_dict's device with
runtime_state_dict_to
Depends on PR in oneflow: Oneflow-Inc/oneflow#10335
Performance check
save
load
load from cuda 0 to cuda 1
load from cuda 0 to cuda 0 and cuda 1