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

style: fix pytype warnings #67

Merged
merged 5 commits into from
Jun 30, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions bagua/autotune/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,11 @@ def __init__(self, param_declaration: dict, n_initial_points: int = 10):
)

def tell(self, param_dict: dict, score: float) -> None:
param_v = [
float(param_dict[name])
for name, _ in self.param_declaration.items() # noqa: E501
]
try:
param_v = [
float(param_dict[name]) for name, _ in self.param_declaration.items()
]
self.bayesian_optimizer.tell(param_v, -score)
except ValueError as err:
logging.warning(
Expand Down Expand Up @@ -165,31 +166,31 @@ def _sysperf(env={}):
{
"NCCL_MIN_NCHANNELS": IntParam(
val=0, # 0 means no set
space_dimension=[
space_dimension=(
0,
12,
],
),
),
"NCCL_SOCKET_NTHREADS": IntParam(
val=0, # 0 means no set
space_dimension=[
space_dimension=(
0,
8,
],
),
),
"NCCL_NSOCKS_PERTHREAD": IntParam(
val=0, # 0 means no set
space_dimension=[
space_dimension=(
0,
8,
],
),
),
"nccl_buffsize_2p": IntParam(
val=0, # power of 2, 0 means no set
space_dimension=[
space_dimension=(
0,
26,
],
),
),
}
)
Expand Down
4 changes: 2 additions & 2 deletions bagua/service/autotune_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,10 @@ def __init__(
{
"bucket_size_2p": IntParam( # bucket_size = 2 ^ bucket_size_2p
val=13,
space_dimension=[ # 0 ~ 2GB
space_dimension=( # 0 ~ 2GB
10,
31,
],
),
),
"is_hierarchical_reduce": BoolParam(False),
},
Expand Down