Skip to content

Commit 2736889

Browse files
author
Sean Archer
committed
Small refactoring
1 parent 6ed98af commit 2736889

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/sagemaker/hyperpod/training/quota_allocation_util.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ def _get_resources_from_instance(instance_type: str, node_count: int) -> dict:
212212
return result
213213

214214

215-
def _trim_resource_requests(instance_type: str, requests_values: dict):
215+
def _trim_resource_requests(instance_type: str, requests_values: dict) -> dict:
216216
instance = INSTANCE_RESOURCES.get(instance_type, {})
217217
cpu_capacity = instance.get("cpu", 0)
218218
max_allocatable_cpu = cpu_capacity - (_calculate_cpu_reservation(cpu_capacity))
@@ -379,7 +379,7 @@ def _get_accelerator_type_and_count(instance_type: str) -> Tuple[Optional[str],
379379
return None, 0
380380

381381

382-
def _calculate_memory_reservation(memory_gb):
382+
def _calculate_memory_reservation(memory_gb: int) -> float:
383383

384384
static_memory_overhead = 0.5 # 500MB
385385

@@ -416,7 +416,7 @@ def _calculate_memory_reservation(memory_gb):
416416
return reserved_memory
417417

418418

419-
def _calculate_cpu_reservation(cpu_count):
419+
def _calculate_cpu_reservation(cpu_count: int) -> float:
420420

421421
# Static overhead for observability tools and system processes
422422
static_cpu_overhead = 0.1 # 0.1 cores

0 commit comments

Comments
 (0)