Skip to content

Commit

Permalink
refactor: remove horovod compat modes (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
NOBLES5E authored Jun 11, 2021
1 parent fb28417 commit af7c843
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 178 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ dbg.h
/public/index.js
/bagua/.data/
/_build/
/venv/
11 changes: 0 additions & 11 deletions bagua/torch_api/distributed.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
get_world_size,
get_local_size,
get_autotune_level,
_horovod_0_21_1_compat_mode,
_horovod_0_21_3_compat_mode,
)
from .utils import (
to_bagua_datatype,
Expand Down Expand Up @@ -568,15 +566,6 @@ def switch_to(

# sync params at the start of each training stage
if self.stage == 0:
if _horovod_0_21_1_compat_mode():
from .horovod_pack import initialize_optimizer_state_0_21_1

initialize_optimizer_state_0_21_1(self.optimizers[0])
elif _horovod_0_21_3_compat_mode():
from .horovod_pack import initialize_optimizer_state_0_21_3

initialize_optimizer_state_0_21_3(self.optimizers[0])

broadcast_parameters(self.bagua_module)
else:
allreduce_parameters(self.bagua_module)
Expand Down
6 changes: 0 additions & 6 deletions bagua/torch_api/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,3 @@ def get_autotune_level():
return int(os.environ.get("BAGUA_AUTOTUNE", 0))


def _horovod_0_21_1_compat_mode():
return int(os.environ.get("BAGUA_HOROVOD_0_21_1_COMPAT_MODE", 0)) == 1


def _horovod_0_21_3_compat_mode():
return int(os.environ.get("BAGUA_HOROVOD_0_21_3_COMPAT_MODE", 0)) == 1
160 changes: 0 additions & 160 deletions bagua/torch_api/horovod_pack.py

This file was deleted.

1 change: 0 additions & 1 deletion conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
"*/bagua/torch_api/compression.py",
"*/bagua/torch_api/distributed_define.py",
"*/bagua/torch_api/exceptions.py",
"*/bagua/torch_api/horovod_pack.py",
"*/bagua/torch_api/utils.py",
]

Expand Down

0 comments on commit af7c843

Please sign in to comment.