Skip to content

[PyTorch] Skip torch.compile tests when required PyTorch APIs are unavailable - #63

Draft
pggPL wants to merge 1 commit into
mainfrom
skip_compile_old_pytorch
Draft

pggPL wants to merge 1 commit into
mainfrom
skip_compile_old_pytorch

Conversation

@pggPL

@pggPL pggPL commented Oct 13, 2026

Copy link
Copy Markdown
Owner

Description

PyTorch builds such as NVIDIA 26.08 expose part of the opaque-object API but lack is_opaque_constant_type, which Transformer Engine requires to register its quantizers. The compile test module currently treats those builds as supported and fails during collection when defining its QDQ operators.

Check for the required predicate before defining opaque test operators and skip the module's test cases when it is absent. Supported builds retain the same collected tests. This changes only tests.

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

Changes

  • Include is_opaque_constant_type in the opaque API availability check.
  • Mark all cases in test_torch_compile.py skipped when the required API is unavailable, preserving a successful pytest exit status.
  • Replace an outdated version-based skip reason with an API-based reason.

Validation

Validated on RTX 5880 Ada, PyTorch 2.15.0a0+875d815502.nvinternal.main, pytest 8.2.1, using the upstream Python sources and existing native libraries:

  • Hide is_opaque_constant_type in an isolated process before importing TE: baseline reproduces the collection error; patched module reports 392 skipped and exit code 0.
  • With the API available, baseline and patched collection contain the identical 392 test node IDs.
  • Existing quantizer fullgraph, Linear compile and attention-backend tracing tests: 10 passed, 3 hardware skips.
  • Pre-commit, license check and full PyTorch Python lint pass.

The missing API was simulated on PyTorch 2.15; the 26.08 image and full numerical suite were not rerun.

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: Pawel Gadzinski <pgadzinski@nvidia.com>

This branch has not been deployed

No deployments
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.

1 participant