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

[Performance] Use new AWS custom images #4091

Merged
merged 1 commit into from
Oct 17, 2024
Merged
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
19 changes: 15 additions & 4 deletions sky/clouds/aws.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@

logger = sky_logging.init_logger(__name__)

# Image ID tags
_DEFAULT_CPU_IMAGE_ID = 'skypilot:custom-cpu-ubuntu'
# For GPU-related package version,
# see sky/clouds/service_catalog/images/provisioners/cuda.sh
_DEFAULT_GPU_IMAGE_ID = 'skypilot:custom-gpu-ubuntu'
_DEFAULT_GPU_K80_IMAGE_ID = 'skypilot:k80-ubuntu-2004'
_DEFAULT_NEURON_IMAGE_ID = 'skypilot:neuron-ubuntu-2204'

# This local file (under ~/.aws/) will be uploaded to remote nodes (any
# cloud), if all of the following conditions hold:
# - the current user identity is not using AWS SSO
Expand Down Expand Up @@ -217,17 +225,20 @@ def zones_provision_loop(
@classmethod
def _get_default_ami(cls, region_name: str, instance_type: str) -> str:
acc = cls.get_accelerators_from_instance_type(instance_type)
image_id = service_catalog.get_image_id_from_tag(
'skypilot:gpu-ubuntu-2004', region_name, clouds='aws')
image_id = service_catalog.get_image_id_from_tag(_DEFAULT_CPU_IMAGE_ID,
region_name,
clouds='aws')
if acc is not None:
image_id = service_catalog.get_image_id_from_tag(
_DEFAULT_GPU_IMAGE_ID, region_name, clouds='aws')
assert len(acc) == 1, acc
acc_name = list(acc.keys())[0]
if acc_name == 'K80':
image_id = service_catalog.get_image_id_from_tag(
'skypilot:k80-ubuntu-2004', region_name, clouds='aws')
_DEFAULT_GPU_K80_IMAGE_ID, region_name, clouds='aws')
if acc_name in ['Trainium', 'Inferentia']:
image_id = service_catalog.get_image_id_from_tag(
'skypilot:neuron-ubuntu-2204', region_name, clouds='aws')
_DEFAULT_NEURON_IMAGE_ID, region_name, clouds='aws')
if image_id is not None:
return image_id
# Raise ResourcesUnavailableError to make sure the failover in
Expand Down
Loading