Skip to content

Commit

Permalink
chore: rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
peri044 committed May 24, 2024
2 parents 9a3fea1 + 543f436 commit a6377be
Show file tree
Hide file tree
Showing 166 changed files with 1,400 additions and 417 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build and test linux wheels
name: Build and test Linux wheels

on:
pull_request:
Expand Down Expand Up @@ -77,16 +77,13 @@ jobs:
script: |
export USE_HOST_DEPS=1
export LD_LIBRARY_PATH=/usr/lib64:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=/opt/torch-tensorrt-builds/TensorRT-10.0.1.6/lib:$LD_LIBRARY_PATH
pushd .
cd tests/modules
# Don't use requirements.txt here as it contains tensorrt and torch which should have been installed by now.
${CONDA_RUN} python -m pip install numpy packaging pyyaml transformers==4.39.3 timm==0.9.16 pybind11==2.6.2
${CONDA_RUN} python -m pip install --pre -r ../py/requirements.txt
${CONDA_RUN} python hub.py
popd
pushd .
cd tests/py/ts
${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
${CONDA_RUN} python -m pytest --junitxml=${RUNNER_TEST_RESULTS_DIR}/ts_api_test_results.xml api/
${CONDA_RUN} python -m pytest --junitxml=${RUNNER_TEST_RESULTS_DIR}/ts_models_test_results.xml models/
${CONDA_RUN} python -m pytest --junitxml=${RUNNER_TEST_RESULTS_DIR}/ts_integrations_test_results.xml integrations/
Expand Down Expand Up @@ -114,10 +111,9 @@ jobs:
pre-script: ${{ matrix.pre-script }}
script: |
export USE_HOST_DEPS=1
export LD_LIBRARY_PATH=/opt/torch-tensorrt-builds/TensorRT-10.0.1.6/lib:$LD_LIBRARY_PATH
pushd .
cd tests/py/dynamo
${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
${CONDA_RUN} python -m pip install --pre -r ../requirements.txt
${CONDA_RUN} python -m pytest --junitxml=${RUNNER_TEST_RESULTS_DIR}/dynamo_converters_test_results.xml -n 10 conversion/
popd
Expand All @@ -143,10 +139,9 @@ jobs:
pre-script: ${{ matrix.pre-script }}
script: |
export USE_HOST_DEPS=1
export LD_LIBRARY_PATH=/opt/torch-tensorrt-builds/TensorRT-10.0.1.6/lib:$LD_LIBRARY_PATH
pushd .
cd tests/py/dynamo
${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
${CONDA_RUN} python -m pip install --pre -r ../requirements.txt
${CONDA_RUN} python -m pytest --junitxml=${RUNNER_TEST_RESULTS_DIR}/dynamo_fe_test_results.xml --ir dynamo models/test_models_export.py
${CONDA_RUN} python -m pytest --junitxml=${RUNNER_TEST_RESULTS_DIR}/dyn_models_export.xml --ir dynamo models/test_dyn_models.py
popd
Expand All @@ -173,10 +168,9 @@ jobs:
pre-script: ${{ matrix.pre-script }}
script: |
export USE_HOST_DEPS=1
export LD_LIBRARY_PATH=/opt/torch-tensorrt-builds/TensorRT-10.0.1.6/lib:$LD_LIBRARY_PATH
pushd .
cd tests/py/dynamo
${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
${CONDA_RUN} python -m pip install --pre -r ../requirements.txt
${CONDA_RUN} python -m pytest --junitxml=${RUNNER_TEST_RESULTS_DIR}/export_serde_test_results.xml --ir dynamo models/test_export_serde.py
popd
Expand All @@ -202,10 +196,9 @@ jobs:
pre-script: ${{ matrix.pre-script }}
script: |
export USE_HOST_DEPS=1
export LD_LIBRARY_PATH=/opt/torch-tensorrt-builds/TensorRT-10.0.1.6/lib:$LD_LIBRARY_PATH
pushd .
cd tests/py/dynamo
${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
${CONDA_RUN} python -m pip install --pre -r ../requirements.txt
${CONDA_RUN} python -m pytest -n 10 --junitxml=${RUNNER_TEST_RESULTS_DIR}/torch_compile_be_test_results.xml backend/
${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
${CONDA_RUN} python -m pytest --junitxml=${RUNNER_TEST_RESULTS_DIR}/torch_compile_dyn_models_export.xml --ir torch_compile models/test_dyn_models.py
Expand Down Expand Up @@ -233,10 +226,9 @@ jobs:
pre-script: ${{ matrix.pre-script }}
script: |
export USE_HOST_DEPS=1
export LD_LIBRARY_PATH=/opt/torch-tensorrt-builds/TensorRT-10.0.1.6/lib:$LD_LIBRARY_PATH
pushd .
cd tests/py/dynamo
${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
${CONDA_RUN} python -m pip install --pre -r ../requirements.txt
${CONDA_RUN} python -m pytest -n 4 --junitxml=${RUNNER_TEST_RESULTS_DIR}/tests_py_dynamo_core_runtime_test_results.xml runtime/
${CONDA_RUN} python -m pytest -n 4 --junitxml=${RUNNER_TEST_RESULTS_DIR}/tests_py_dynamo_core_partitioning_test_results.xml partitioning/
${CONDA_RUN} python -m pytest -n 4 --junitxml=${RUNNER_TEST_RESULTS_DIR}/tests_py_dynamo_core_lowering_test_results.xml lowering/
Expand All @@ -263,9 +255,8 @@ jobs:
pre-script: ${{ matrix.pre-script }}
script: |
export USE_HOST_DEPS=1
export LD_LIBRARY_PATH=/opt/torch-tensorrt-builds/TensorRT-10.0.1.6/lib:$LD_LIBRARY_PATH
pushd .
cd tests/py/core
${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
${CONDA_RUN} python -m pip install --pre -r ../requirements.txt
${CONDA_RUN} python -m pytest -n 4 --junitxml=${RUNNER_TEST_RESULTS_DIR}/tests_py_core_test_results.xml .
popd
8 changes: 4 additions & 4 deletions .github/workflows/build-test-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:
export USE_HOST_DEPS=1
pushd .
cd tests/py/dynamo
${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
${CONDA_RUN} python -m pip install --pre -r ../requirements.txt
${CONDA_RUN} python -m pytest --junitxml=${RUNNER_TEST_RESULTS_DIR}/dynamo_converters_test_results.xml -n 10 conversion/
popd
Expand All @@ -98,7 +98,7 @@ jobs:
export USE_HOST_DEPS=1
pushd .
cd tests/py/dynamo
${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
${CONDA_RUN} python -m pip install --pre -r ../requirements.txt
${CONDA_RUN} python -m pytest --junitxml=${RUNNER_TEST_RESULTS_DIR}/dynamo_fe_test_results.xml --ir dynamo models/test_models_export.py
${CONDA_RUN} python -m pytest --junitxml=${RUNNER_TEST_RESULTS_DIR}/dyn_models_export.xml --ir dynamo models/test_dyn_models.py
popd
Expand All @@ -125,7 +125,7 @@ jobs:
export USE_HOST_DEPS=1
pushd .
cd tests/py/dynamo
${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
${CONDA_RUN} python -m pip install --pre -r ../requirements.txt
${CONDA_RUN} python -m pytest -n 10 --junitxml=${RUNNER_TEST_RESULTS_DIR}/torch_compile_be_test_results.xml backend/
${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
popd
Expand All @@ -152,7 +152,7 @@ jobs:
export USE_HOST_DEPS=1
pushd .
cd tests/py/dynamo
${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
${CONDA_RUN} python -m pip install --pre -r ../requirements.txt
${CONDA_RUN} python -m pytest -n 4 --junitxml=${RUNNER_TEST_RESULTS_DIR}/tests_py_dynamo_core_runtime_test_results.xml runtime/
${CONDA_RUN} python -m pytest -n 4 --junitxml=${RUNNER_TEST_RESULTS_DIR}/tests_py_dynamo_core_partitioning_test_results.xml partitioning/
${CONDA_RUN} python -m pytest -n 4 --junitxml=${RUNNER_TEST_RESULTS_DIR}/tests_py_dynamo_core_lowering_test_results.xml lowering/
Expand Down
8 changes: 5 additions & 3 deletions core/conversion/converters/impl/conv_deconv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,12 @@ bool add_conv_deconv(ConversionCtx* ctx, const torch::jit::Node* n, args& args)
filter_dim.nbDims = nbSpatialDims;
filter_dim.d[0] = kernel_dims.d[2];
filter_dim.d[1] = kernel_dims.d[3];
// For Conv2d layer, weights are in the shape of (out_channels, in_channels/groups,...)
int32_t num_output_maps = kernel_dims.d[0];
if (transposed) {
// For ConvTranspose layer, weights are in the shape of (in_channels, out_channel/groups,...)
num_output_maps = kernel_dims.d[1];
}
bool expand_dims = nbSpatialDims == 1;
if (expand_dims) {
// In case of Conv1D -> map it to 2D version
Expand All @@ -150,9 +155,6 @@ bool add_conv_deconv(ConversionCtx* ctx, const torch::jit::Node* n, args& args)
LOG_DEBUG("Reshaping input dimensions to: " << in->getDimensions());
kernel = addPadding(ctx, n, kernel, 4, true, true, std::string(util::node_info(n) + "_kernel_shuffle"));
LOG_DEBUG("Reshaping kernel dimensions to: " << kernel->getDimensions());
if (transposed) {
num_output_maps = kernel_dims.d[1];
}
}

// Initialize a dummy constant kernel to pass it to INetwork->addConvolutionNd/addDeconvolutionNd API.
Expand Down
8 changes: 8 additions & 0 deletions core/runtime/runtime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,14 @@ void multi_gpu_device_check() {
}
}

bool get_multi_device_safe_mode() {
return MULTI_DEVICE_SAFE_MODE;
}

void set_multi_device_safe_mode(bool multi_device_safe_mode) {
MULTI_DEVICE_SAFE_MODE = multi_device_safe_mode;
}

namespace {
static DeviceList cuda_device_list;
}
Expand Down
4 changes: 4 additions & 0 deletions core/runtime/runtime.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ std::vector<at::Tensor> execute_engine(std::vector<at::Tensor> inputs, c10::intr

void multi_gpu_device_check();

bool get_multi_device_safe_mode();

void set_multi_device_safe_mode(bool multi_device_safe_mode);

class DeviceList {
using DeviceMap = std::unordered_map<int, RTDevice>;
DeviceMap device_list;
Expand Down
4 changes: 2 additions & 2 deletions docs/_cpp_api/classtorch__tensorrt_1_1DataType.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>Class DataType &mdash; Torch-TensorRT v2.4.0.dev0+de9a063 documentation</title>
<title>Class DataType &mdash; Torch-TensorRT v2.4.0.dev0+7e08872 documentation</title>



Expand Down Expand Up @@ -275,7 +275,7 @@


<div class="version">
v2.4.0.dev0+de9a063
v2.4.0.dev0+7e08872
</div>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>Class Device::DeviceType &mdash; Torch-TensorRT v2.4.0.dev0+de9a063 documentation</title>
<title>Class Device::DeviceType &mdash; Torch-TensorRT v2.4.0.dev0+7e08872 documentation</title>



Expand Down Expand Up @@ -275,7 +275,7 @@


<div class="version">
v2.4.0.dev0+de9a063
v2.4.0.dev0+7e08872
</div>


Expand Down
4 changes: 2 additions & 2 deletions docs/_cpp_api/classtorch__tensorrt_1_1TensorFormat.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>Class TensorFormat &mdash; Torch-TensorRT v2.4.0.dev0+de9a063 documentation</title>
<title>Class TensorFormat &mdash; Torch-TensorRT v2.4.0.dev0+7e08872 documentation</title>



Expand Down Expand Up @@ -275,7 +275,7 @@


<div class="version">
v2.4.0.dev0+de9a063
v2.4.0.dev0+7e08872
</div>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>Template Class Int8CacheCalibrator &mdash; Torch-TensorRT v2.4.0.dev0+de9a063 documentation</title>
<title>Template Class Int8CacheCalibrator &mdash; Torch-TensorRT v2.4.0.dev0+7e08872 documentation</title>



Expand Down Expand Up @@ -275,7 +275,7 @@


<div class="version">
v2.4.0.dev0+de9a063
v2.4.0.dev0+7e08872
</div>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>Template Class Int8Calibrator &mdash; Torch-TensorRT v2.4.0.dev0+de9a063 documentation</title>
<title>Template Class Int8Calibrator &mdash; Torch-TensorRT v2.4.0.dev0+7e08872 documentation</title>



Expand Down Expand Up @@ -275,7 +275,7 @@


<div class="version">
v2.4.0.dev0+de9a063
v2.4.0.dev0+7e08872
</div>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>Define STR &mdash; Torch-TensorRT v2.4.0.dev0+de9a063 documentation</title>
<title>Define STR &mdash; Torch-TensorRT v2.4.0.dev0+7e08872 documentation</title>



Expand Down Expand Up @@ -275,7 +275,7 @@


<div class="version">
v2.4.0.dev0+de9a063
v2.4.0.dev0+7e08872
</div>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>Define TORCH_TENSORRT_PATCH_VERSION &mdash; Torch-TensorRT v2.4.0.dev0+de9a063 documentation</title>
<title>Define TORCH_TENSORRT_PATCH_VERSION &mdash; Torch-TensorRT v2.4.0.dev0+7e08872 documentation</title>



Expand Down Expand Up @@ -275,7 +275,7 @@


<div class="version">
v2.4.0.dev0+de9a063
v2.4.0.dev0+7e08872
</div>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>Define TORCH_TENSORRT_MAJOR_VERSION &mdash; Torch-TensorRT v2.4.0.dev0+de9a063 documentation</title>
<title>Define TORCH_TENSORRT_MAJOR_VERSION &mdash; Torch-TensorRT v2.4.0.dev0+7e08872 documentation</title>



Expand Down Expand Up @@ -275,7 +275,7 @@


<div class="version">
v2.4.0.dev0+de9a063
v2.4.0.dev0+7e08872
</div>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>Define TORCH_TENSORRT_MINOR_VERSION &mdash; Torch-TensorRT v2.4.0.dev0+de9a063 documentation</title>
<title>Define TORCH_TENSORRT_MINOR_VERSION &mdash; Torch-TensorRT v2.4.0.dev0+7e08872 documentation</title>



Expand Down Expand Up @@ -275,7 +275,7 @@


<div class="version">
v2.4.0.dev0+de9a063
v2.4.0.dev0+7e08872
</div>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>Define TORCHTRT_API &mdash; Torch-TensorRT v2.4.0.dev0+de9a063 documentation</title>
<title>Define TORCHTRT_API &mdash; Torch-TensorRT v2.4.0.dev0+7e08872 documentation</title>



Expand Down Expand Up @@ -275,7 +275,7 @@


<div class="version">
v2.4.0.dev0+de9a063
v2.4.0.dev0+7e08872
</div>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>Define XSTR &mdash; Torch-TensorRT v2.4.0.dev0+de9a063 documentation</title>
<title>Define XSTR &mdash; Torch-TensorRT v2.4.0.dev0+7e08872 documentation</title>



Expand Down Expand Up @@ -275,7 +275,7 @@


<div class="version">
v2.4.0.dev0+de9a063
v2.4.0.dev0+7e08872
</div>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>Define TORCHTRT_HIDDEN &mdash; Torch-TensorRT v2.4.0.dev0+de9a063 documentation</title>
<title>Define TORCHTRT_HIDDEN &mdash; Torch-TensorRT v2.4.0.dev0+7e08872 documentation</title>



Expand Down Expand Up @@ -275,7 +275,7 @@


<div class="version">
v2.4.0.dev0+de9a063
v2.4.0.dev0+7e08872
</div>


Expand Down
Loading

0 comments on commit a6377be

Please sign in to comment.