Skip to content
Open
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
27 changes: 21 additions & 6 deletions cli-tools/gpu-dev-cli/gpu_dev_cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -2441,14 +2441,17 @@ def _show_availability() -> None:
available = info.get("available", 0)
max_reservable = info.get("max_reservable", 0)
total = info.get("total", 0)
scalable_total = info.get("scalable_total", 0)
full_nodes_available = info.get("full_nodes_available", 0)
gpus_per_instance = info.get("gpus_per_instance", 0)
queue_length = info.get("queue_length", 0)
est_wait = info.get("estimated_wait_minutes", 0)

# Format wait time
# Format wait time — for Karpenter types, show scale-up estimate
if available > 0:
wait_display = "Available now"
elif scalable_total > 0 and available == 0:
wait_display = "~1min (scaling up)"
elif est_wait == 0:
wait_display = "Unknown"
elif est_wait < 60:
Expand All @@ -2461,10 +2464,13 @@ def _show_availability() -> None:
else:
wait_display = f"{hours}h {minutes}min"

# Show total as "current / scalable" for Karpenter types
if scalable_total > 0:
total_display = f"{total} / {scalable_total}"
else:
total_display = str(total)

# Color code availability based on full nodes available
# Red: 0 GPUs available
# Yellow: Some GPUs available but no full node
# Green: At least one full node available
if available == 0:
available_display = f"[red]{available}[/red]"
elif full_nodes_available > 0:
Expand All @@ -2476,7 +2482,7 @@ def _show_availability() -> None:
gpu_type.upper(),
available_display,
str(max_reservable),
str(total),
total_display,
str(queue_length),
arch,
wait_display,
Expand Down Expand Up @@ -2583,12 +2589,15 @@ def _show_availability_watch(interval: int) -> None:
last_arch = arch
available = info.get("available", 0)
total = info.get("total", 0)
scalable_total = info.get("scalable_total", 0)
queue_length = info.get("queue_length", 0)
est_wait = info.get("estimated_wait_minutes", 0)

# Format wait time
if available > 0:
wait_display = "Available now"
elif scalable_total > 0 and available == 0:
wait_display = "~1min (scaling up)"
elif est_wait == 0:
wait_display = "Unknown"
elif est_wait < 60:
Expand All @@ -2601,6 +2610,12 @@ def _show_availability_watch(interval: int) -> None:
else:
wait_display = f"{hours}h {minutes}min"

# Show total as "current / scalable" for Karpenter types
if scalable_total > 0:
total_display = f"{total} / {scalable_total}"
else:
total_display = str(total)

# Color code availability
if available > 0:
available_display = f"[green]{available}[/green]"
Expand All @@ -2610,7 +2625,7 @@ def _show_availability_watch(interval: int) -> None:
table.add_row(
gpu_type.upper(),
available_display,
str(total),
total_display,
str(queue_length),
arch,
wait_display,
Expand Down
1 change: 1 addition & 0 deletions cli-tools/gpu-dev-cli/gpu_dev_cli/reservations.py
Original file line number Diff line number Diff line change
Expand Up @@ -959,6 +959,7 @@ def get_gpu_availability_by_type(self) -> Optional[Dict[str, Dict[str, Any]]]:
availability_info[gpu_type] = {
"available": int(item.get("available_gpus", 0)),
"total": int(item.get("total_gpus", 0)),
"scalable_total": int(item.get("scalable_total", 0)),
"max_reservable": int(item.get("max_reservable", 0)),
"full_nodes_available": int(item.get("full_nodes_available", 0)),
"gpus_per_instance": int(item.get("gpus_per_instance", 0)),
Expand Down
1 change: 1 addition & 0 deletions terraform-gpu-devservers/eks.tf
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ locals {
instance_count = cr_config != null ? cr_config.instance_count : gpu_config.instance_count
}
]
if !try(gpu_config.karpenter_managed, false) # Skip types managed by Karpenter
])

# Convert to map for for_each
Expand Down
Loading