Skip to content

Test Only: Windows Build failure issue #3072

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

Closed
wants to merge 15 commits into from
Closed
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
11 changes: 10 additions & 1 deletion .github/scripts/install-torch-tensorrt.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,24 @@
set -eou pipefail
set -euxo pipefail

TORCH_TORCHVISION=$(grep "^torch" ${PWD}/py/requirements.txt)
INDEX_URL=https://download.pytorch.org/whl/${CHANNEL}/${CU_VERSION}
PLATFORM=$(python -c "import sys; print(sys.platform)")

echo "PLATFORM=${PLATFORM}"
# Install all the dependencies required for Torch-TensorRT
pip install --pre ${TORCH_TORCHVISION} --index-url ${INDEX_URL}
pip install --pre -r ${PWD}/tests/py/requirements.txt --use-deprecated legacy-resolver

export CUDA_HOME="$(echo ${CUDA_PATH} | sed -e 's#\\#\/#g')"
export TORCH_INSTALL_PATH="$(python -c "import torch, os; print(os.path.dirname(torch.__file__))" | sed -e 's#\\#\/#g')"

cat ${PWD}/toolchains/ci_workspaces/MODULE.bazel.tmpl | envsubst > ${PWD}/MODULE.bazel

cat ${PWD}/MODULE.bazel

# Install Torch-TensorRT
if [[ ${PLATFORM} == win32 ]]; then
ls -lart ${RUNNER_ARTIFACT_DIR}
pip install ${RUNNER_ARTIFACT_DIR}/torch_tensorrt*.whl
else
pip install /opt/torch-tensorrt-builds/torch_tensorrt*.whl
Expand Down
160 changes: 0 additions & 160 deletions .github/workflows/build-test-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,37 +63,6 @@ jobs:
package-name: ${{ matrix.package-name }}
trigger-event: ${{ github.event_name }}

tests-py-torchscript-fe:
name: Test torchscript frontend [Python]
needs: [generate-matrix, build]
strategy:
fail-fast: false
matrix:
include:
- repository: pytorch/tensorrt
package-name: torch_tensorrt
uses: ./.github/workflows/windows-test.yml
with:
job-name: tests-py-torchscript-fe
repository: ${{ matrix.repository }}
ref: ""
test-infra-repository: pytorch/test-infra
test-infra-ref: main
build-matrix: ${{ needs.generate-matrix.outputs.matrix }}
pre-script: packaging/driver_upgrade.bat
script: |
export USE_HOST_DEPS=1
pushd .
cd tests/modules
python hub.py
popd
pushd .
cd tests/py/ts
python -m pytest --junitxml=${RUNNER_TEST_RESULTS_DIR}/ts_api_test_results.xml api/
python -m pytest --junitxml=${RUNNER_TEST_RESULTS_DIR}/ts_models_test_results.xml models/
python -m pytest --junitxml=${RUNNER_TEST_RESULTS_DIR}/ts_integrations_test_results.xml integrations/
popd

tests-py-dynamo-converters:
name: Test dynamo converters [Python]
needs: [generate-matrix, build]
Expand All @@ -119,135 +88,6 @@ jobs:
python -m pytest --junitxml=${RUNNER_TEST_RESULTS_DIR}/dynamo_converters_test_results.xml -n 10 conversion/
popd

tests-py-dynamo-fe:
name: Test dynamo frontend [Python]
needs: [generate-matrix, build]
strategy:
fail-fast: false
matrix:
include:
- repository: pytorch/tensorrt
package-name: torch_tensorrt
uses: ./.github/workflows/windows-test.yml
with:
job-name: tests-py-dynamo-fe
repository: ${{ matrix.repository }}
ref: ""
test-infra-repository: pytorch/test-infra
test-infra-ref: main
build-matrix: ${{ needs.generate-matrix.outputs.matrix }}
pre-script: packaging/driver_upgrade.bat
script: |
export USE_HOST_DEPS=1
pushd .
cd tests/py/dynamo
python -m pytest --junitxml=${RUNNER_TEST_RESULTS_DIR}/dyn_models_export.xml --ir dynamo models/
popd

tests-py-dynamo-serde:
name: Test dynamo export serde [Python]
needs: [generate-matrix, build]
strategy:
fail-fast: false
matrix:
include:
- repository: pytorch/tensorrt
package-name: torch_tensorrt
uses: ./.github/workflows/windows-test.yml
with:
job-name: tests-py-dynamo-serde
repository: ${{ matrix.repository }}
ref: ""
test-infra-repository: pytorch/test-infra
test-infra-ref: main
build-matrix: ${{ needs.generate-matrix.outputs.matrix }}
pre-script: packaging/driver_upgrade.bat
script: |
export USE_HOST_DEPS=1
pushd .
cd tests/py/dynamo
python -m pytest --junitxml=${RUNNER_TEST_RESULTS_DIR}/export_serde_test_results.xml --ir dynamo models/test_export_serde.py
popd

tests-py-torch-compile-be:
name: Test torch compile backend [Python]
needs: [generate-matrix, build]
strategy:
fail-fast: false
matrix:
include:
- repository: pytorch/tensorrt
package-name: torch_tensorrt
uses: ./.github/workflows/windows-test.yml
with:
job-name: tests-py-torch-compile-be
repository: ${{ matrix.repository }}
ref: ""
test-infra-repository: pytorch/test-infra
test-infra-ref: main
build-matrix: ${{ needs.generate-matrix.outputs.matrix }}
pre-script: packaging/driver_upgrade.bat
script: |
export USE_HOST_DEPS=1
pushd .
cd tests/py/dynamo
python -m pytest -n 10 --junitxml=${RUNNER_TEST_RESULTS_DIR}/torch_compile_be_test_results.xml backend/
python -m pytest -n 4 --junitxml=${RUNNER_TEST_RESULTS_DIR}/torch_complete_be_e2e_test_results.xml --ir torch_compile models/test_models.py
python -m pytest --junitxml=${RUNNER_TEST_RESULTS_DIR}/torch_compile_dyn_models_export.xml --ir torch_compile models/test_dyn_models.py
popd

tests-py-dynamo-core:
name: Test dynamo core [Python]
needs: [generate-matrix, build]
strategy:
fail-fast: false
matrix:
include:
- repository: pytorch/tensorrt
package-name: torch_tensorrt
uses: ./.github/workflows/windows-test.yml
with:
job-name: tests-py-dynamo-core
repository: ${{ matrix.repository }}
ref: ""
test-infra-repository: pytorch/test-infra
test-infra-ref: main
build-matrix: ${{ needs.generate-matrix.outputs.matrix }}
pre-script: packaging/driver_upgrade.bat
script: |
export USE_HOST_DEPS=1
pushd .
cd tests/py/dynamo
python -m pytest -n 4 --junitxml=${RUNNER_TEST_RESULTS_DIR}/tests_py_dynamo_core_runtime_test_results.xml runtime/
python -m pytest -n 4 --junitxml=${RUNNER_TEST_RESULTS_DIR}/tests_py_dynamo_core_partitioning_test_results.xml partitioning/
python -m pytest -n 4 --junitxml=${RUNNER_TEST_RESULTS_DIR}/tests_py_dynamo_core_lowering_test_results.xml lowering/
popd

tests-py-core:
name: Test core [Python]
needs: [generate-matrix, build]
strategy:
fail-fast: false
matrix:
include:
- repository: pytorch/tensorrt
package-name: torch_tensorrt
uses: ./.github/workflows/windows-test.yml
with:
job-name: tests-py-core
repository: ${{ matrix.repository }}
ref: ""
test-infra-repository: pytorch/test-infra
test-infra-ref: main
build-matrix: ${{ needs.generate-matrix.outputs.matrix }}
pre-script: packaging/driver_upgrade.bat
script: |
export USE_HOST_DEPS=1
pushd .
cd tests/py/core
python -m pytest -n 4 --junitxml=${RUNNER_TEST_RESULTS_DIR}/tests_py_core_test_results.xml .
popd

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref_name }}-${{ inputs.repository }}-${{ github.event_name == 'workflow_dispatch' }}-${{ inputs.job-name }}
cancel-in-progress: true
8 changes: 4 additions & 4 deletions MODULE.bazel.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions packaging/pre_build_script.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

set -x

# Install dependencies
python3 -m pip install pyyaml
yum install -y ninja-build gettext
Expand All @@ -11,4 +13,7 @@ export TORCH_BUILD_NUMBER=$(python -c "import torch, urllib.parse as ul; print(u
export TORCH_INSTALL_PATH=$(python -c "import torch, os; print(os.path.dirname(torch.__file__))")

cat toolchains/ci_workspaces/MODULE.bazel.tmpl | envsubst > MODULE.bazel

cat MODULE.bazel

export CI_BUILD=1
5 changes: 4 additions & 1 deletion packaging/pre_build_script_windows.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set -eou pipefail
set -exou pipefail

pip install -U numpy packaging pyyaml setuptools wheel

Expand All @@ -12,7 +12,10 @@ choco install bazelisk -y
#unzip -o TensorRT.zip -d C:/

export CUDA_HOME="$(echo ${CUDA_PATH} | sed -e 's#\\#\/#g')"
export TORCH_INSTALL_PATH="$(python -c "import torch, os; print(os.path.dirname(torch.__file__))" | sed -e 's#\\#\/#g')"

cat toolchains/ci_workspaces/MODULE.bazel.tmpl | envsubst > MODULE.bazel

cat MODULE.bazel

echo "RELEASE=1" >> ${GITHUB_ENV}
1 change: 1 addition & 0 deletions py/torch_tensorrt/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ def _register_with_torch() -> None:
)
linked_file_full_path = os.path.join(trtorch_dir, linked_file)
linked_file_runtime_full_path = os.path.join(trtorch_dir, linked_file_runtime)
print(f"lan added {linked_file_full_path=}")

if os.path.isfile(linked_file_full_path):
assert ENABLED_FEATURES.torchscript_frontend
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ def build_libtorchtrt_pre_cxx11_abi(
cmd.append("--platforms=//toolchains:ci_rhel_x86_64_linux")
print("CI based build")

print("building libtorchtrt")
print(f"lan added building libtorchtrt {cmd=}")
status_code = subprocess.run(cmd).returncode

if status_code != 0:
Expand Down Expand Up @@ -250,6 +250,7 @@ def copy_libtorchtrt(multilinux=False, rt_only=False):
dir_path + "/../bazel-bin/cpp/lib/torchtrt.dll.if.lib",
dir_path + "/torch_tensorrt/lib/torchtrt.lib",
)
print(f"lan added {dir_path=}")
elif multilinux:
copyfile(
dir_path + "/build/libtrtorch_build/libtrtorch.so",
Expand Down
48 changes: 17 additions & 31 deletions toolchains/ci_workspaces/MODULE.bazel.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -53,27 +53,6 @@ http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "ht
# Tarballs and fetched dependencies (default - use in cases when building from precompiled bin and tarballs)
#############################################################################################################

http_archive(
name = "libtorch",
build_file = "@//third_party/libtorch:BUILD",
strip_prefix = "libtorch",
urls = ["https://download.pytorch.org/libtorch/${CHANNEL}/${CU_VERSION}/libtorch-cxx11-abi-shared-with-deps-latest.zip"],
)

http_archive(
name = "libtorch_pre_cxx11_abi",
build_file = "@//third_party/libtorch:BUILD",
strip_prefix = "libtorch",
urls = ["https://download.pytorch.org/libtorch/${CHANNEL}/${CU_VERSION}/libtorch-shared-with-deps-latest.zip"],
)

http_archive(
name = "libtorch_win",
build_file = "@//third_party/libtorch:BUILD",
strip_prefix = "libtorch",
urls = ["https://download.pytorch.org/libtorch/${CHANNEL}/${CU_VERSION}/libtorch-win-shared-with-deps-latest.zip"],
)

# Download these tarballs manually from the NVIDIA website
# Either place them in the distdir directory in third_party and use the --distdir flag
# or modify the urls to "file:///<PATH TO TARBALL>/<TARBALL NAME>.tar.gz
Expand Down Expand Up @@ -110,17 +89,24 @@ http_archive(
# x86_64 python distribution. If using NVIDIA's version just point to the root of the package
# for both versions here and do not use --config=pre-cxx11-abi

#new_local_repository(
# name = "libtorch",
# path = "${TORCH_INSTALL_PATH}",
# build_file = "third_party/libtorch/BUILD"
#)
new_local_repository(
name = "libtorch_win",
path = "${TORCH_INSTALL_PATH}",
build_file = "third_party/libtorch/BUILD"
)

new_local_repository(
name = "libtorch",
path = "${TORCH_INSTALL_PATH}",
build_file = "third_party/libtorch/BUILD"
)

new_local_repository(
name = "libtorch_pre_cxx11_abi",
path = "${TORCH_INSTALL_PATH}",
build_file = "third_party/libtorch/BUILD"
)

#new_local_repository(
# name = "libtorch_pre_cxx11_abi",
# path = "${TORCH_INSTALL_PATH}",
# build_file = "third_party/libtorch/BUILD"
#

#new_local_repository(
# name = "tensorrt",
Expand Down
Loading