Skip to content

Commit

Permalink
Skip shapes if GPU parameters are incomplete
Browse files Browse the repository at this point in the history
  • Loading branch information
jvstme authored and TheBits committed May 10, 2024
1 parent 8fc9cee commit 751d487
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/gpuhunt/providers/oci.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,24 @@ def get(

vcpu = ocpu_product.qty if shape.is_arm_cpu() else ocpu_product.qty * 2

gpu = dict(
gpu_count=shape.gpu_qty or 0,
gpu_name=get_gpu_name(shape.name),
gpu_memory=shape.get_gpu_unit_memory_gb(),
)
if any(gpu.values()) and not all(gpu.values()):
logger.warning(
"Skipping shape %s due to incomplete GPU parameters: %s", shape.name, gpu
)
continue

catalog_item = RawCatalogItem(
instance_name=shape.name,
location=None,
price=shape_price,
cpu=vcpu,
memory=shape.bundle_memory_qty,
gpu_count=shape.gpu_qty or 0,
gpu_name=get_gpu_name(shape.name),
gpu_memory=shape.get_gpu_unit_memory_gb(),
**gpu,
spot=False,
disk_size=None,
)
Expand Down

0 comments on commit 751d487

Please sign in to comment.