Skip to content

Commit 03a75b1

Browse files
committed
chore: fix the docgen job
Signed-off-by: Naren Dasan <[email protected]> Signed-off-by: Naren Dasan <[email protected]>
1 parent aa1c843 commit 03a75b1

File tree

3 files changed

+125
-51
lines changed

3 files changed

+125
-51
lines changed

.github/workflows/docgen.yml

Lines changed: 9 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -12,75 +12,33 @@ jobs:
1212
build-docs:
1313
runs-on: ubuntu-20.04
1414
container:
15-
image: ghcr.io/pytorch/tensorrt/docgen:latest
15+
image: docker.io/pytorch/manylinux-builder:cuda12.1
1616
credentials:
1717
username: ${{ github.actor }}
1818
password: ${{ secrets.GITHUB_TOKEN }}
1919
steps:
20-
- name: Reclaim space
21-
run: |
22-
rm -rf /usr/share/dotnet
23-
rm -rf /opt/ghc
24-
rm -rf "/usr/local/share/boost"
25-
rm -rf /usr/local/cuda/cuda-*
26-
- name: Install base deps
27-
run: |
28-
apt update
29-
DEBIAN_FRONTEND=noninteractive apt install -y software-properties-common gcc git curl wget make zlib1g-dev bzip2 libbz2-dev lzma lzma-dev libreadline-dev libsqlite3-dev libssl-dev libffi-dev doxygen pandoc
30-
git config --global --add safe.directory '*'
31-
- name: Set up Python 3.10.12
32-
uses: actions/setup-python@v4
33-
with:
34-
python-version: 3.10.12
3520
- uses: actions/checkout@v3
3621
with:
3722
ref: ${{github.head_ref}}
23+
- name: Install base deps
24+
run: |
25+
./packaging/pre_build_script.sh
3826
- name: Get HEAD SHA
3927
id: vars
4028
run: echo "sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
4129
- name: Get Bazel version
4230
id: bazel_info
4331
run: echo "version=$(cat .bazelversion)" >> $GITHUB_OUTPUT
44-
- name: Install Bazel
45-
run: |
46-
wget -q https://github.com/bazelbuild/bazel/releases/download/${{ steps.bazel_info.outputs.version }}/bazel-${{ steps.bazel_info.outputs.version }}-linux-x86_64 -O /usr/bin/bazel
47-
chmod a+x /usr/bin/bazel
48-
- name: Install cudnn + tensorrt
49-
run: |
50-
apt-get update
51-
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-ubuntu2004.pin
52-
mv cuda-ubuntu2004.pin /etc/apt/preferences.d/cuda-repository-pin-600
53-
apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/7fa2af80.pub
54-
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 536F8F1DE80F6A35
55-
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys A4B469963BF863CC
56-
add-apt-repository "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/ /"
57-
apt-get update
58-
apt-get install -y libcudnn8 libcudnn8-dev
59-
60-
apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/3bf863cc.pub
61-
add-apt-repository "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/ /"
62-
apt-get update
63-
64-
apt-get install -y libnvinfer8 libnvinfer-plugin8 libnvinfer-dev libnvinfer-plugin-dev
65-
- name: Install Torch
66-
run: |
67-
python3 -m pip install -r py/requirements.txt --user
6832
- name: Build Python Package
6933
run: |
70-
cp toolchains/ci_workspaces/WORKSPACE.x86_64 WORKSPACE
71-
cd py
72-
python3 -m pip install pip==21.3.1
73-
echo $(which python3)
74-
echo $(python3 -c 'import site; print(site.getsitepackages()[0])')
75-
mkdir -p /opt/circleci/.pyenv/versions/3.9.4/lib/python3.9/
76-
ln -s $(python3 -c 'import site; print(site.getsitepackages()[0])') /opt/circleci/.pyenv/versions/3.9.4/lib/python3.9/site-packages
77-
python3 setup.py install
78-
cd ..
34+
cp toolchains/ci_workspaces/WORKSPACE.x86_64.cu121.release.rhel WORKSPACE
35+
python -m pip install pip<=23
36+
python -m pip install --pre -e . --extra-index-url https://download.pytorch.org/whl/nightly/cu121
7937
- name: Generate New Docs
8038
run: |
8139
cd docsrc
82-
python3 -m pip install -r requirements.txt
83-
python3 -c "import torch_tensorrt; print(torch_tensorrt.__version__)"
40+
python -m pip install -r requirements.txt
41+
python -c "import torch_tensorrt; print(torch_tensorrt.__version__)"
8442
make html
8543
cd ..
8644
- uses: stefanzweifel/git-auto-commit-action@v4

packaging/pre_build_script.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
3+
# Install dependencies
4+
TRT_VERSION=$(python3 -c "import versions; versions.tensorrt_version()")
5+
yum-config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/rhel7/x86_64/cuda-rhel7.repo
6+
yum check-update
7+
yum install -y ninja-build tensorrt-${TRT_VERSION}.*
8+
wget https://github.com/bazelbuild/bazelisk/releases/download/v1.17.0/bazelisk-linux-amd64 \
9+
&& mv bazelisk-linux-amd64 /usr/bin/bazel \
10+
&& chmod +x /usr/bin/bazel
11+
12+
cp toolchains/ci_workspaces/WORKSPACE.x86_64.${VERSION_SUFFIX#*+}.release.rhel WORKSPACE
13+
export CI_BUILD=1
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
workspace(name = "Torch-TensorRT")
2+
3+
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
4+
5+
http_archive(
6+
name = "rules_python",
7+
sha256 = "863ba0fa944319f7e3d695711427d9ad80ba92c6edd0b7c7443b84e904689539",
8+
strip_prefix = "rules_python-0.22.0",
9+
url = "https://github.com/bazelbuild/rules_python/releases/download/0.22.0/rules_python-0.22.0.tar.gz",
10+
)
11+
12+
load("@rules_python//python:repositories.bzl", "py_repositories")
13+
14+
py_repositories()
15+
16+
http_archive(
17+
name = "rules_pkg",
18+
sha256 = "8f9ee2dc10c1ae514ee599a8b42ed99fa262b757058f65ad3c384289ff70c4b8",
19+
urls = [
20+
"https://mirror.bazel.build/github.com/bazelbuild/rules_pkg/releases/download/0.9.1/rules_pkg-0.9.1.tar.gz",
21+
"https://github.com/bazelbuild/rules_pkg/releases/download/0.9.1/rules_pkg-0.9.1.tar.gz",
22+
],
23+
)
24+
25+
load("@rules_pkg//:deps.bzl", "rules_pkg_dependencies")
26+
27+
rules_pkg_dependencies()
28+
29+
http_archive(
30+
name = "googletest",
31+
sha256 = "755f9a39bc7205f5a0c428e920ddad092c33c8a1b46997def3f1d4a82aded6e1",
32+
strip_prefix = "googletest-5ab508a01f9eb089207ee87fd547d290da39d015",
33+
urls = ["https://github.com/google/googletest/archive/5ab508a01f9eb089207ee87fd547d290da39d015.zip"],
34+
)
35+
36+
# External dependency for torch_tensorrt if you already have precompiled binaries.
37+
local_repository(
38+
name = "torch_tensorrt",
39+
path = "/opt/circleci/.pyenv/versions/3.10.9/lib/python3.10/site-packages/torch_tensorrt"
40+
)
41+
42+
# CUDA should be installed on the system locally
43+
new_local_repository(
44+
name = "cuda",
45+
build_file = "@//third_party/cuda:BUILD",
46+
path = "/usr/local/cuda-12.1",
47+
)
48+
49+
new_local_repository(
50+
name = "cublas",
51+
build_file = "@//third_party/cublas:BUILD",
52+
path = "/usr",
53+
)
54+
#############################################################################################################
55+
# Tarballs and fetched dependencies (default - use in cases when building from precompiled bin and tarballs)
56+
#############################################################################################################
57+
58+
http_archive(
59+
name = "libtorch",
60+
build_file = "@//third_party/libtorch:BUILD",
61+
sha256 = "174579a7ee2a506d063714160c5fc57da428f7935311ef511c8f19820eb14c86",
62+
strip_prefix = "libtorch",
63+
urls = ["https://download.pytorch.org/libtorch/nightly/cu121/libtorch-cxx11-abi-shared-with-deps-2.1.0.dev20230731%2Bcu121.zip"],
64+
)
65+
66+
http_archive(
67+
name = "libtorch_pre_cxx11_abi",
68+
build_file = "@//third_party/libtorch:BUILD",
69+
sha256 = "532217063c65354d5534211badadc9c370d889cb1c3fdb295c9b3d0f181bc0ba",
70+
strip_prefix = "libtorch",
71+
urls = ["https://download.pytorch.org/libtorch/nightly/cu121/libtorch-shared-with-deps-2.1.0.dev20230731%2Bcu121.zip"],
72+
)
73+
74+
####################################################################################
75+
# Locally installed dependencies (use in cases of custom dependencies or aarch64)
76+
####################################################################################
77+
78+
new_local_repository(
79+
name = "cudnn",
80+
path = "/usr/",
81+
build_file = "@//third_party/cudnn/local:BUILD"
82+
)
83+
84+
new_local_repository(
85+
name = "tensorrt",
86+
path = "/usr/",
87+
build_file = "@//third_party/tensorrt/local:BUILD"
88+
)
89+
90+
# #########################################################################
91+
# # Testing Dependencies (optional - comment out on aarch64)
92+
# #########################################################################
93+
94+
load("@rules_python//python:pip.bzl", "pip_parse")
95+
96+
pip_parse(
97+
name = "devtools_deps",
98+
requirements = "//:requirements-dev.txt",
99+
)
100+
101+
load("@devtools_deps//:requirements.bzl", "install_deps")
102+
103+
install_deps()

0 commit comments

Comments
 (0)