Skip to content

fix(gpu): add safe float parsing for memory_free_gb in assign_gpus.py - #2621

Open
mohitchauhan221 wants to merge 1 commit into
Osmantic:mainfrom
mohitchauhan221:fix/assign-gpus-memory-free-float
Open

fix(gpu): add safe float parsing for memory_free_gb in assign_gpus.py#2621
mohitchauhan221 wants to merge 1 commit into
Osmantic:mainfrom
mohitchauhan221:fix/assign-gpus-memory-free-float

Conversation

@mohitchauhan221

Copy link
Copy Markdown

Problem

In ods/scripts/assign_gpus.py, parse_gpus() parses available VRAM from topology payloads using float(g["memory_free_gb"]). If the topology file passes non-numeric values or invalid strings for memory_free_gb, float() raises an unhandled ValueError.

Fix

Wrap float(g["memory_free_gb"]) in a try...except (ValueError, TypeError) block, defaulting scheduling_mb back to total_mb on parsing errors.

Verification

Verified syntax with python3 -m py_compile ods/scripts/assign_gpus.py. git diff --check passed cleanly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants