Skip to content

Commit

Permalink
update main attr lookup
Browse files Browse the repository at this point in the history
  • Loading branch information
pierre.delaunay committed Aug 6, 2024
1 parent 917196d commit f711c49
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 4 additions & 4 deletions milabench/remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ def milabench_remote_sync(pack, worker):

def should_run_for(worker, setup_for):
if setup_for == "worker":
return not worker["main"]
return not worker.get("main", False)

return worker["main"]
return worker.get("main", False)


def worker_commands(pack, worker_plan, setup_for="worker"):
Expand Down Expand Up @@ -178,7 +178,7 @@ def is_multinode(pack):
count = 0
nodes = pack.config["system"]["nodes"]
for node in nodes:
if not node["main"]:
if not node.get("main", False):
count += 1
return count > 0

Expand All @@ -191,7 +191,7 @@ def is_remote(pack):
def is_main_local(pack):
"""Only the local main can send remote commands to remote"""
self = pack.config["system"]["self"]
return self is not None and self["local"] and self["main"]
return self is not None and self["local"] and self.get("main", False)


def is_worker(pack):
Expand Down
2 changes: 2 additions & 0 deletions scripts/article/run_cuda_dev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ if [ "$MILABENCH_PREPARE" -eq 0 ]; then
cd $MILABENCH_WORDIR


milabench prepare --system $MILABENCH_WORDIR/system.yaml "$@"

# milabench prepare "$@"
#
# Run the benchmakrs
Expand Down

0 comments on commit f711c49

Please sign in to comment.