Skip to content

Commit 0a939df

Browse files
authored
DLFW changes (#2281)
1 parent 19aabdd commit 0a939df

File tree

4 files changed

+29
-26
lines changed

4 files changed

+29
-26
lines changed

docker/WORKSPACE.ngc

+19-19
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,28 @@ http_archive(
99
sha256 = "778197e26c5fbeb07ac2a2c5ae405b30f6cb7ad1f5510ea6fdac03bded96cc6f",
1010
)
1111

12-
load("@rules_python//python:pip.bzl", "pip_install")
12+
load("@rules_python//python:repositories.bzl", "py_repositories")
13+
14+
py_repositories()
1315

1416
http_archive(
1517
name = "rules_pkg",
18+
sha256 = "8f9ee2dc10c1ae514ee599a8b42ed99fa262b757058f65ad3c384289ff70c4b8",
1619
urls = [
17-
"https://mirror.bazel.build/github.com/bazelbuild/rules_pkg/releases/download/0.4.0/rules_pkg-0.4.0.tar.gz",
18-
"https://github.com/bazelbuild/rules_pkg/releases/download/0.4.0/rules_pkg-0.4.0.tar.gz",
20+
"https://mirror.bazel.build/github.com/bazelbuild/rules_pkg/releases/download/0.9.1/rules_pkg-0.9.1.tar.gz",
21+
"https://github.com/bazelbuild/rules_pkg/releases/download/0.9.1/rules_pkg-0.9.1.tar.gz",
1922
],
20-
sha256 = "038f1caa773a7e35b3663865ffb003169c6a71dc995e39bf4815792f385d837d",
2123
)
24+
2225
load("@rules_pkg//:deps.bzl", "rules_pkg_dependencies")
26+
2327
rules_pkg_dependencies()
2428

25-
git_repository(
29+
http_archive(
2630
name = "googletest",
27-
remote = "https://github.com/google/googletest",
28-
commit = "703bd9caab50b139428cea1aaff9974ebee5742e",
29-
shallow_since = "1570114335 -0400"
31+
sha256 = "755f9a39bc7205f5a0c428e920ddad092c33c8a1b46997def3f1d4a82aded6e1",
32+
strip_prefix = "googletest-5ab508a01f9eb089207ee87fd547d290da39d015",
33+
urls = ["https://github.com/google/googletest/archive/5ab508a01f9eb089207ee87fd547d290da39d015.zip"],
3034
)
3135

3236
# External dependency for torch_tensorrt if you already have precompiled binaries.
@@ -80,17 +84,13 @@ new_local_repository(
8084
#########################################################################
8185
# Testing Dependencies (optional - comment out on aarch64)
8286
#########################################################################
83-
pip_install(
84-
name = "torch_tensorrt_py_deps",
85-
requirements = "//py:requirements.txt",
86-
)
87+
load("@rules_python//python:pip.bzl", "pip_parse")
8788

88-
pip_install(
89-
name = "py_test_deps",
90-
requirements = "//tests/py:requirements.txt",
89+
pip_parse(
90+
name = "devtools_deps",
91+
requirements_lock = "//:requirements-dev.txt",
9192
)
9293

93-
pip_install(
94-
name = "pylinter_deps",
95-
requirements = "//tools/linter:requirements.txt",
96-
)
94+
load("@devtools_deps//:requirements.bzl", "install_deps")
95+
96+
install_deps()

examples/int8/training/vgg16/requirements.txt

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
tensorboard>=1.14.0
2+
protobuf==3.20.*
23
nvidia-pyindex
34
--extra-index-url https://pypi.ngc.nvidia.com
45
pytorch-quantization>=2.1.2

noxfile.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ def cleanup(session):
191191

192192
def run_base_tests(session):
193193
print("Running basic tests")
194-
session.chdir(os.path.join(TOP_DIR, "tests/py"))
194+
session.chdir(os.path.join(TOP_DIR, "tests/py/ts"))
195195
tests = [
196196
"api",
197197
"integrations/test_to_backend_api.py",
@@ -298,7 +298,7 @@ def run_fx_tools_tests(session):
298298

299299
def run_model_tests(session):
300300
print("Running model tests")
301-
session.chdir(os.path.join(TOP_DIR, "tests/py"))
301+
session.chdir(os.path.join(TOP_DIR, "tests/py/ts"))
302302
tests = [
303303
"models",
304304
]
@@ -311,7 +311,7 @@ def run_model_tests(session):
311311

312312
def run_accuracy_tests(session):
313313
print("Running accuracy tests")
314-
session.chdir(os.path.join(TOP_DIR, "tests/py"))
314+
session.chdir(os.path.join(TOP_DIR, "tests/py/ts"))
315315
tests = []
316316
for test in tests:
317317
if USE_HOST_DEPS:
@@ -340,7 +340,7 @@ def copy_model(session):
340340
def run_int8_accuracy_tests(session):
341341
print("Running accuracy tests")
342342
copy_model(session)
343-
session.chdir(os.path.join(TOP_DIR, "tests/py"))
343+
session.chdir(os.path.join(TOP_DIR, "tests/py/ts"))
344344
tests = [
345345
"ptq/test_ptq_to_backend.py",
346346
"ptq/test_ptq_dataloader_calibrator.py",
@@ -356,7 +356,7 @@ def run_int8_accuracy_tests(session):
356356
def run_trt_compatibility_tests(session):
357357
print("Running TensorRT compatibility tests")
358358
copy_model(session)
359-
session.chdir(os.path.join(TOP_DIR, "tests/py"))
359+
session.chdir(os.path.join(TOP_DIR, "tests/py/ts"))
360360
tests = [
361361
"integrations/test_trt_intercompatibility.py",
362362
# "ptq/test_ptq_trt_calibrator.py",
@@ -370,7 +370,7 @@ def run_trt_compatibility_tests(session):
370370

371371
def run_dla_tests(session):
372372
print("Running DLA tests")
373-
session.chdir(os.path.join(TOP_DIR, "tests/py"))
373+
session.chdir(os.path.join(TOP_DIR, "tests/py/ts"))
374374
tests = [
375375
"hw/test_api_dla.py",
376376
]
@@ -383,7 +383,7 @@ def run_dla_tests(session):
383383

384384
def run_multi_gpu_tests(session):
385385
print("Running multi GPU tests")
386-
session.chdir(os.path.join(TOP_DIR, "tests/py"))
386+
session.chdir(os.path.join(TOP_DIR, "tests/py/ts"))
387387
tests = [
388388
"hw/test_multi_gpu.py",
389389
]

py/torch_tensorrt/__init__.py

+2
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ def _find_lib(name: str, paths: List[str]) -> str:
8585
from torch_tensorrt._Device import Device # noqa: F401
8686
from torch_tensorrt._enums import * # noqa: F403
8787
from torch_tensorrt._Input import Input # noqa: F401
88+
from torch_tensorrt.logging import *
89+
from torch_tensorrt.ptq import *
8890
from torch_tensorrt._utils import * # noqa: F403
8991
from torch_tensorrt._utils import sanitized_torch_version
9092

0 commit comments

Comments
 (0)