Skip to content

Commit

Permalink
[Catalog] Silently ignore TPU price not found. (skypilot-org#4134)
Browse files Browse the repository at this point in the history
* [Catalog] Silently ignore TPU price not found.

* assert for non tpu v6e

* format
  • Loading branch information
cblmemo authored and AlexCuadron committed Oct 24, 2024
1 parent 7517eaf commit 0fba990
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion sky/clouds/service_catalog/data_fetchers/fetch_gcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,13 @@ def get_tpu_price(row: pd.Series, spot: bool) -> Optional[float]:
spot_str = 'spot ' if spot else ''
print(f'The {spot_str}price of {tpu_name} in {tpu_region} is '
'not found in SKUs or hidden TPU price DF.')
assert spot or tpu_price is not None, (row, hidden_tpu, HIDDEN_TPU_DF)
# TODO(tian): Hack. Should investigate how to retrieve the price
# for TPU-v6e.
if not tpu_name.startswith('tpu-v6e'):
assert spot or tpu_price is not None, (row, hidden_tpu,
HIDDEN_TPU_DF)
else:
tpu_price = 0.0
return tpu_price

df['Price'] = df.apply(lambda row: get_tpu_price(row, spot=False), axis=1)
Expand Down

0 comments on commit 0fba990

Please sign in to comment.