Skip to content

[PyT] Install pytest in onnx L1 test as Pyt container no longer packages it#2781

Merged
KshitijLakhani merged 1 commit intoNVIDIA:mainfrom
KshitijLakhani:klakhani/fix/install-pytest-onnx-test
Mar 19, 2026
Merged

[PyT] Install pytest in onnx L1 test as Pyt container no longer packages it#2781
KshitijLakhani merged 1 commit intoNVIDIA:mainfrom
KshitijLakhani:klakhani/fix/install-pytest-onnx-test

Conversation

@KshitijLakhani
Copy link
Collaborator

@KshitijLakhani KshitijLakhani commented Mar 18, 2026

Description

Install pytest in onnx L1 test as Pyt container no longer packages it

Fixes # (issue)

Type of change

  • Documentation change (change only to the documentation, either a fix or a new content)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Infra/Build change
  • Code refactoring

Checklist:

  • I have read and followed the contributing guidelines
  • The functionality is complete
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Signed-off-by: Kshitij Janardan Lakhani <klakhani@nvidia.com>
@KshitijLakhani KshitijLakhani self-assigned this Mar 18, 2026
@KshitijLakhani KshitijLakhani changed the title Install pytest in onnx L1 test as Pyt container no longer packages it [PyT] Install pytest in onnx L1 test as Pyt container no longer packages it Mar 18, 2026
@KshitijLakhani
Copy link
Collaborator Author

/te-ci pytorch L1

@KshitijLakhani KshitijLakhani marked this pull request as ready for review March 18, 2026 23:24
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Mar 18, 2026

Greptile Summary

This PR fixes the ONNX L1 test script by explicitly installing pytest==8.2.1 before running the test suite, addressing the fact that the PyTorch container no longer bundles pytest. It also introduces an error_exit helper function for clean failure handling.

  • pip3 install pytest==8.2.1 || error_exit "Failed to install pytest" is added at line 14, matching the identical pattern already used in qa/L0_pytorch_unittest/test.sh and qa/L1_pytorch_distributed_unittest/test.sh.
  • The error_exit helper (lines 5–8) is consistent with how other test scripts in the qa/ directory handle fatal errors.
  • The pinned version 8.2.1 is consistent with the version used across all other PyTorch test scripts in the repo.
  • No functional test logic or environment variable handling was altered.

Confidence Score: 5/5

  • This PR is safe to merge — it is a minimal, low-risk infra fix that aligns this script with the existing patterns in the repository.
  • The change is a one-liner install of a pinned, well-known package (pytest==8.2.1) with proper error handling, directly mirroring the approach taken in at least two other test scripts in the same repo. There are no logical, security, or correctness concerns.
  • No files require special attention.

Important Files Changed

Filename Overview
qa/L1_pytorch_onnx_unittest/test.sh Adds an error_exit helper and installs pytest==8.2.1 before running the ONNX unit test, consistent with the pattern used in other PyTorch test scripts in the repository.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Start test.sh] --> B[Set TE_PATH / XML_LOG_DIR defaults]
    B --> C[mkdir -p XML_LOG_DIR]
    C --> D[pip3 install pytest==8.2.1]
    D -->|success| E[Run pytest on test_onnx_export.py\nwith NVTE_UnfusedDPA_Emulate_FP8=1]
    D -->|failure| F[error_exit: Failed to install pytest\nexit 1]
    E -->|pass| G[Exit 0]
    E -->|fail| H[Exit with pytest non-zero code]
Loading

Last reviewed commit: "Install pytest in on..."

Copy link
Member

@ksivaman ksivaman left a comment

Choose a reason for hiding this comment

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

LGTM

@KshitijLakhani
Copy link
Collaborator Author

KshitijLakhani commented Mar 19, 2026

All jobs in the pipeline pass (46474880)
B200 ones beings stuck is a known CI allocation issue

@KshitijLakhani KshitijLakhani merged commit b7598aa into NVIDIA:main Mar 19, 2026
10 of 14 checks passed
@KshitijLakhani KshitijLakhani deleted the klakhani/fix/install-pytest-onnx-test branch March 19, 2026 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants