Duplicate W&B initialization in offline mode
System Info
- `Accelerate` version: 1.10.1
Information
- [x] The official example scripts
- [x] My own modified scripts
Tasks
- [x] One of the scripts in the examples/ folder of Accelerate or an officially supported
no_trainerscript in theexamplesfolder of thetransformersrepo (such asrun_no_trainer_glue.py) - [ ] My own task or dataset (give details below)
Reproduction
When using Accelerate with wandb in offline mode, two separate W&B runs are created for a single training process.
This happens because both the start and the store_init_configuration method of WandBTracker call wandb.init(), which leads to redundant initialization.
https://github.com/huggingface/accelerate/blob/a12beee389f6bd37cfae0aba233db03f375f7f80/src/accelerate/tracking.py#L318-L325
https://github.com/huggingface/accelerate/blob/a12beee389f6bd37cfae0aba233db03f375f7f80/src/accelerate/tracking.py#L343-L350
Is there any plan to refine the duplication?
Expected behavior
initialize wandb run only 1 time
Indeed, this was changed due to this PR but we should probably revert it. Would you like to try fix the issue ? I think that for offline mode, it will be eaiser to just prompt the user to pass the config in init_kwargs
init_kwargs={"wandb": {"config": {"dropout": "abc"}}}
https://github.com/huggingface/accelerate/pull/3648
https://github.com/huggingface/accelerate/issues/3607
This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.
Please note that issues that do not follow the contributing guidelines are likely to be ignored.
Hi @SunMarc , I have added a PR for this issue, please review and suggest any changes if required.