Skip to content

Commit b29a443

Browse files
authored
[Docker] Update to Torch 1.10.1 (#9781)
* update pytorch to 1.10.1 * fix missing import test only on llvm and cuda * Revert "[Docker][Onnx] Upgrade ONNX to latest version (#9519)" This reverts commit 3f5dca5. * skip testing if target is not enabled
1 parent b35fc83 commit b29a443

File tree

4 files changed

+16
-70
lines changed

4 files changed

+16
-70
lines changed

docker/install/ubuntu_install_onnx.sh

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,13 @@ set -o pipefail
2727
# https://github.com/onnx/onnx/pull/2834). When updating the CI image
2828
# to onnx>=1.9, onnxoptimizer should also be installed.
2929
pip3 install \
30-
onnx==1.10.2 \
31-
onnxruntime==1.9.0 \
32-
onnxoptimizer==0.2.6
33-
30+
onnx==1.8.1 \
31+
onnxruntime==1.7.0
32+
3433
# torch depends on a number of other packages, but unhelpfully, does
3534
# not expose that in the wheel!!!
3635
pip3 install future
3736

3837
pip3 install \
39-
torch==1.7.0 \
40-
torchvision==0.8.1
38+
torch==1.10.1 \
39+
torchvision==0.11.2

python/tvm/relay/frontend/pytorch.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import itertools
2424
import math
2525
import sys
26+
import logging
2627

2728
import numpy as np
2829
import tvm

tests/python/frontend/onnx/test_forward.py

Lines changed: 0 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -4967,38 +4967,11 @@ def verify_eyelike(indata):
49674967
)
49684968

49694969
unsupported_onnx_tests = [
4970-
"test_basic_convinteger",
4971-
"test_batchnorm_epsilon_training_mode",
4972-
"test_batchnorm_example_training_mode",
4973-
"test_bernoulli",
4974-
"test_bernoulli_expanded",
4975-
"test_bernoulli_double",
4976-
"test_bernoulli_double_expanded",
4977-
"test_bernoulli_seed",
4978-
"test_bernoulli_seed_expanded",
49794970
"test_cast_BFLOAT16_to_FLOAT",
49804971
"test_cast_DOUBLE_to_FLOAT16",
49814972
"test_cast_FLOAT_to_BFLOAT16",
49824973
"test_cast_FLOAT_to_STRING",
49834974
"test_cast_STRING_to_FLOAT",
4984-
"test_castlike_BFLOAT16_to_FLOAT",
4985-
"test_castlike_BFLOAT16_to_FLOAT_expanded",
4986-
"test_castlike_DOUBLE_to_FLOAT",
4987-
"test_castlike_DOUBLE_to_FLOAT16",
4988-
"test_castlike_DOUBLE_to_FLOAT16_expanded",
4989-
"test_castlike_FLOAT16_to_DOUBLE",
4990-
"test_castlike_FLOAT16_to_FLOAT",
4991-
"test_castlike_FLOAT_to_BFLOAT16",
4992-
"test_castlike_FLOAT_to_BFLOAT16_expanded",
4993-
"test_castlike_FLOAT_to_DOUBLE",
4994-
"test_castlike_FLOAT_to_FLOAT16",
4995-
"test_castlike_FLOAT_to_STRING",
4996-
"test_castlike_FLOAT_to_STRING_expanded",
4997-
"test_castlike_STRING_to_FLOAT",
4998-
"test_castlike_STRING_to_FLOAT_expanded",
4999-
"test_convinteger_with_padding",
5000-
"test_convinteger_without_padding",
5001-
"test_convtranspose_autopad_same",
50024975
"test_convtranspose_dilations",
50034976
"test_convtranspose_output_shape",
50044977
"test_cumsum_1d",
@@ -5014,13 +4987,9 @@ def verify_eyelike(indata):
50144987
"test_dropout_default_mask",
50154988
"test_dropout_default_mask_ratio",
50164989
"test_dropout_default_ratio",
5017-
"test_gru_batchwise",
5018-
"test_hardswish",
5019-
"test_identity_sequence",
50204990
"test_if_seq",
50214991
"test_loop11",
50224992
"test_loop13_seq",
5023-
"test_lstm_batchwise",
50244993
"test_matmulinteger",
50254994
"test_maxpool_2d_same_lower",
50264995
"test_maxpool_2d_same_upper",
@@ -5030,10 +4999,6 @@ def verify_eyelike(indata):
50304999
"test_mvn",
50315000
# This test fails llvm with a lowering error:
50325001
"test_nllloss_NCd1d2d3_none_no_weight_negative_ii_expanded",
5033-
"test_optional_has_element",
5034-
"test_optional_get_element",
5035-
"test_optional_get_element_sequence",
5036-
"test_optional_has_element_empty",
50375002
"test_qlinearmatmul_3D",
50385003
"test_range_float_type_positive_delta_expanded",
50395004
"test_range_int32_type_negative_delta_expanded",
@@ -5051,13 +5016,6 @@ def verify_eyelike(indata):
50515016
"test_round",
50525017
"test_sequence_insert_at_back",
50535018
"test_sequence_insert_at_front",
5054-
"test_shape_end_1",
5055-
"test_shape_end_negative_1",
5056-
"test_shape_start_1",
5057-
"test_shape_start_1_end_2",
5058-
"test_shape_start_1_end_negative_1",
5059-
"test_shape_start_negative_1",
5060-
"test_simple_rnn_batchwise",
50615019
"test_simple_rnn_defaults",
50625020
"test_simple_rnn_with_initial_bias",
50635021
"test_split_variable_parts_1d",
@@ -5083,24 +5041,6 @@ def verify_eyelike(indata):
50835041
"test_training_dropout_mask",
50845042
"test_training_dropout_zero_ratio",
50855043
"test_training_dropout_zero_ratio_mask",
5086-
"test_tril",
5087-
"test_tril_pos",
5088-
"test_tril_square",
5089-
"test_tril_square_neg",
5090-
"test_tril_neg",
5091-
"test_tril_one_row_neg",
5092-
"test_tril_out_neg",
5093-
"test_tril_out_pos",
5094-
"test_tril_zero",
5095-
"test_triu",
5096-
"test_triu_one_row",
5097-
"test_triu_out_neg_out",
5098-
"test_triu_out_pos",
5099-
"test_triu_neg",
5100-
"test_triu_pos",
5101-
"test_triu_square",
5102-
"test_triu_square_neg",
5103-
"test_triu_zero",
51045044
# These unsqueeze tests work, but take 2+ hrs to run
51055045
"test_unsqueeze_three_axes",
51065046
"test_unsqueeze_two_axes",

tests/python/frontend/pytorch/test_forward.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,10 @@ def verify_model(
212212
compiled_input = dict(zip(input_names, [inp.clone().cpu().numpy() for inp in baseline_input]))
213213

214214
with tvm.transform.PassContext(opt_level=3):
215-
for target, dev in tvm.testing.enabled_targets():
215+
for target in ["llvm", "cuda"]:
216+
if not tvm.runtime.enabled(target):
217+
continue
218+
dev = tvm.device(target, 0)
216219
relay_graph, relay_lib, relay_params = relay.build(mod, target=target, params=params)
217220
relay_model = graph_executor.create(relay_graph, relay_lib, dev)
218221
relay_model.set_input(**relay_params)
@@ -2196,7 +2199,7 @@ def test_3d_models():
21962199

21972200

21982201
def _get_default_vm_targets():
2199-
return [tgt for (tgt, _) in tvm.testing.enabled_targets()]
2202+
return ["llvm", "cuda"]
22002203

22012204

22022205
def verify_script_model(pt_model, ishapes, targets, idtype=None):
@@ -2269,7 +2272,10 @@ def verify_model_vm(input_model, ishapes, idtype=None, idata=None, targets=["llv
22692272
mod, params = relay.frontend.from_pytorch(input_model, input_shapes)
22702273

22712274
for tgt in targets:
2275+
if not tvm.runtime.enabled(tgt):
2276+
continue
22722277
print("Running on target", tgt)
2278+
22732279
dev = tvm.device(tgt, 0)
22742280

22752281
evaluator = relay.create_executor("vm", mod=mod, device=dev, target=tgt).evaluate()
@@ -3897,15 +3903,15 @@ def test_fn(x, mask):
38973903
for shape in [(10,), (3, 4), (16, 32, 64)]:
38983904
x = torch.randn(*shape)
38993905
mask = x.ge(0.5)
3900-
verify_trace_model(test_fn, [x, mask], ["llvm", "cuda", "nvptx"])
3906+
verify_trace_model(test_fn, [x, mask], ["llvm", "cuda"])
39013907

39023908

39033909
def test_unique():
39043910
def test_fn(is_sorted, return_inverse, return_counts):
39053911
return lambda x: torch.unique(x, is_sorted, return_inverse, return_counts)
39063912

39073913
in_data = torch.randint(0, 20, (10,), dtype=torch.int32)
3908-
targets = ["llvm", "cuda", "nvptx"]
3914+
targets = ["llvm", "cuda"]
39093915
verify_trace_model(test_fn(True, True, True), [in_data], targets)
39103916
verify_trace_model(test_fn(True, False, True), [in_data], targets)
39113917
verify_trace_model(test_fn(True, True, False), [in_data], targets)

0 commit comments

Comments
 (0)