Skip to content

Fix #8: Replace hardcoded VRAM fallback and prevent division by zero - #11

Open
Aayush206 wants to merge 1 commit into
Sievehouse:mainfrom
Aayush206:fix/issue-8-vram-fallback
Open

Aayush206 wants to merge 1 commit into
Sievehouse:mainfrom
Aayush206:fix/issue-8-vram-fallback

Conversation

@Aayush206

Copy link
Copy Markdown

Overview

This PR fixes the hardcoded 80GB VRAM fallback in HistoricalUtilization, which caused inaccurate VRAM utilization percentages for GPUs with different memory capacities.

Changes Made

  • Replaced the hardcoded 81920 MiB fallback with dynamic memory calculation using FBUsedMiB + FBFreeMiB.
  • Added a denominator validation check to prevent division by zero, NaN, and Infinity values.
  • Introduced a separate VRAM sample counter to prevent invalid memory readings from skewing average VRAM utilization.
  • Preserved existing GPU and memory-copy utilization calculations.
  • Added regression tests for different GPU memory capacities and missing memory telemetry.

Expected Impact

  • Accurate historical VRAM utilization across different GPU models.
  • Prevention of division-by-zero-related JSON serialization errors.
  • Improved reliability when GPU memory capacity information is unavailable.

Testing

Added regression tests covering:

  • NVIDIA L4
  • NVIDIA A100
  • NVIDIA H100
  • NVIDIA H200
  • Zero-memory denominator edge case

Closes #8.

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.

Hardcoded 80GB VRAM fallback in HistoricalUtilization skews %VRAM for non-H100 GPUs

1 participant