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

fix tpu bug #2350

Merged
merged 3 commits into from
Aug 4, 2023
Merged
Changes from 2 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
11 changes: 10 additions & 1 deletion sky/backends/cloud_vm_ray_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -2248,7 +2248,7 @@ def _update_stable_ssh_ports(self, max_attempts: int = 1) -> None:
ports = [head_port] + worker_ports
else:
# Use port 22 for other clouds
ports = [22] * self.launched_nodes
ports = [22] * self.num_node_ips
self.stable_ssh_ports = ports

def _update_stable_cluster_ips(self, max_attempts: int = 1) -> None:
Expand Down Expand Up @@ -2350,6 +2350,15 @@ def head_ssh_port(self):
return external_ssh_ports[0]
return None

@property
def num_node_ips(self):
infwinston marked this conversation as resolved.
Show resolved Hide resolved
is_tpu_vm_pod = tpu_utils.is_tpu_vm_pod(self.launched_resources)
if is_tpu_vm_pod:
num_ips = tpu_utils.get_num_tpu_devices(self.launched_resources)
else:
num_ips = self.launched_nodes
return num_ips

def __setstate__(self, state):
self._version = self._VERSION

Expand Down
Loading