Skip to content

Commit

Permalink
Fix labels for GCP TPU
Browse files Browse the repository at this point in the history
  • Loading branch information
Michaelvll committed Jun 11, 2024
1 parent 121ae2c commit 3b8b040
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions sky/clouds/gcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,9 @@ def make_deploy_resources_variables(
('gcp', 'managed_instance_group'), None)
use_mig = managed_instance_group_config is not None
resources_vars['gcp_use_managed_instance_group'] = use_mig
# Convert boolean to 0 or 1 in string, as GCP does not support boolean
# value in labels for TPU VM APIs.
resources_vars['gcp_use_managed_instance_group_value'] = str(int(use_mig))
if use_mig:
resources_vars.update(managed_instance_group_config)
return resources_vars
Expand Down
2 changes: 1 addition & 1 deletion sky/templates/gcp-ray.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ available_node_types:
{%- for label_key, label_value in labels.items() %}
{{ label_key }}: {{ label_value|tojson }}
{%- endfor %}
managed-instance-group: {{ gcp_use_managed_instance_group }}
managed-instance-group: {{ gcp_use_managed_instance_group_value|tojson }}
{%- if gcp_use_managed_instance_group %}
managed-instance-group:
run_duration: {{ run_duration }}
Expand Down

0 comments on commit 3b8b040

Please sign in to comment.