Skip to content

chore: Update Torch to Jul 3 Nightly #2099

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

Merged
merged 2 commits into from
Jul 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -252,10 +252,10 @@ commands:
parameters:
torch-build:
type: string
default: "2.1.0.dev20230619+cu121"
default: "2.1.0.dev20230703+cu121"
torchvision-build:
type: string
default: "0.16.0.dev20230619+cu121"
default: "0.16.0.dev20230703+cu121"
torch-build-index:
type: string
default: "https://download.pytorch.org/whl/nightly/cu121"
Expand Down Expand Up @@ -1338,10 +1338,10 @@ parameters:
# Nightly platform config
torch-build:
type: string
default: "2.1.0.dev20230619+cu121"
default: "2.1.0.dev20230703+cu121"
torchvision-build:
type: string
default: "0.16.0.dev20230619+cu121"
default: "0.16.0.dev20230703+cu121"
torch-build-index:
type: string
default: "https://download.pytorch.org/whl/nightly/cu121"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ torch.jit.save(trt_ts_module, "trt_torchscript_module.ts") # save the TRT embedd
These are the following dependencies used to verify the testcases. Torch-TensorRT can work with other versions, but the tests are not guaranteed to pass.

- Bazel 5.2.0
- Libtorch 2.1.0.dev20230619 (built with CUDA 12.1)
- Libtorch 2.1.0.dev20230703 (built with CUDA 12.1)
- CUDA 12.1
- cuDNN 8.8.1
- TensorRT 8.6.1
Expand Down
8 changes: 4 additions & 4 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,17 @@ new_local_repository(
http_archive(
name = "libtorch",
build_file = "@//third_party/libtorch:BUILD",
sha256 = "5ba55259b65e071346a2b547b8d1378595f1467a39aaa923fecb09f134f1bcba",
sha256 = "1ae8366aaf7af7f68f142ba644fe26c837c6fa8347ec6bd9ce605ac60e7f7e5e",
strip_prefix = "libtorch",
urls = ["https://download.pytorch.org/libtorch/nightly/cu121/libtorch-cxx11-abi-shared-with-deps-2.1.0.dev20230619%2Bcu121.zip"],
urls = ["https://download.pytorch.org/libtorch/nightly/cu121/libtorch-cxx11-abi-shared-with-deps-2.1.0.dev20230703%2Bcu121.zip"],
)

http_archive(
name = "libtorch_pre_cxx11_abi",
build_file = "@//third_party/libtorch:BUILD",
sha256 = "8f6661bfc11597e77400e9e36cc8dd8e5e385ba82361d630d9ccede8518d7c7e",
sha256 = "9add4832f4da9223866d85810820b816ab3319d5a227066101eeb6cbb76adb4b",
strip_prefix = "libtorch",
urls = ["https://download.pytorch.org/libtorch/nightly/cu121/libtorch-shared-with-deps-2.1.0.dev20230619%2Bcu121.zip"],
urls = ["https://download.pytorch.org/libtorch/nightly/cu121/libtorch-shared-with-deps-2.1.0.dev20230703%2Bcu121.zip"],
)

# Download these tarballs manually from the NVIDIA website
Expand Down
4 changes: 2 additions & 2 deletions py/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ numpy
packaging
pybind11==2.6.2
--extra-index-url https://download.pytorch.org/whl/nightly/cu121
torch==2.1.0.dev20230619+cu121
torchvision==0.16.0.dev20230619+cu121
torch==2.1.0.dev20230703+cu121
torchvision==0.16.0.dev20230703+cu121
--extra-index-url https://pypi.ngc.nvidia.com
tensorrt==8.6.1
4 changes: 0 additions & 4 deletions py/torch_tensorrt/dynamo/backend/lowering/_decompositions.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,8 @@ def inplace_op(*args, **kwargs):
replace_inplace_op(aten.addmv_, aten.addmv)
replace_inplace_op(aten.baddbmm_, aten.baddbmm)
replace_inplace_op(aten.cumprod_, aten.cumprod)
replace_inplace_op(aten.fill_, aten.fill)
replace_inplace_op(aten.gelu_, aten.gelu)
Copy link
Collaborator

Choose a reason for hiding this comment

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

are these being dropped for a specific reason?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, torch's default aten decompositions are now including these, which was causing failures (duplicate decomposition registrations).

replace_inplace_op(aten.hardsigmoid_, aten.hardsigmoid)
replace_inplace_op(aten.index_put_, aten.index_put)
replace_inplace_op(aten.index_reduce_, aten.index_reduce)
replace_inplace_op(aten.logit_, aten.logit)
replace_inplace_op(aten.relu_, aten.relu)
replace_inplace_op(aten.round_, aten.round)
replace_inplace_op(aten.scatter_, aten.scatter)
Expand Down
10 changes: 5 additions & 5 deletions py/torch_tensorrt/fx/test/passes/test_fix_reshape_batch_dim.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ def forward(self, x, y):

expected_graph = r"""
graph():
%x : [#users=0] = placeholder[target=x]
%y : [#users=2] = placeholder[target=y]
%size : [#users=1] = call_function[target=torch_tensorrt.fx.tracer.acc_tracer.acc_ops.size](args = (), kwargs = {input: %y})
%getitem_1 : [#users=1] = call_function[target=torch_tensorrt.fx.tracer.acc_tracer.acc_ops.getitem](args = (), kwargs = {idx: 0, input: %size})
%reshape : [#users=1] = call_function[target=torch_tensorrt.fx.tracer.acc_tracer.acc_ops.reshape](args = (), kwargs = {input: %y, acc_out_ty: ((%getitem_1, -1, 3), None, None, None, None, None, None)})
%x : [num_users=0] = placeholder[target=x]
%y : [num_users=2] = placeholder[target=y]
%size : [num_users=1] = call_function[target=torch_tensorrt.fx.tracer.acc_tracer.acc_ops.size](args = (), kwargs = {input: %y})
%getitem_1 : [num_users=1] = call_function[target=torch_tensorrt.fx.tracer.acc_tracer.acc_ops.getitem](args = (), kwargs = {idx: 0, input: %size})
%reshape : [num_users=1] = call_function[target=torch_tensorrt.fx.tracer.acc_tracer.acc_ops.reshape](args = (), kwargs = {input: %y, acc_out_ty: ((%getitem_1, -1, 3), None, None, None, None, None, None)})
return reshape
"""
assert (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ def is_leaf_module(self, m, qn):
ttop_graph_actual = str(ttop.graph).strip()
ttop_graph_expected = """
graph():
%x : [#users=1] = placeholder[target=x]
%a : [#users=2] = call_module[target=a](args = (%x,), kwargs = {})
%getitem : [#users=1] = call_function[target=operator.getitem](args = (%a, 0), kwargs = {})
%getitem_1 : [#users=1] = call_function[target=operator.getitem](args = (%a, 0), kwargs = {})
%add : [#users=1] = call_function[target=operator.add](args = (%getitem, %getitem_1), kwargs = {})
%x : [num_users=1] = placeholder[target=x]
%a : [num_users=2] = call_module[target=a](args = (%x,), kwargs = {})
%getitem : [num_users=1] = call_function[target=operator.getitem](args = (%a, 0), kwargs = {})
%getitem_1 : [num_users=1] = call_function[target=operator.getitem](args = (%a, 0), kwargs = {})
%add : [num_users=1] = call_function[target=operator.add](args = (%getitem, %getitem_1), kwargs = {})
return add
""".strip()
assert (
Expand All @@ -61,7 +61,7 @@ def is_leaf_module(self, m, qn):
ttop_a_graph_actual = str(ttop.a.graph).strip()
ttop_a_graph_expected = """
graph():
%x : [#users=1] = placeholder[target=x]
%x : [num_users=1] = placeholder[target=x]
return (x,)
""".strip()
assert (
Expand Down
8 changes: 4 additions & 4 deletions toolchains/ci_workspaces/WORKSPACE.x86_64.release.rhel
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,17 @@ new_local_repository(
http_archive(
name = "libtorch",
build_file = "@//third_party/libtorch:BUILD",
sha256 = "5ba55259b65e071346a2b547b8d1378595f1467a39aaa923fecb09f134f1bcba",
sha256 = "1ae8366aaf7af7f68f142ba644fe26c837c6fa8347ec6bd9ce605ac60e7f7e5e",
strip_prefix = "libtorch",
urls = ["https://download.pytorch.org/libtorch/nightly/cu121/libtorch-cxx11-abi-shared-with-deps-2.1.0.dev20230619%2Bcu121.zip"],
urls = ["https://download.pytorch.org/libtorch/nightly/cu121/libtorch-cxx11-abi-shared-with-deps-2.1.0.dev20230703%2Bcu121.zip"],
)

http_archive(
name = "libtorch_pre_cxx11_abi",
build_file = "@//third_party/libtorch:BUILD",
sha256 = "8f6661bfc11597e77400e9e36cc8dd8e5e385ba82361d630d9ccede8518d7c7e",
sha256 = "9add4832f4da9223866d85810820b816ab3319d5a227066101eeb6cbb76adb4b",
strip_prefix = "libtorch",
urls = ["https://download.pytorch.org/libtorch/nightly/cu121/libtorch-shared-with-deps-2.1.0.dev20230619%2Bcu121.zip"],
urls = ["https://download.pytorch.org/libtorch/nightly/cu121/libtorch-shared-with-deps-2.1.0.dev20230703%2Bcu121.zip"],
)

####################################################################################
Expand Down
8 changes: 4 additions & 4 deletions toolchains/ci_workspaces/WORKSPACE.x86_64.release.ubuntu
Original file line number Diff line number Diff line change
Expand Up @@ -56,17 +56,17 @@ new_local_repository(
http_archive(
name = "libtorch",
build_file = "@//third_party/libtorch:BUILD",
sha256 = "5ba55259b65e071346a2b547b8d1378595f1467a39aaa923fecb09f134f1bcba",
sha256 = "1ae8366aaf7af7f68f142ba644fe26c837c6fa8347ec6bd9ce605ac60e7f7e5e",
strip_prefix = "libtorch",
urls = ["https://download.pytorch.org/libtorch/nightly/cu121/libtorch-cxx11-abi-shared-with-deps-2.1.0.dev20230619%2Bcu121.zip"],
urls = ["https://download.pytorch.org/libtorch/nightly/cu121/libtorch-cxx11-abi-shared-with-deps-2.1.0.dev20230703%2Bcu121.zip"],
)

http_archive(
name = "libtorch_pre_cxx11_abi",
build_file = "@//third_party/libtorch:BUILD",
sha256 = "8f6661bfc11597e77400e9e36cc8dd8e5e385ba82361d630d9ccede8518d7c7e",
sha256 = "9add4832f4da9223866d85810820b816ab3319d5a227066101eeb6cbb76adb4b",
strip_prefix = "libtorch",
urls = ["https://download.pytorch.org/libtorch/nightly/cu121/libtorch-shared-with-deps-2.1.0.dev20230619%2Bcu121.zip"],
urls = ["https://download.pytorch.org/libtorch/nightly/cu121/libtorch-shared-with-deps-2.1.0.dev20230703%2Bcu121.zip"],
)

####################################################################################
Expand Down