Skip to content

Commit

Permalink
[WIP] fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelbenayoun committed May 13, 2024
1 parent c7a8a86 commit 107266b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion optimum/neuron/accelerate/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ def __init__(self, cpu: bool = False, **kwargs):
set_common_flags()
if os.environ.get("ACCELERATE_USE_AMP", "false") == "true":
set_neuron_cc_flags_for_torch_amp()
init_process_group()
if not torch.distributed.is_initialized():
init_process_group()
self.num_processes = xm.xrt_world_size()
self.process_index = xm.get_ordinal()
self.local_process_index = xm.get_local_ordinal()
Expand Down

0 comments on commit 107266b

Please sign in to comment.