diff --git a/sky/clouds/service_catalog/kubernetes_catalog.py b/sky/clouds/service_catalog/kubernetes_catalog.py index 602e19b5ff0..a64aa8f72e9 100644 --- a/sky/clouds/service_catalog/kubernetes_catalog.py +++ b/sky/clouds/service_catalog/kubernetes_catalog.py @@ -136,15 +136,13 @@ def list_accelerators_realtime( total_accelerators_capacity[ accelerator_name] += quantized_count + if accelerator_name not in total_accelerators_available: + total_accelerators_available[accelerator_name] = 0 if accelerators_available >= min_quantity_filter: quantized_availability = min_quantity_filter * ( accelerators_available // min_quantity_filter) - if accelerator_name not in total_accelerators_available: - total_accelerators_available[ - accelerator_name] = quantized_availability - else: - total_accelerators_available[ - accelerator_name] += quantized_availability + total_accelerators_available[ + accelerator_name] += quantized_availability result = []