Skip to content

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

Merged
tp5uiuc merged 1 commit into
pytorch:mainfrom
tp5uiuc:tejaswinp/fix-cross-runtime-helper-windows
Jun 22, 2026
Merged

tests(cross-runtime-serde): hide torch-trt DLLs on Windows too#4343
tp5uiuc merged 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
@tp5uiuc tp5uiuc added the Force All Tests[L0+L1+L2] For run all the L0, L1, L2 tests label Jun 22, 2026
@github-actions github-actions Bot requested a review from lanluo-nvidia June 22, 2026 15:07
@tp5uiuc

tp5uiuc commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator Author

[by Claude Code] CI analysis: all red checks on the current run are pre-existing/infra failures, none caused by this 1-file test-helper change.

  • L0 dynamo core (cu130/cu132): 10× runtime/test_000_runtime_cache.py failures (AttributeError: 'NoneType' has no attribute 'context', missing runtime_cache.bin). Unrelated test-bed.
  • Python-only dynamo runtime (cu130/cu132 + RTX variants): 3× test_004_weight_streaming.py budget assertions. Listed as pre-existing in this PR's README.
  • L0 dynamo converter (cu130/cu132): 5× test_cumsum_aten.pyTensorRT build_serialized_network returned None. Listed as pre-existing in this PR's README.
  • L0 core python (Windows, cu130): flashinfer-python wheel build fails on Windows. Third-party dep, unrelated.
  • L0 torchscript (cu130/cu132): 2h0m20s timeouts. Infra.
  • Python-only build Linux aarch64 cu132: pip install torch --pre from download.pytorch.org failed (urllib3). Network/infra.

Counts where visible: 3/68 (python-only dynamo runtime), 5/1977 (dynamo converter), 10/19 (dynamo core). All builds pass (Linux x86_64, Windows, SBSA, Jetpack, RTX). Linters + CLA pass.

Caveat: test_cross_runtime_serde.py lives in tests/py/dynamo/models/, which is not exercised by any L0 job here — it runs only under L2-dynamo-compile-tests (build-test-windows.yml), gated on the Force All Tests[L0+L1+L2] label. Label just applied; awaiting that run as the canonical verifier.

@tp5uiuc

tp5uiuc commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator Author

Let me merge this one in, the $/! for rerunning L2 for a one-line change is questionable. We can confirm from post-merge runs.

@tp5uiuc tp5uiuc merged commit ebedd70 into pytorch:main Jun 22, 2026
126 of 146 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla signed component: tests Issues re: Tests Force All Tests[L0+L1+L2] For run all the L0, L1, L2 tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants