Skip to content

tests: skip TestPythonRuntimeAliasedIO on TensorRT-RTX with the C++ runtime - #4541

Closed
tp5uiuc wants to merge 1 commit into
pytorch:mainfrom
tp5uiuc:fix/skip-python-aliased-io-rtx-cpp
Closed

tests: skip TestPythonRuntimeAliasedIO on TensorRT-RTX with the C++ runtime#4541
tp5uiuc wants to merge 1 commit into
pytorch:mainfrom
tp5uiuc:fix/skip-python-aliased-io-rtx-cpp

Conversation

@tp5uiuc

@tp5uiuc tp5uiuc commented Aug 21, 2026

Copy link
Copy Markdown
Collaborator

Description

What

Skip TestPythonRuntimeAliasedIO on TensorRT-RTX builds that also ship the C++
runtime, where it currently fails.

Why

The runtimes are expected to be either/or: the flavor is picked from whether
libtorchtrt.so is loaded, and every in-library TRTEngine construction site is
gated on that same flag. This class hand-builds a Python TRTEngine from packed
engine info regardless, producing a combination the library never does — a
torchbind-backed RuntimeCache asked to serve a Python engine. ensure_cache()
returns None there and set_runtime_cache rejects an explicitly-passed None,
so both tests in the class fail.

How

  • test_aliased_io.py: skipIf(torch_tensorrt_runtime and tensorrt_rtx).
    Deliberately narrow — on standard TensorRT the runtime-config path is
    short-circuited in ensure_initialized, so a hand-built engine is harmless and
    the class stays live; it also stays live on python-only builds, where the
    Python TRTEngine is the real runtime and the test is the point.

Testing

Build Result
C++ runtime, tests/py/dynamo/runtime/ 170 passed, 46 skipped

The same suite on main reports 2 failed.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • My code follows the style guidelines of this project (You can use the linters)
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas and hacks
  • I have made corresponding changes to the documentation
  • I have added tests to verify my fix or my feature
  • New and existing unit tests pass locally with my changes
  • I have added the relevant labels to my PR in so that relevant reviewers are notified

…untime

The runtimes are expected to be either/or: the flavor is picked from whether
libtorchtrt.so is loaded, and every in-library TRTEngine construction site is
gated on that same flag. TestPythonRuntimeAliasedIO hand-builds a python
TRTEngine from packed engine info regardless, so on a TensorRT-RTX build that
also ships the C++ runtime it produces a combination the library never does: a
torchbind-backed RuntimeCache asked to serve a python engine. ensure_cache()
returns None there and set_runtime_cache rejects an explicitly-passed None, so
the two tests in the class fail.

Skip that combination rather than teach the cache plumbing to serve it. The
guard is deliberately narrow: on standard TensorRT the runtime-config path is
short-circuited in ensure_initialized, so a hand-built engine is harmless and
the class stays live; it also stays live on python-only builds, where the python
TRTEngine is the real runtime and the test is the point.
@meta-cla meta-cla Bot added the cla signed label Aug 21, 2026
@github-actions github-actions Bot added the component: tests Issues re: Tests label Aug 21, 2026
@github-actions
github-actions Bot requested a review from lanluo-nvidia August 21, 2026 00:55
@tp5uiuc tp5uiuc self-assigned this Aug 21, 2026
@tp5uiuc tp5uiuc added this to the v2.15.0 milestone Aug 21, 2026
@tp5uiuc
tp5uiuc marked this pull request as ready for review August 21, 2026 01:14
@tp5uiuc

tp5uiuc commented Aug 21, 2026

Copy link
Copy Markdown
Collaborator Author

[by Claude Code] Closing in favour of #4482, which fixes these tests rather than skipping them.

TestPythonRuntimeAliasedIO hand-builds a Python TRTEngine. That engine came
up with the default RuntimeSettings, whose runtime_cache is a path string;
RuntimeCache then picked its backing handle from whether the C++ runtime was
loaded, and on a C++ build ensure_cache() returned None, so
set_runtime_cache(None) raised. #4482 defaults engines to runtime_cache=None
— the module owns the implicit cache — so no attach happens and the failure goes
away at the source.

Verified on TensorRT-RTX/A100, runtime/test_aliased_io.py: 2 failed → 10
passed, on both the Python and C++ runtimes.

@tp5uiuc tp5uiuc closed this Aug 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant