Skip to content

fix(gpu): report actual vs expected GPU PCI count in provision-check assertion - #4589

Merged
LiliDeng merged 1 commit into
mainfrom
smyakam/fix_gpu_count/2026_06_09
Jul 9, 2026
Merged

fix(gpu): report actual vs expected GPU PCI count in provision-check assertion#4589
LiliDeng merged 1 commit into
mainfrom
smyakam/fix_gpu_count/2026_06_09

Conversation

@SRIKKANTH

Copy link
Copy Markdown
Collaborator

What

Replace the static GPU provisioning assertion message in _gpu_provision_check with a dynamic one that reports the actual detected GPU PCI device count and the expected minimum.

Why

The assertion checks len(init_gpu) >= min_pci_count, but the failure message was hardcoded to "Number of GPU PCI device is not greater than 0". This is misleading: when min_pci_count > 0, the reported reason didn't match the actual check, making triage harder (e.g. detected 2 GPUs but expected 4 still printed "not greater than 0"). The message should reflect the real detected and expected values.

How

Update the .described_as(...) text to include len(init_gpu) (detected count) and min_pci_count (expected minimum):

Detected GPU PCI device count {n} is less than the expected minimum {min}

No change to the assertion logic (is_greater_than_or_equal_to(min_pci_count)) or control flow.

Impact

  • Clearer, accurate failure diagnostics for GPU provisioning checks.
  • No behavioral change to which cases pass or fail.

Testing

  • GPU provisioning validation on a GPU SKU.

Description

Related Issue

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Refactoring
  • Documentation update

Checklist

  • Description is filled in above
  • No credentials, secrets, or internal details are included
  • Peer review requested (if not, add required peer reviewers after raising PR)
  • Tests executed and results posted below

Test Validation

Key Test Cases:

  • verify_gpu_provision

Impacted LISA Features:

Gpu

Tested Azure Marketplace Images:

  • canonical 0001-com-ubuntu-server-jammy 22_04-lts-gen2 latest

Test Results

Image VM Size Result
canonical 0001-com-ubuntu-server-jammy 22_04-lts-gen2 latest Standard_NC4as_T4_v3 PASSED

…assertion

## What
Replace the static GPU provisioning assertion message in `_gpu_provision_check`
with a dynamic one that reports the actual detected GPU PCI device count and the
expected minimum.

## Why
The assertion checks `len(init_gpu) >= min_pci_count`, but the failure message
was hardcoded to "Number of GPU PCI device is not greater than 0". This is
misleading: when `min_pci_count > 0`, the reported reason didn't match the
actual check, making triage harder (e.g. detected 2 GPUs but expected 4 still
printed "not greater than 0"). The message should reflect the real detected and
expected values.

## How
Update the `.described_as(...)` text to include `len(init_gpu)` (detected count)
and `min_pci_count` (expected minimum):

> Detected GPU PCI device count {n} is less than the expected minimum {min}

No change to the assertion logic (`is_greater_than_or_equal_to(min_pci_count)`)
or control flow.

## Impact
- Clearer, accurate failure diagnostics for GPU provisioning checks.
- No behavioral change to which cases pass or fail.

## Testing
- GPU provisioning validation on a GPU SKU.
Copilot AI review requested due to automatic review settings July 9, 2026 07:25

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the GPU provisioning check assertion text in the GPU test suite so failures report the actual detected GPU PCI device count and the expected minimum, improving triage without changing pass/fail behavior.

Changes:

  • Replace the hardcoded _gpu_provision_check assertion message with a dynamic message that includes actual and expected counts.

Comment thread lisa/microsoft/testsuites/gpu/gpusuite.py
@github-actions

github-actions Bot commented Jul 9, 2026

Copy link
Copy Markdown

✅ AI Test Selection — PASSED

7 test case(s) selected (view run)

Marketplace image: canonical 0001-com-ubuntu-server-jammy 22_04-lts-gen2 latest

Count
✅ Passed 6
❌ Failed 0
⏭️ Skipped 1
Total 7
Test case details
Test Case Status Time (s) Message
verify_max_gpu_provision (lisa_0_2) ⏭️ SKIPPED 0.000 deployment skipped: Requirement mismatch: gpu_count: capability(0) is smaller than requirement min(8)
verify_gpu_rescind_validation (lisa_0_5) ✅ PASSED 10.549
verify_gpu_provision (lisa_0_1) ✅ PASSED 31.537
verify_gpu_adapter_count (lisa_0_4) ✅ PASSED 832.927
verify_gpu_extension_installation (lisa_0_3) ✅ PASSED 823.089
verify_load_gpu_driver (lisa_0_0) ✅ PASSED 894.328
verify_gpu_cuda_with_pytorch (lisa_0_6) ✅ PASSED 982.013

@LiliDeng
LiliDeng merged commit 58996a0 into main Jul 9, 2026
62 checks passed
@LiliDeng
LiliDeng deleted the smyakam/fix_gpu_count/2026_06_09 branch July 9, 2026 10:09
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.

3 participants