Skip to content
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

[Q] Initialize multiple runs and update them simultaneously #7378

Open
ksmdnl opened this issue Apr 15, 2024 · 4 comments
Open

[Q] Initialize multiple runs and update them simultaneously #7378

ksmdnl opened this issue Apr 15, 2024 · 4 comments
Labels
a:cli Area: Client c:core Component: Core ty:feature_request type of the issue is a feature request

Comments

@ksmdnl
Copy link

ksmdnl commented Apr 15, 2024

Thank you for the never ending support of the API!
I have a scenario where I have multiple forward passes in each step. I imagine initialising multiple wandb runs and update them independently. Is there a feature that might support this use case?
This is roughly what I would like to have:

wandb_run_1 = wandb.init(...)
wandb_run_2 = wandb.init(...)
runs = [wandb_run_1, wandb_run_2]
for _ in range(step_nums):
    for pass_idx in range(num_forward_pass):
        runs[pass_idx].log(...)

The closest I found is #1063, but this is not exactly the same scenario, since it runs each run one after the other.
I’ll appreciate any kind of hints!

@ksmdnl ksmdnl changed the title [Initialize multiple runs and update them simultaneously] Initialize multiple runs and update them simultaneously Apr 15, 2024
@ksmdnl ksmdnl changed the title Initialize multiple runs and update them simultaneously [Q] Initialize multiple runs and update them simultaneously Apr 15, 2024
@umakrishnaswamy
Copy link
Contributor

hey @ksmdnl - currently we don't support logging more than 1 run in the same process. this would have to be done sequentially. alternatively, perhaps you can utilize Python's multiprocessing library to spin up separate processes. Each process can handle its own W&B run, allowing you to independently log different forward passes or experiments. Please let me know if you have further questions or would like to discuss further!

@ksmdnl
Copy link
Author

ksmdnl commented Apr 16, 2024

Hi @umakrishnaswamy, thanks for the input!
If I understood it correctly, I would then need to initialize the API object in as many processes as the number of forward pass and log the corresponding data there. However, when each process finished, so as each corresponding run is also finished. Thus, each step the same thing should be started again. But I'm not sure if this will help because I'd like to keep each run (without initializing them again every step) and update them one step at a time. Is my understanding correct or do you imagine another use case/approach using multiprocessing?

To be clear, in my scenario it's only one experiment with multiple forward passes per step (which includes the optimization) and I would like to log the output of each pass.

@kptkin kptkin added a:cli Area: Client c:core Component: Core ty:feature_request type of the issue is a feature request labels Apr 17, 2024
@umakrishnaswamy
Copy link
Contributor

@ksmdnl - got it, unfortunately we do not support this right now since we can only update one run at a time, and you would have to terminate the other run in order to log to the new run. I'd be happy to make a feature request for this, and I'll update this thread if any progress arises on it.

@ksmdnl
Copy link
Author

ksmdnl commented Apr 26, 2024

@umakrishnaswamy yes, that would be very helpful. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:cli Area: Client c:core Component: Core ty:feature_request type of the issue is a feature request
Projects
None yet
Development

No branches or pull requests

3 participants