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

[UI] Now show-gpus shows the combined price for GCP GPU instance #2946

Merged
merged 17 commits into from
Jan 11, 2024
15 changes: 11 additions & 4 deletions sky/clouds/service_catalog/gcp_catalog.py
Vaibhav2001 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,7 @@ def list_accelerators(

# Remove GPUs that are unsupported by SkyPilot.
new_results = {}
# print(acc_name)
Vaibhav2001 marked this conversation as resolved.
Show resolved Hide resolved
for acc_name, acc_info in results.items():
if (acc_name.startswith('tpu') or
acc_name in _NUM_ACC_TO_MAX_CPU_AND_MEMORY or
Expand All @@ -392,11 +393,18 @@ def list_accelerators(
new_infos = defaultdict(list)
Vaibhav2001 marked this conversation as resolved.
Show resolved Hide resolved
for info in acc_infos:
assert pd.isna(info.instance_type) and pd.isna(info.memory), acc_infos
if info.accelerator_name.startswith('tpu'):
new_infos[info.accelerator_name].append(
Vaibhav2001 marked this conversation as resolved.
Show resolved Hide resolved
info._replace(instance_type='TPU-VM',))
Vaibhav2001 marked this conversation as resolved.
Show resolved Hide resolved
continue
Vaibhav2001 marked this conversation as resolved.
Show resolved Hide resolved
vm_types, _ = get_instance_type_for_accelerator(info.accelerator_name,
cblmemo marked this conversation as resolved.
Show resolved Hide resolved
info.accelerator_count,
region=region_filter)
region=region_filter,
use_spot=True)
Vaibhav2001 marked this conversation as resolved.
Show resolved Hide resolved
#always has a vm type for GCP
Vaibhav2001 marked this conversation as resolved.
Show resolved Hide resolved
assert vm_types is not None
for vm_type in vm_types:
df = _df[(_df['InstanceType'] == vm_type)]
df = _df[_df['InstanceType'] == vm_type]
cpu_count = df['vCPUs'].iloc[0]
memory = df['MemoryGiB'].iloc[0]
vm_price = common.get_hourly_cost_impl(_df,
Expand All @@ -418,8 +426,7 @@ def list_accelerators(
price=info.price + vm_price,
spot_price=info.spot_price + vm_spot_price,
))
results.update(new_infos)
return results
return new_infos


def get_region_zones_for_accelerators(
Expand Down