Skip to content

fix(test): enable TRT-RTX refit and engine cache tests#4192

Open
tp5uiuc wants to merge 2 commits intopytorch:mainfrom
tp5uiuc:fix/enable-rtx-refit-tests
Open

fix(test): enable TRT-RTX refit and engine cache tests#4192
tp5uiuc wants to merge 2 commits intopytorch:mainfrom
tp5uiuc:fix/enable-rtx-refit-tests

Conversation

@tp5uiuc
Copy link
Copy Markdown
Contributor

@tp5uiuc tp5uiuc commented Apr 16, 2026

Description

Now that #4181 removed the RTX-specific batch norm workaround that bypassed constant folding, the refit bug (#3752) is resolved — eps constants are no longer created as separate CONSTANT layers on RTX.

This PR removes the RTX skip decorators from refit and engine cache tests that were previously disabled due to #3752, and fixes an import ordering issue in test_weight_stripped_engine.py.

Fixes #3752

Changes

  • Removed RTX skip from test_dynamo_compile_with_refittable_weight_stripped_engine (test_weight_stripped_engine.py)
  • Removed RTX skip from test_dynamo_compile_with_custom_engine_cache and test_dynamo_compile_change_input_shape (test_engine_cache.py)
  • Kept RTX skip on test_caching_small_model — this test fails a timing assertion (cached compilation is slower than uncached on TRT-RTX). Updated the skip message to reflect the actual reason rather than referencing 🐛 [Bug] TensorRT-RTX Refitter test failed when constant fold is disabled #3752.
  • Fixed import ordering in test_weight_stripped_engine.py: import tensorrt as trt must come after import torch_tensorrt so the tensorrt_rtx module alias is resolved. Added # isort: skip to prevent automated reordering.

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

@meta-cla meta-cla bot added the cla signed label Apr 16, 2026
@github-actions github-actions bot added the component: tests Issues re: Tests label Apr 16, 2026
@github-actions github-actions bot requested a review from lanluo-nvidia April 16, 2026 07:03
Comment thread tests/py/dynamo/models/test_engine_cache.py
Now that pytorch#4181 removed the RTX-specific batch norm workaround that
bypassed constant folding, the refit bug (pytorch#3752) is resolved — eps
constants are no longer created as separate CONSTANT layers on RTX.

Remove the RTX skip decorators from:
- test_dynamo_compile_with_refittable_weight_stripped_engine
- test_dynamo_compile_with_custom_engine_cache
- test_dynamo_compile_change_input_shape

Keep the RTX skip on test_caching_small_model, which fails a timing
assertion (cached compilation is slower than uncached on RTX). Update
the skip message to reflect the actual reason.

Fix import ordering in test_weight_stripped_engine.py: tensorrt must
be imported after torch_tensorrt so the tensorrt_rtx module alias is
resolved correctly.

Fixes pytorch#3752
@tp5uiuc tp5uiuc force-pushed the fix/enable-rtx-refit-tests branch from d39be11 to fe174e7 Compare April 16, 2026 17:45
@tp5uiuc tp5uiuc marked this pull request as ready for review April 16, 2026 17:45
Signed-off-by: tejaswinp <tejaswinp@nvidia.com>
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.

🐛 [Bug] TensorRT-RTX Refitter test failed when constant fold is disabled

1 participant