Skip to content

tensorrt_rtx try on #3679

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
Draft

tensorrt_rtx try on #3679

wants to merge 9 commits into from

Conversation

lanluo-nvidia
Copy link
Collaborator

Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Fixes # (issue)

Type of change

Please delete options that are not relevant and/or add your own.

  • 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)
  • This change requires a documentation update

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

@lanluo-nvidia lanluo-nvidia added WIP Work is in progress, pull request should not be merged yet and removed cla signed labels Jul 10, 2025
@github-actions github-actions bot added component: conversion Issues re: Conversion stage component: core Issues re: The core compiler component: converters Issues re: Specific op converters component: build system Issues re: Build system component: api [Python] Issues re: Python API component: api [C++] Issues re: C++ API component: runtime cla signed component: dynamo Issues relating to the `torch.compile` or `torch._dynamo.export` paths and removed WIP Work is in progress, pull request should not be merged yet labels Jul 10, 2025
@github-actions github-actions bot requested a review from narendasan July 10, 2025 23:37
@github-actions github-actions bot added component: tests Issues re: Tests component: lowering Issues re: The lowering / preprocessing passes component: evaluators Issues re: Specific op evaluators component: partitioning labels Jul 11, 2025
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

There are some changes that do not conform to C++ style guidelines:

diff --git a/home/runner/work/TensorRT/TensorRT/cpp/bin/torchtrtc/main.cpp b/tmp/changes.txt
index 60c76da..63e4448 100644
--- a/home/runner/work/TensorRT/TensorRT/cpp/bin/torchtrtc/main.cpp
+++ b/tmp/changes.txt
@@ -374,7 +374,9 @@ int main(int argc, char** argv) {
        // } else {
        //   torchtrt::logging::log(
        //       torchtrt::logging::Level::kINFO,
-        //       "Int8 precision has been enabled but no calibrator provided. This assumes the network has Q/DQ nodes obtained from Quantization aware training. For more details, refer to https://docs.nvidia.com/deeplearning/tensorrt/developer-guide/index.html#work-with-qat-networks");
+        //       "Int8 precision has been enabled but no calibrator provided. This assumes the network has Q/DQ nodes
+        //       obtained from Quantization aware training. For more details, refer to
+        //       https://docs.nvidia.com/deeplearning/tensorrt/developer-guide/index.html#work-with-qat-networks");
        // }
      } else {
        std::stringstream ss;
diff --git a/home/runner/work/TensorRT/TensorRT/core/conversion/conversionctx/ConversionCtx.cpp b/tmp/changes.txt
index c821698..9fdcac7 100644
--- a/home/runner/work/TensorRT/TensorRT/core/conversion/conversionctx/ConversionCtx.cpp
+++ b/tmp/changes.txt
@@ -59,16 +59,16 @@ ConversionCtx::ConversionCtx(BuilderSettings build_settings)
  for (auto p = settings.enabled_precisions.begin(); p != settings.enabled_precisions.end(); ++p) {
    switch (*p) {
      case nvinfer1::DataType::kHALF:
-        // tensorrt_rtx is strong typed, cannot set fp16 by builder config, only do this for tensorrt build
-        #ifndef TRT_MAJOR_RTX
+// tensorrt_rtx is strong typed, cannot set fp16 by builder config, only do this for tensorrt build
+#ifndef TRT_MAJOR_RTX
        TORCHTRT_CHECK(
            builder->platformHasFastFp16(), "Requested inference in FP16 but platform does not support FP16");
        cfg->setFlag(nvinfer1::BuilderFlag::kFP16);
        break;
-        #endif
+#endif
      case nvinfer1::DataType::kINT8:
-        // tensorrt_rtx is strong typed, cannot set int8 by builder config, only do this for tensorrt build
-        #ifndef TRT_MAJOR_RTX
+// tensorrt_rtx is strong typed, cannot set int8 by builder config, only do this for tensorrt build
+#ifndef TRT_MAJOR_RTX
        TORCHTRT_CHECK(
            builder->platformHasFastInt8(), "Requested inference in INT8 but platform does not support INT8");
        cfg->setFlag(nvinfer1::BuilderFlag::kINT8);
@@ -81,7 +81,7 @@ ConversionCtx::ConversionCtx(BuilderSettings build_settings)
          cfg->setInt8Calibrator(settings.calibrator);
        }
        break;
-        #endif
+#endif
      case nvinfer1::DataType::kFLOAT:
        break;
      case nvinfer1::DataType::kINT32:
ERROR: Some files do not conform to style guidelines

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

There are some changes that do not conform to Python style guidelines:

--- /home/runner/work/TensorRT/TensorRT/py/torch_tensorrt/__init__.py	2025-07-11 22:54:04.884045+00:00
+++ /home/runner/work/TensorRT/TensorRT/py/torch_tensorrt/__init__.py	2025-07-11 22:54:29.748057+00:00
@@ -42,12 +42,13 @@

import torch

try:
    from . import trt_alias  # noqa: F401
- 
+
    import tensorrt  # noqa: F401
+
    print(f"You are using {tensorrt.__name__=} {tensorrt.__version__=}")
except ImportError:
    tensorrt_version = _parse_semver(__tensorrt_version__)
    tensorrt_rtx_version = _parse_semver(__tensorrt_rtx_version__)

--- /home/runner/work/TensorRT/TensorRT/setup.py	2025-07-11 22:54:04.902045+00:00
+++ /home/runner/work/TensorRT/TensorRT/setup.py	2025-07-11 22:54:34.510910+00:00
@@ -548,11 +548,17 @@
            tensorrt_linux_external_dir = tensorrt_x86_64_external_dir

    if USE_RTX:
        tensorrt_windows_external_dir = (
            lambda: subprocess.check_output(
-                [BAZEL_EXE, "query", "@tensorrt_rtx_win//:nvinfer", "--output", "location"]
+                [
+                    BAZEL_EXE,
+                    "query",
+                    "@tensorrt_rtx_win//:nvinfer",
+                    "--output",
+                    "location",
+                ]
            )
            .decode("ascii")
            .strip()
            .split("/BUILD.bazel")[0]
        )

@lanluo-nvidia lanluo-nvidia added the WIP Work is in progress, pull request should not be merged yet label Jul 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla signed component: api [C++] Issues re: C++ API component: api [Python] Issues re: Python API component: build system Issues re: Build system component: conversion Issues re: Conversion stage component: converters Issues re: Specific op converters component: core Issues re: The core compiler component: dynamo Issues relating to the `torch.compile` or `torch._dynamo.export` paths component: evaluators Issues re: Specific op evaluators component: lowering Issues re: The lowering / preprocessing passes component: partitioning component: runtime component: tests Issues re: Tests WIP Work is in progress, pull request should not be merged yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants