Skip to content

Commit

Permalink
Fix-hostname (#642)
Browse files Browse the repository at this point in the history
This PR addresses an inconstent internal host name representation in the
Dragon backend.

[ committed by @al-rigazzi ]
[ reviewed by @ankona ]
  • Loading branch information
al-rigazzi authored Jul 18, 2024
1 parent 723544e commit d7d979e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
1 change: 1 addition & 0 deletions doc/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ To be released at some future point in time

Description

- Fix internal host name representation for Dragon backend
- Make dependencies more discoverable in setup.py
- Add hardware pinning capability when using dragon
- Pin NumPy version to 1.x
Expand Down
14 changes: 9 additions & 5 deletions smartsim/_core/launcher/dragon/dragonBackend.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,10 +210,10 @@ def group_infos(self) -> dict[str, ProcessGroupInfo]:

def _initialize_hosts(self) -> None:
with self._queue_lock:
self._hosts: t.List[str] = sorted(
node for node in dragon_machine.System().nodes
)
self._nodes = [dragon_machine.Node(node) for node in self._hosts]
self._nodes = [
dragon_machine.Node(node) for node in dragon_machine.System().nodes
]
self._hosts: t.List[str] = sorted(node.hostname for node in self._nodes)
self._cpus = [node.num_cpus for node in self._nodes]
self._gpus = [node.num_gpus for node in self._nodes]

Expand Down Expand Up @@ -452,7 +452,11 @@ def create_run_policy(
if run_request.policy.gpu_affinity:
affinity = dragon_policy.Policy.Affinity.SPECIFIC
gpu_affinity = run_request.policy.gpu_affinity

logger.debug(
f"Affinity strategy: {affinity}, "
f"CPU affinity mask: {cpu_affinity}, "
f"GPU affinity mask: {gpu_affinity}"
)
if affinity != dragon_policy.Policy.Affinity.DEFAULT:
return dragon_policy.Policy(
placement=dragon_policy.Policy.Placement.HOST_NAME,
Expand Down

0 comments on commit d7d979e

Please sign in to comment.