Skip to content

Commit 25a04ae

Browse files
peri044narendasan
andauthored
chore: cherry-pick of #2858 (#2861)
Signed-off-by: Naren Dasan <[email protected]> Signed-off-by: Naren Dasan <[email protected]> Co-authored-by: Naren Dasan <[email protected]>
1 parent 6701b20 commit 25a04ae

File tree

4 files changed

+26
-20
lines changed

4 files changed

+26
-20
lines changed

.github/workflows/build-test.yml renamed to .github/workflows/build-test-linux.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build and test linux wheels
1+
name: Build and test Linux wheels
22

33
on:
44
pull_request:
@@ -86,7 +86,7 @@ jobs:
8686
popd
8787
pushd .
8888
cd tests/py/ts
89-
${CONDA_RUN} python -m pip install --pre pytest timm==0.9.16 transformers==4.39.3 parameterized expecttest==0.1.6 --use-deprecated=legacy-resolver
89+
${CONDA_RUN} python -m pip install --pre -r ../requirements.txt
9090
${CONDA_RUN} python -m pytest --junitxml=${RUNNER_TEST_RESULTS_DIR}/ts_api_test_results.xml api/
9191
${CONDA_RUN} python -m pytest --junitxml=${RUNNER_TEST_RESULTS_DIR}/ts_models_test_results.xml models/
9292
${CONDA_RUN} python -m pytest --junitxml=${RUNNER_TEST_RESULTS_DIR}/ts_integrations_test_results.xml integrations/
@@ -116,7 +116,7 @@ jobs:
116116
export USE_HOST_DEPS=1
117117
pushd .
118118
cd tests/py/dynamo
119-
${CONDA_RUN} python -m pip install --pre pytest-xdist timm==0.9.16 transformers==4.39.3 parameterized expecttest==0.1.6 --use-deprecated=legacy-resolver
119+
${CONDA_RUN} python -m pip install --pre -r ../requirements.txt
120120
${CONDA_RUN} python -m pytest --junitxml=${RUNNER_TEST_RESULTS_DIR}/dynamo_converters_test_results.xml -n 10 conversion/
121121
popd
122122
@@ -144,7 +144,7 @@ jobs:
144144
export USE_HOST_DEPS=1
145145
pushd .
146146
cd tests/py/dynamo
147-
${CONDA_RUN} python -m pip install --pre pytest timm==0.9.16 transformers==4.39.3 parameterized expecttest==0.1.6 --use-deprecated=legacy-resolver
147+
${CONDA_RUN} python -m pip install --pre -r ../requirements.txt
148148
${CONDA_RUN} python -m pytest --junitxml=${RUNNER_TEST_RESULTS_DIR}/dynamo_fe_test_results.xml --ir dynamo models/test_models_export.py
149149
${CONDA_RUN} python -m pytest --junitxml=${RUNNER_TEST_RESULTS_DIR}/dyn_models_export.xml --ir dynamo models/test_dyn_models.py
150150
popd
@@ -173,7 +173,7 @@ jobs:
173173
export USE_HOST_DEPS=1
174174
pushd .
175175
cd tests/py/dynamo
176-
${CONDA_RUN} python -m pip install --pre pytest timm==0.9.16 transformers==4.39.3 parameterized expecttest==0.1.6 --use-deprecated=legacy-resolver
176+
${CONDA_RUN} python -m pip install --pre -r ../requirements.txt
177177
${CONDA_RUN} python -m pytest --junitxml=${RUNNER_TEST_RESULTS_DIR}/export_serde_test_results.xml --ir dynamo models/test_export_serde.py
178178
popd
179179
@@ -201,7 +201,7 @@ jobs:
201201
export USE_HOST_DEPS=1
202202
pushd .
203203
cd tests/py/dynamo
204-
${CONDA_RUN} python -m pip install --pre pytest-xdist timm==0.9.16 transformers==4.39.3 parameterized expecttest==0.1.6 --use-deprecated=legacy-resolver
204+
${CONDA_RUN} python -m pip install --pre -r ../requirements.txt
205205
${CONDA_RUN} python -m pytest -n 10 --junitxml=${RUNNER_TEST_RESULTS_DIR}/torch_compile_be_test_results.xml backend/
206206
${CONDA_RUN} python -m pytest -n 4 --junitxml=${RUNNER_TEST_RESULTS_DIR}/torch_comple_be_e2e_test_results.xml --ir torch_compile models/test_models.py
207207
${CONDA_RUN} python -m pytest --junitxml=${RUNNER_TEST_RESULTS_DIR}/torch_compile_dyn_models_export.xml --ir torch_compile models/test_dyn_models.py
@@ -231,7 +231,7 @@ jobs:
231231
export USE_HOST_DEPS=1
232232
pushd .
233233
cd tests/py/dynamo
234-
${CONDA_RUN} python -m pip install --pre pytest-xdist timm==0.9.16 transformers==4.39.3 parameterized expecttest==0.1.6 --use-deprecated=legacy-resolver
234+
${CONDA_RUN} python -m pip install --pre -r ../requirements.txt
235235
${CONDA_RUN} python -m pytest -n 4 --junitxml=${RUNNER_TEST_RESULTS_DIR}/tests_py_dynamo_core_runtime_test_results.xml runtime/
236236
${CONDA_RUN} python -m pytest -n 4 --junitxml=${RUNNER_TEST_RESULTS_DIR}/tests_py_dynamo_core_partitioning_test_results.xml partitioning/
237237
${CONDA_RUN} python -m pytest -n 4 --junitxml=${RUNNER_TEST_RESULTS_DIR}/tests_py_dynamo_core_lowering_test_results.xml lowering/
@@ -260,6 +260,6 @@ jobs:
260260
export USE_HOST_DEPS=1
261261
pushd .
262262
cd tests/py/core
263-
${CONDA_RUN} python -m pip install --pre pytest-xdist timm==0.9.16 transformers==4.39.3 parameterized expecttest==0.1.6 --use-deprecated=legacy-resolver
263+
${CONDA_RUN} python -m pip install --pre -r ../requirements.txt
264264
${CONDA_RUN} python -m pytest -n 4 --junitxml=${RUNNER_TEST_RESULTS_DIR}/tests_py_core_test_results.xml .
265265
popd

.github/workflows/build-test-windows.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ jobs:
7272
export USE_HOST_DEPS=1
7373
pushd .
7474
cd tests/py/dynamo
75-
${CONDA_RUN} python -m pip install --pre pytest-xdist timm==0.9.16 transformers==4.39.3 parameterized expecttest==0.1.6 --use-deprecated=legacy-resolver
75+
${CONDA_RUN} python -m pip install --pre -r ../requirements.txt
7676
${CONDA_RUN} python -m pytest --junitxml=${RUNNER_TEST_RESULTS_DIR}/dynamo_converters_test_results.xml -n 10 conversion/
7777
popd
7878
@@ -98,7 +98,7 @@ jobs:
9898
export USE_HOST_DEPS=1
9999
pushd .
100100
cd tests/py/dynamo
101-
${CONDA_RUN} python -m pip install --pre pytest-xdist timm==0.9.16 transformers==4.39.3 parameterized expecttest==0.1.6 --use-deprecated=legacy-resolver
101+
${CONDA_RUN} python -m pip install --pre -r ../requirements.txt
102102
${CONDA_RUN} python -m pytest --junitxml=${RUNNER_TEST_RESULTS_DIR}/dynamo_fe_test_results.xml --ir dynamo models/test_models_export.py
103103
${CONDA_RUN} python -m pytest --junitxml=${RUNNER_TEST_RESULTS_DIR}/dyn_models_export.xml --ir dynamo models/test_dyn_models.py
104104
popd
@@ -125,7 +125,7 @@ jobs:
125125
export USE_HOST_DEPS=1
126126
pushd .
127127
cd tests/py/dynamo
128-
${CONDA_RUN} python -m pip install --pre pytest-xdist timm==0.9.16 transformers==4.39.3 parameterized expecttest==0.1.6 --use-deprecated=legacy-resolver
128+
${CONDA_RUN} python -m pip install --pre -r ../requirements.txt
129129
${CONDA_RUN} python -m pytest -n 10 --junitxml=${RUNNER_TEST_RESULTS_DIR}/torch_compile_be_test_results.xml backend/
130130
${CONDA_RUN} python -m pytest -n 4 --junitxml=${RUNNER_TEST_RESULTS_DIR}/torch_comple_be_e2e_test_results.xml --ir torch_compile models/test_models.py
131131
popd
@@ -152,7 +152,7 @@ jobs:
152152
export USE_HOST_DEPS=1
153153
pushd .
154154
cd tests/py/dynamo
155-
${CONDA_RUN} python -m pip install --pre pytest-xdist timm==0.9.16 transformers==4.39.3 parameterized expecttest==0.1.6 --use-deprecated=legacy-resolver
155+
${CONDA_RUN} python -m pip install --pre -r ../requirements.txt
156156
${CONDA_RUN} python -m pytest -n 4 --junitxml=${RUNNER_TEST_RESULTS_DIR}/tests_py_dynamo_core_runtime_test_results.xml runtime/
157157
${CONDA_RUN} python -m pytest -n 4 --junitxml=${RUNNER_TEST_RESULTS_DIR}/tests_py_dynamo_core_partitioning_test_results.xml partitioning/
158158
${CONDA_RUN} python -m pytest -n 4 --junitxml=${RUNNER_TEST_RESULTS_DIR}/tests_py_dynamo_core_lowering_test_results.xml lowering/

py/torch_tensorrt/_enums.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -98,21 +98,21 @@ def _from(
9898
f"Provided an unsupported data type as a data type for translation (support: bool, int, long, half, float, bfloat16), got: {t}"
9999
)
100100
elif isinstance(t, trt.DataType):
101-
if t == trt.uint8:
101+
if t == trt.DataType.UINT8:
102102
return dtype.u8
103-
elif t == trt.int8:
103+
elif t == trt.DataType.INT8:
104104
return dtype.i8
105-
elif t == trt.int32:
105+
elif t == trt.DataType.INT32:
106106
return dtype.i32
107-
elif t == trt.int64:
107+
elif t == trt.DataType.INT64:
108108
return dtype.i64
109-
elif t == trt.float16:
109+
elif t == trt.DataType.HALF:
110110
return dtype.f16
111-
elif t == trt.float32:
111+
elif t == trt.DataType.FLOAT:
112112
return dtype.f32
113-
elif t == trt.bool:
113+
elif t == trt.DataType.BOOL:
114114
return dtype.b
115-
elif t == trt.bfloat16:
115+
elif t == trt.DataType.BF16:
116116
return dtype.bf16
117117
else:
118118
raise TypeError(

tests/py/requirements.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
pytest>=8.2.1
2+
pytest-xdist>=3.6.1
3+
timm>=1.0.3
4+
transformers==4.39.3
5+
parameterized>=0.2.0
6+
expecttest==0.1.6

0 commit comments

Comments
 (0)