Skip to content

Commit 39f4606

Browse files
committed
.
1 parent 2a106ca commit 39f4606

File tree

2 files changed

+80
-21
lines changed

2 files changed

+80
-21
lines changed

.github/workflows/docs.yaml

Lines changed: 79 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -10,37 +10,96 @@ defaults:
1010
shell: bash -l -eo pipefail {0}
1111

1212
jobs:
13+
generate-matrix:
14+
uses: pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@main
15+
with:
16+
package-type: wheel
17+
os: linux
18+
test-infra-repository: pytorch/test-infra
19+
test-infra-ref: main
20+
with-cpu: disable
21+
with-xpu: disable
22+
with-rocm: disable
23+
with-cuda: enable
24+
build-python-only: "disable"
1325
build:
14-
runs-on: linux.g5.4xlarge.nvidia.gpu
26+
needs: generate-matrix
1527
strategy:
1628
fail-fast: false
29+
name: Build and Upload wheel
30+
uses: pytorch/test-infra/.github/workflows/build_wheels_linux.yml@main
31+
with:
32+
repository: pytorch/torchcodec
33+
ref: ""
34+
test-infra-repository: pytorch/test-infra
35+
test-infra-ref: main
36+
build-matrix: ${{ needs.generate-matrix.outputs.matrix }}
37+
post-script: packaging/post_build_script.sh
38+
smoke-test-script: packaging/fake_smoke_test.py
39+
package-name: torchcodec
40+
trigger-event: ${{ github.event_name }}
41+
build-platform: "python-build-package"
42+
build-command: "BUILD_AGAINST_ALL_FFMPEG_FROM_S3=1 ENABLE_CUDA=1 python -m build --wheel -vvv --no-isolation"
43+
44+
build-docs:
45+
runs-on: linux.4xlarge.nvidia.gpu
46+
strategy:
47+
fail-fast: false
48+
matrix:
49+
# 3.9 corresponds to the minimum python version for which we build
50+
# the wheel unless the label cliflow/binaries/all is present in the
51+
# PR.
52+
# For the actual release we should add that label and change this to
53+
# include more python versions.
54+
python-version: ['3.9']
55+
cuda-version: ['12.4']
56+
ffmpeg-version-for-tests: ['7']
57+
container:
58+
image: "pytorch/manylinux-builder:cuda${{ matrix.cuda-version }}"
59+
options: "--gpus all -e NVIDIA_DRIVER_CAPABILITIES=video,compute,utility"
60+
needs: build
1761
steps:
18-
- name: Check out repo
19-
uses: actions/checkout@v3
20-
- name: Setup conda env
21-
uses: conda-incubator/setup-miniconda@v2
22-
with:
23-
auto-update-conda: true
24-
miniconda-version: "latest"
25-
activate-environment: test
26-
python-version: '3.9'
27-
- name: Update pip
28-
run: python -m pip install --upgrade pip
29-
- name: Download wheel
30-
uses: actions/download-artifact@v3
62+
- name: Setup env vars
63+
run: |
64+
cuda_version_without_periods=$(echo "${{ matrix.cuda-version }}" | sed 's/\.//g')
65+
echo cuda_version_without_periods=${cuda_version_without_periods} >> $GITHUB_ENV
66+
- uses: actions/download-artifact@v3
3167
with:
32-
name: pytorch_torchcodec__3.9_cu124_x86_64
68+
name: pytorch_torchcodec__3.9_cu${{ env.cuda_version_without_periods }}_x86_64
3369
path: pytorch/torchcodec/dist/
70+
- name: Setup miniconda using test-infra
71+
uses: pytorch/test-infra/.github/actions/setup-miniconda@main
72+
with:
73+
python-version: ${{ matrix.python-version }}
74+
#
75+
# For some reason nvidia::libnpp=12.4 doesn't install but nvidia/label/cuda-12.4.0::libnpp does.
76+
# So we use the latter convention for libnpp.
77+
# We install conda packages at the start because otherwise conda may have conflicts with dependencies.
78+
default-packages: "nvidia/label/cuda-${{ matrix.cuda-version }}.0::libnpp nvidia::cuda-nvrtc=${{ matrix.cuda-version }} nvidia::cuda-toolkit=${{ matrix.cuda-version }} nvidia::cuda-cudart=${{ matrix.cuda-version }} nvidia::cuda-driver-dev=${{ matrix.cuda-version }} conda-forge::ffmpeg=${{ matrix.ffmpeg-version-for-tests }}"
79+
- name: Check env
80+
run: |
81+
${CONDA_RUN} env
82+
${CONDA_RUN} conda info
83+
${CONDA_RUN} nvidia-smi
84+
${CONDA_RUN} conda list
85+
- name: Assert ffmpeg exists
86+
run: |
87+
${CONDA_RUN} ffmpeg -buildconf
88+
- name: Update pip
89+
run: ${CONDA_RUN} python -m pip install --upgrade pip
90+
- name: Install PyTorch
91+
run: |
92+
${CONDA_RUN} python -m pip install --pre torch torchvision --index-url https://download.pytorch.org/whl/nightly/cu${{ env.cuda_version_without_periods }}
93+
${CONDA_RUN} python -c 'import torch; print(f"{torch.__version__}"); print(f"{torch.__file__}"); print(f"{torch.cuda.is_available()=}")'
3494
- name: Install torchcodec from the wheel
3595
run: |
3696
wheel_path=`find pytorch/torchcodec/dist -type f -name "*.whl"`
3797
echo Installing $wheel_path
3898
${CONDA_RUN} python -m pip install $wheel_path -vvv
39-
- name: Install FFMPEG and other deps
40-
run: |
41-
conda install cuda-nvrtc=12.4 libnpp -c nvidia
42-
conda install ffmpeg=7 -c conda-forge
43-
ffmpeg -version
99+
100+
- name: Check out repo
101+
uses: actions/checkout@v3
102+
44103
- name: Install doc dependencies
45104
run: |
46105
cd docs

.github/workflows/linux_cuda_wheel.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build and test Linux CUDA wheels
1+
name: linux_cuda_wheel
22

33
on:
44
pull_request:

0 commit comments

Comments
 (0)