Skip to content

tests(cross-runtime-serde): hide torch-trt DLLs on Windows too#4343

Open
tp5uiuc wants to merge 1 commit into
pytorch:mainfrom
tp5uiuc:tejaswinp/fix-cross-runtime-helper-windows
Open

tests(cross-runtime-serde): hide torch-trt DLLs on Windows too#4343
tp5uiuc wants to merge 1 commit into
pytorch:mainfrom
tp5uiuc:tejaswinp/fix-cross-runtime-helper-windows

Conversation

@tp5uiuc

@tp5uiuc tp5uiuc commented Jun 14, 2026

Copy link
Copy Markdown
Collaborator

Description

tests/py/dynamo/models/_cross_runtime_load_helper.py:_hide_so_files() only globbed the
Linux/macOS-style libtorchtrt* pattern. On Windows the Torch-TensorRT runtime libraries
are named torchtrt.dll / torchtrt_runtime.dll (no lib prefix; see
py/torch_tensorrt/_features.py), so the glob returned an empty list and the spawned
Python-only subprocess kept torch_tensorrt_runtime == True, tripping the
C++ runtime should be disabled assertion.

Make the glob platform-aware:

  • Windows: torchtrt*.dll, torchtrt*.lib
  • Linux/macOS: libtorchtrt* (unchanged)

Fixes the three test_cross_runtime_serde.py failures on the Windows L2 dynamo compile
runners surfaced in #4330:

  • test_save_cpp_load_python
  • test_save_python_load_python
  • test_save_python_load_cpp

Type of change

  • Bug fix (test-only; no runtime API change)

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

``_cross_runtime_load_helper.py:_hide_so_files()`` globbed only the Linux/macOS-style ``libtorchtrt*`` pattern. On Windows the runtime libraries are named ``torchtrt.dll`` / ``torchtrt_runtime.dll`` (no ``lib`` prefix; see ``py/torch_tensorrt/_features.py``), so the glob returned an empty list and the spawned subprocess kept ``torch_tensorrt_runtime`` True, tripping the ``C++ runtime should be disabled`` assertion in all three ``test_cross_runtime_serde.py`` tests on Windows L2 dynamo compile runners.

Make the glob platform-aware: ``torchtrt*.dll`` + ``torchtrt*.lib`` on Windows, ``libtorchtrt*`` elsewhere.
@meta-cla meta-cla Bot added the cla signed label Jun 14, 2026
@github-actions github-actions Bot added the component: tests Issues re: Tests label Jun 14, 2026
@tp5uiuc tp5uiuc requested a review from cehongwang June 14, 2026 22:47

@cehongwang cehongwang left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@tp5uiuc tp5uiuc self-assigned this Jun 17, 2026
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