Skip to content

Commit 3b8133c

Browse files
committed
[FluidStack] Add Nvlink Accelerator Mappings
* Add A100-80GB and H100 Nvlink accelerator mappings * Remove custom/configurable plans
1 parent 99408b3 commit 3b8133c

File tree

2 files changed

+4
-50
lines changed

2 files changed

+4
-50
lines changed

sky/clouds/service_catalog/data_fetchers/fetch_fluidstack.py

+3-38
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
python fetch_fluidstack_cloud.py
55
"""
66

7-
import copy
87
import csv
98
import json
109
import os
@@ -19,6 +18,8 @@
1918

2019
GPU_MAP = {
2120
'H100_PCIE_80GB': 'H100',
21+
'H100_NVLINK_80GB': 'H100',
22+
'A100_NVLINK_80GB': 'A100-80GB',
2223
'A100_SXM4_80GB': 'A100-80GB',
2324
'A100_PCIE_80GB': 'A100-80GB',
2425
'A100_SXM4_40GB': 'A100',
@@ -40,13 +41,6 @@
4041
'RTX_3080_10GB': 'RTX3080',
4142
}
4243

43-
CUSTOM_PLANS_CONFIG = [
44-
dict(gpu_count=1, cpu_count=8, nvme_storage=750, ram=64),
45-
dict(gpu_count=2, cpu_count=16, nvme_storage=1024, ram=128),
46-
#dict(gpu_count=4, cpu_count=32, nvme_storage=1200, ram=160),
47-
#dict(gpu_count=8, cpu_count=64, nvme_storage=1500, ram=200)
48-
]
49-
5044

5145
def get_regions(plans: List) -> dict:
5246
"""Return a list of regions where the plan is available."""
@@ -57,45 +51,16 @@ def get_regions(plans: List) -> dict:
5751
return regions
5852

5953

60-
def plans_from_custom_plan(plan: dict) -> List[dict]:
61-
prices = dict(cpu=plan['price']['cpu']['hourly'],
62-
ram=plan['price']['ram']['hourly'],
63-
storage=plan['price']['storage']['hourly'],
64-
gpu=plan['price']['gpu']['hourly'])
65-
new_plans = []
66-
for i, config in enumerate(CUSTOM_PLANS_CONFIG):
67-
new_plan = copy.deepcopy(plan)
68-
price = (prices['cpu'] *
69-
config['cpu_count']) + (prices['ram'] * config['ram']) + (
70-
prices['storage'] * config['nvme_storage']) + (
71-
prices['gpu'] * config['gpu_count'])
72-
new_plan['price']['hourly'] = price / config['gpu_count']
73-
new_plan['configuration']['core_count'] = config['cpu_count']
74-
new_plan['configuration']['ram'] = config['ram']
75-
new_plan['configuration']['gpu_count'] = config['gpu_count']
76-
new_plan['configuration']['nvme_storage'] = config['nvme_storage']
77-
new_plan['plan_id'] = f'custom:{i}:{plan["plan_id"]}'
78-
new_plans.append(new_plan)
79-
return new_plans
80-
81-
8254
def create_catalog(output_dir: str) -> None:
8355
response = requests.get(ENDPOINT)
8456
plans = response.json()
85-
custom_plans = [
86-
plan for plan in plans if plan['minimum_commitment'] == 'hourly' and
87-
plan['type'] in ['custom'] and plan['gpu_type'] != 'NO GPU'
88-
]
8957
#plans = [plan for plan in plans if len(plan['regions']) > 0]
9058
plans = [
9159
plan for plan in plans if plan['minimum_commitment'] == 'hourly' and
9260
plan['type'] in ['preconfigured'] and
9361
plan['gpu_type'] not in ['NO GPU', 'RTX_3080_10GB', 'RTX_3090_24GB']
9462
]
9563

96-
plans = plans + [
97-
plan for plan in custom_plans for plan in plans_from_custom_plan(plan)
98-
]
9964
with open(os.path.join(output_dir, 'vms.csv'), mode='w',
10065
encoding='utf-8') as f:
10166
writer = csv.writer(f, delimiter=',', quotechar='"')
@@ -114,7 +79,7 @@ def create_catalog(output_dir: str) -> None:
11479
try:
11580
gpu = GPU_MAP[plan['gpu_type']]
11681
except KeyError:
117-
print(f'Could not map {plan["gpu_type"]}')
82+
#print(f'Could not map {plan["gpu_type"]}')
11883
continue
11984
gpu_memory = int(
12085
str(plan['configuration']['gpu_memory']).replace('GB',

sky/provision/fluidstack/fluidstack_utils.py

+1-12
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88

99
import requests
1010

11-
from sky.clouds.service_catalog.data_fetchers import fetch_fluidstack
12-
1311

1412
def get_key_suffix():
1513
return str(uuid.uuid4()).replace('-', '')[:8]
@@ -119,17 +117,8 @@ def create_instance(
119117
) -> List[str]:
120118
"""Launch new instances."""
121119

122-
config = {}
120+
config: Dict[str, Any] = {}
123121
plans = self.get_plans()
124-
if 'custom' in instance_type:
125-
values = instance_type.split(':')
126-
index = values[1]
127-
instance_type = values[2]
128-
config = fetch_fluidstack.CUSTOM_PLANS_CONFIG[int(index)]
129-
plan = [plan for plan in plans if plan['plan_id'] == instance_type
130-
][0]
131-
config['gpu_model'] = plan['gpu_type']
132-
133122
regions = self.list_regions()
134123
plans = [
135124
plan for plan in plans if plan['plan_id'] == instance_type and

0 commit comments

Comments
 (0)