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

[Catalog] Add trainium accelerator in aws catalog #2798

Merged
merged 4 commits into from
Nov 17, 2023
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion sky/authentication.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
in ray yaml config as input,
1. Replace the placeholders in the ray yaml file `skypilot:ssh_user` and
`skypilot:ssh_public_key_content` with the actual username and public key
content, i.e., `_replace_ssh_info_in_config`.
content, i.e., `configure_ssh_info`.
2. Setup the `authorized_keys` on the remote VM with the public key content,
by cloud-init or directly using cloud provider's API.

Expand Down
13 changes: 13 additions & 0 deletions sky/clouds/service_catalog/data_fetchers/fetch_aws.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import itertools
from multiprocessing import pool as mp_pool
import os
import re
import subprocess
import sys
import textwrap
Expand Down Expand Up @@ -287,6 +288,18 @@ def get_additional_columns(row) -> pd.Series:
if row['InstanceType'] == 'p4de.24xlarge':
acc_name = 'A100-80GB'
acc_count = 8
if row['InstanceType'].startswith('trn1'):
# Trainium instances does not have a field for information of
# the accelerators. We need to infer the accelerator info from
# the instance type name.
# aws ec2 describe-instance-types --region us-east-1
# https://aws.amazon.com/ec2/instance-types/trn1/
acc_name = 'Trainium'
find_num_in_name = re.search(r'(\d+)xlarge',
row['InstanceType'])
assert find_num_in_name is not None, row['InstanceType']
num_in_name = find_num_in_name.group(1)
acc_count = int(num_in_name) // 2
return pd.Series({
'AcceleratorName': acc_name,
'AcceleratorCount': acc_count,
Expand Down