Skip to content

Commit ea91c00

Browse files
authored
feat: Automatically generating converters for QDP plugins (#3321)
Signed-off-by: Naren Dasan <[email protected]> Signed-off-by: Naren Dasan <[email protected]>
1 parent 1840e36 commit ea91c00

File tree

10 files changed

+804
-489
lines changed

10 files changed

+804
-489
lines changed

.pre-commit-config.yaml

Lines changed: 69 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,71 @@
11
exclude: ^.github/actions/assigner/dist
22
repos:
3-
- repo: https://github.com/pre-commit/pre-commit-hooks
4-
rev: v4.5.0
5-
hooks:
6-
- id: check-yaml
7-
- id: trailing-whitespace
8-
exclude: ^docs
9-
- id: check-added-large-files
10-
args:
11-
- --maxkb=1000
12-
- id: check-vcs-permalinks
13-
- id: check-merge-conflict
14-
- id: mixed-line-ending
15-
args:
16-
- --fix=lf
17-
exclude: ^docs
18-
- repo: https://github.com/pre-commit/mirrors-clang-format
19-
rev: v14.0.6
20-
hooks:
21-
- id: clang-format
22-
types_or: [c++, c, cuda]
23-
- repo: https://github.com/keith/pre-commit-buildifier
24-
rev: 6.4.0
25-
hooks:
26-
- id: buildifier
27-
args:
28-
- --warnings=all
29-
- id: buildifier-lint
30-
- repo: https://github.com/abravalheri/validate-pyproject
31-
rev: v0.16
32-
hooks:
33-
- id: validate-pyproject
34-
- repo: https://github.com/pycqa/isort
35-
rev: 5.13.2
36-
hooks:
37-
- id: isort
38-
name: isort (python)
39-
- repo: https://github.com/pre-commit/mirrors-mypy
40-
rev: 'v1.9.0'
41-
hooks:
42-
- id: mypy
43-
exclude: "^py/torch_tensorrt/fx|^examples|^tests|^py/torch_tensorrt/dynamo/_experimental|^tools|^docs|noxfile.py|setup.py|versions.py"
44-
- repo: https://github.com/astral-sh/ruff-pre-commit
45-
# Ruff version.
46-
rev: v0.3.3
47-
hooks:
48-
- id: ruff
49-
- repo: https://github.com/psf/black
50-
rev: 24.3.0
51-
hooks:
52-
- id: black
53-
exclude: ^examples/custom_converters/elu_converter/setup.py|^docs
54-
- repo: https://github.com/crate-ci/typos
55-
rev: v1.22.9
56-
hooks:
57-
- id: typos
58-
- repo: https://github.com/astral-sh/uv-pre-commit
59-
# uv version.
60-
rev: 0.4.10
61-
hooks:
62-
# Update the uv lockfile
63-
- id: uv-lock
64-
- repo: local
65-
hooks:
66-
- id: dont-commit-upstream
67-
name: NVIDIA-INTERNAL check
68-
entry: "!NVIDIA-INTERNAL"
69-
exclude: "^.pre-commit-config.yaml"
70-
language: pygrep
71-
types: [text]
3+
- repo: https://github.com/pre-commit/pre-commit-hooks
4+
rev: v4.5.0
5+
hooks:
6+
- id: check-yaml
7+
- id: trailing-whitespace
8+
exclude: ^docs
9+
- id: check-added-large-files
10+
args:
11+
- --maxkb=1000
12+
- id: check-vcs-permalinks
13+
- id: check-merge-conflict
14+
- id: mixed-line-ending
15+
args:
16+
- --fix=lf
17+
exclude: ^docs
18+
- repo: https://github.com/pre-commit/mirrors-clang-format
19+
rev: v14.0.6
20+
hooks:
21+
- id: clang-format
22+
types_or: [c++, c, cuda]
23+
- repo: https://github.com/keith/pre-commit-buildifier
24+
rev: 6.4.0
25+
hooks:
26+
- id: buildifier
27+
args:
28+
- --warnings=all
29+
- id: buildifier-lint
30+
- repo: https://github.com/abravalheri/validate-pyproject
31+
rev: v0.23
32+
hooks:
33+
- id: validate-pyproject
34+
- repo: https://github.com/pycqa/isort
35+
rev: 5.13.2
36+
hooks:
37+
- id: isort
38+
name: isort (python)
39+
- repo: https://github.com/pre-commit/mirrors-mypy
40+
rev: "v1.9.0"
41+
hooks:
42+
- id: mypy
43+
exclude: "^py/torch_tensorrt/fx|^examples|^tests|^py/torch_tensorrt/dynamo/_experimental|^tools|^docs|noxfile.py|setup.py|versions.py"
44+
- repo: https://github.com/astral-sh/ruff-pre-commit
45+
# Ruff version.
46+
rev: v0.3.3
47+
hooks:
48+
- id: ruff
49+
- repo: https://github.com/psf/black
50+
rev: 24.3.0
51+
hooks:
52+
- id: black
53+
exclude: ^examples/custom_converters/elu_converter/setup.py|^docs
54+
- repo: https://github.com/crate-ci/typos
55+
rev: v1.22.9
56+
hooks:
57+
- id: typos
58+
- repo: https://github.com/astral-sh/uv-pre-commit
59+
# uv version.
60+
rev: 0.5.5
61+
hooks:
62+
# Update the uv lockfile
63+
- id: uv-lock
64+
- repo: local
65+
hooks:
66+
- id: dont-commit-upstream
67+
name: NVIDIA-INTERNAL check
68+
entry: "!NVIDIA-INTERNAL"
69+
exclude: "^.pre-commit-config.yaml"
70+
language: pygrep
71+
types: [text]

MODULE.bazel

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@ new_local_repository = use_repo_rule("@bazel_tools//tools/build_defs/repo:local.
3636
new_local_repository(
3737
name = "cuda",
3838
build_file = "@//third_party/cuda:BUILD",
39-
path = "/usr/local/cuda-12.4/",
39+
path = "/usr/local/cuda-12.6/",
4040
)
4141

4242
new_local_repository(
4343
name = "cuda_win",
4444
build_file = "@//third_party/cuda:BUILD",
45-
path = "C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.4/",
45+
path = "C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.6/",
4646
)
4747

4848
http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
@@ -55,21 +55,21 @@ http_archive(
5555
name = "libtorch",
5656
build_file = "@//third_party/libtorch:BUILD",
5757
strip_prefix = "libtorch",
58-
urls = ["https://download.pytorch.org/libtorch/nightly/cu124/libtorch-cxx11-abi-shared-with-deps-latest.zip"],
58+
urls = ["https://download.pytorch.org/libtorch/nightly/cu126/libtorch-cxx11-abi-shared-with-deps-latest.zip"],
5959
)
6060

6161
http_archive(
6262
name = "libtorch_pre_cxx11_abi",
6363
build_file = "@//third_party/libtorch:BUILD",
6464
strip_prefix = "libtorch",
65-
urls = ["https://download.pytorch.org/libtorch/nightly/cu124/libtorch-shared-with-deps-latest.zip"],
65+
urls = ["https://download.pytorch.org/libtorch/nightly/cu126/libtorch-shared-with-deps-latest.zip"],
6666
)
6767

6868
http_archive(
6969
name = "libtorch_win",
7070
build_file = "@//third_party/libtorch:BUILD",
7171
strip_prefix = "libtorch",
72-
urls = ["https://download.pytorch.org/libtorch/nightly/cu124/libtorch-win-shared-with-deps-latest.zip"],
72+
urls = ["https://download.pytorch.org/libtorch/nightly/cu126/libtorch-win-shared-with-deps-latest.zip"],
7373
)
7474

7575
# Download these tarballs manually from the NVIDIA website
@@ -79,20 +79,18 @@ http_archive(
7979
http_archive(
8080
name = "tensorrt",
8181
build_file = "@//third_party/tensorrt/archive:BUILD",
82-
sha256 = "33d3c2f3f4c84dc7991a4337a6fde9ed33f5c8e5c4f03ac2eb6b994a382b03a0",
83-
strip_prefix = "TensorRT-10.6.0.26",
82+
strip_prefix = "TensorRT-10.7.0.23",
8483
urls = [
85-
"https://developer.nvidia.com/downloads/compute/machine-learning/tensorrt/10.6.0/tars/TensorRT-10.6.0.26.Linux.x86_64-gnu.cuda-12.6.tar.gz",
84+
"https://developer.nvidia.com/downloads/compute/machine-learning/tensorrt/10.7.0/tars/TensorRT-10.7.0.23.Linux.x86_64-gnu.cuda-12.6.tar.gz",
8685
],
8786
)
8887

8988
http_archive(
9089
name = "tensorrt_win",
9190
build_file = "@//third_party/tensorrt/archive:BUILD",
92-
sha256 = "6c6d92c108a1b3368423e8f69f08d31269830f1e4c9da43b37ba34a176797254",
93-
strip_prefix = "TensorRT-10.6.0.26",
91+
strip_prefix = "TensorRT-10.7.0.23",
9492
urls = [
95-
"https://developer.nvidia.com/downloads/compute/machine-learning/tensorrt/10.6.0/zip/TensorRT-10.6.0.26.Windows.win10.cuda-12.6.zip",
93+
"https://developer.nvidia.com/downloads/compute/machine-learning/tensorrt/10.7.0/zip/TensorRT-10.7.0.23.Windows.win10.cuda-12.6.zip",
9694
],
9795
)
9896

docsrc/index.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ Tutorials
8282
tutorials/_rendered_examples/dynamo/torch_export_cudagraphs
8383
tutorials/_rendered_examples/dynamo/converter_overloading
8484
tutorials/_rendered_examples/dynamo/custom_kernel_plugins
85+
tutorials/_rendered_examples/dynamo/auto_generate_converters
8586
tutorials/_rendered_examples/dynamo/mutable_torchtrt_module_example
8687
tutorials/_rendered_examples/dynamo/weight_streaming_example
8788

@@ -143,7 +144,7 @@ Model Zoo
143144
:caption: Model Zoo
144145
:maxdepth: 3
145146
:hidden:
146-
147+
147148
tutorials/_rendered_examples/dynamo/torch_compile_resnet_example
148149
tutorials/_rendered_examples/dynamo/torch_compile_transformers_example
149150
tutorials/_rendered_examples/dynamo/torch_compile_stable_diffusion

0 commit comments

Comments
 (0)