Skip to content

Commit e6a2dd5

Browse files
author
pytorchbot
committed
2025-12-17 nightly release (44ff337)
1 parent 7600343 commit e6a2dd5

15 files changed

+317
-380
lines changed

.github/workflows/cpp_tests.yaml

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,7 @@ jobs:
3737
- name: Update pip
3838
run: python -m pip install --upgrade pip
3939
- name: Install torch dependencies
40-
run: |
41-
# If we're in a release branch or in a PR against a release branch,
42-
# we install the PyTorch RCs from the test channel. Otherwise, e.g. in
43-
# `main` or in PRs against `main`, we install the nightly builds.
44-
# Note that the `test` RCs are
45-
if [[ (${GITHUB_EVENT_NAME} = 'pull_request' && (${GITHUB_BASE_REF} = 'release'*)) || (${GITHUB_REF} = 'refs/heads/release'*) ]]; then
46-
CHANNEL=test
47-
else
48-
CHANNEL=nightly
49-
fi
50-
python -m pip install --pre torch --index-url https://download.pytorch.org/whl/${CHANNEL}/cpu
40+
run: bash packaging/install_pytorch.sh cpu "torch"
5141
- name: Install ffmpeg, pkg-config and pybind11
5242
run: |
5343
conda install "ffmpeg=${{ matrix.ffmpeg-version-for-tests }}" pkg-config pybind11 -c conda-forge

.github/workflows/docs.yaml

Lines changed: 0 additions & 126 deletions
This file was deleted.

.github/workflows/lint.yaml

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -62,16 +62,7 @@ jobs:
6262
run: python -m pip install --upgrade pip
6363
- name: Install dependencies and FFmpeg
6464
run: |
65-
# If we're in a release branch or in a PR against a release branch,
66-
# we install the PyTorch RCs from the test channel. Otherwise, e.g. in
67-
# `main` or in PRs against `main`, we install the nightly builds.
68-
# Note that the `test` RCs are
69-
if [[ (${GITHUB_EVENT_NAME} = 'pull_request' && (${GITHUB_BASE_REF} = 'release'*)) || (${GITHUB_REF} = 'refs/heads/release'*) ]]; then
70-
CHANNEL=test
71-
else
72-
CHANNEL=nightly
73-
fi
74-
python -m pip install --pre torch torchvision --index-url https://download.pytorch.org/whl/${CHANNEL}/cpu
65+
bash packaging/install_pytorch.sh cpu "torch torchvision"
7566
conda install "ffmpeg=7.0.1" pkg-config pybind11 -c conda-forge
7667
ffmpeg -version
7768
- name: Build and install torchcodec

.github/workflows/linux_cuda_aarch64_wheel.yaml

Lines changed: 16 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,12 @@ jobs:
7070
ffmpeg-version-for-tests: ['4.4.2', '5.1.2', '6.1.1', '7.0.1', '8.0']
7171
needs: build
7272
steps:
73-
- uses: actions/download-artifact@v4
74-
with:
75-
name: meta-pytorch_torchcodec__${{ matrix.python-version }}_cu${{ env.cuda_version_without_periods }}_aarch64
76-
path: pytorch/torchcodec/dist/
73+
- name: Check out repo
74+
uses: actions/checkout@v3
75+
76+
- name: Remove src/ folder
77+
run: bash packaging/remove_src.sh
78+
7779
- name: Setup conda env
7880
uses: conda-incubator/setup-miniconda@v3
7981
with:
@@ -88,57 +90,23 @@ jobs:
8890
- name: Update pip
8991
run: python -m pip install --upgrade pip
9092
- name: Install PyTorch
91-
run: |
92-
# If we're in a release branch or in a PR against a release branch,
93-
# we install the PyTorch RCs from the test channel. Otherwise, e.g. in
94-
# `main` or in PRs against `main`, we install the nightly builds.
95-
# Note that the `test` RCs are
96-
if [[ (${GITHUB_EVENT_NAME} = 'pull_request' && (${GITHUB_BASE_REF} = 'release'*)) || (${GITHUB_REF} = 'refs/heads/release'*) ]]; then
97-
CHANNEL=test
98-
else
99-
CHANNEL=nightly
100-
fi
101-
${CONDA_RUN} python -m pip install --pre torch torchvision --index-url https://download.pytorch.org/whl/${CHANNEL}/cu${{ env.cuda_version_without_periods }}
93+
run: ${CONDA_RUN} bash packaging/install_pytorch.sh cu${{ env.cuda_version_without_periods }} "torch torchvision"
94+
95+
- uses: actions/download-artifact@v4
96+
with:
97+
name: meta-pytorch_torchcodec__${{ matrix.python-version }}_cu${{ env.cuda_version_without_periods }}_aarch64
98+
path: dist/
99+
102100
- name: Install torchcodec from the wheel
103-
run: |
104-
wheel_path=`find pytorch/torchcodec/dist -type f -name "*.whl"`
105-
echo Installing $wheel_path
106-
python -m pip install $wheel_path -vvv
101+
run: bash packaging/install_torchcodec_wheel.sh
107102

108-
- name: Check out repo
109-
uses: actions/checkout@v3
110103
- name: Install ffmpeg, post build
111104
run: |
112-
# Ideally we would have checked for that before installing the wheel,
113-
# but we need to checkout the repo to access this file, and we don't
114-
# want to checkout the repo before installing the wheel to avoid any
115-
# side-effect. It's OK.
116-
source packaging/helpers.sh
117-
assert_ffmpeg_not_installed
118-
119-
conda install "ffmpeg=${{ matrix.ffmpeg-version-for-tests }}" -c conda-forge
120-
ffmpeg -version
105+
bash packaging/install_ffmpeg.sh ${{ matrix.ffmpeg-version-for-tests }}
121106
echo LD_LIBRARY_PATH=$CONDA_PREFIX/lib:/usr/local/cuda/lib64/:${LD_LIBRARY_PATH} >> $GITHUB_ENV
122107
123108
- name: Install test dependencies
124-
run: |
125-
# Ideally we would find a way to get those dependencies from pyproject.toml
126-
python -m pip install numpy pytest pillow
127-
128-
- name: Delete the src/ folder just for fun
129-
run: |
130-
# The only reason we checked-out the repo is to get access to the
131-
# tests. We don't care about the rest. Out of precaution, we delete
132-
# the src/ folder to be extra sure that we're running the code from
133-
# the installed wheel rather than from the source.
134-
# This is just to be extra cautious and very overkill because a)
135-
# there's no way the `torchcodec` package from src/ can be found from
136-
# the PythonPath: the main point of `src/` is precisely to protect
137-
# against that and b) if we ever were to execute code from
138-
# `src/torchcodec`, it would fail loudly because the built .so files
139-
# aren't present there.
140-
rm -r src/
141-
ls
109+
run: bash packaging/install_test_dependencies.sh
142110
- name: Run Python tests
143111
run: |
144112
pytest --override-ini="addopts=-v" test

.github/workflows/linux_cuda_wheel.yaml

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

33
on:
44
pull_request:
@@ -84,10 +84,13 @@ jobs:
8484
echo cuda_version_without_periods=${cuda_version_without_periods} >> $GITHUB_ENV
8585
python_version_without_periods=$(echo "${{ matrix.python-version }}" | sed 's/\.//g')
8686
echo python_version_without_periods=${python_version_without_periods} >> $GITHUB_ENV
87-
- uses: actions/download-artifact@v4
88-
with:
89-
name: meta-pytorch_torchcodec__${{ matrix.python-version }}_cu${{ env.cuda_version_without_periods }}_x86_64
90-
path: pytorch/torchcodec/dist/
87+
88+
- name: Check out repo
89+
uses: actions/checkout@v3
90+
91+
- name: Remove src/ folder
92+
run: bash packaging/remove_src.sh
93+
9194
- name: Setup miniconda using test-infra
9295
uses: pytorch/test-infra/.github/actions/setup-miniconda@main
9396
with:
@@ -109,49 +112,90 @@ jobs:
109112
run: ${CONDA_RUN} python -m pip install --upgrade pip
110113
- name: Install PyTorch
111114
run: |
112-
# If we're in a release branch or in a PR against a release branch,
113-
# we install the PyTorch RCs from the test channel. Otherwise, e.g. in
114-
# `main` or in PRs against `main`, we install the nightly builds.
115-
# Note that the `test` RCs are
116-
if [[ (${GITHUB_EVENT_NAME} = 'pull_request' && (${GITHUB_BASE_REF} = 'release'*)) || (${GITHUB_REF} = 'refs/heads/release'*) ]]; then
117-
CHANNEL=test
118-
else
119-
CHANNEL=nightly
120-
fi
121-
122-
${CONDA_RUN} python -m pip install --pre torch torchvision --index-url https://download.pytorch.org/whl/${CHANNEL}/cu${{ env.cuda_version_without_periods }}
115+
${CONDA_RUN} bash packaging/install_pytorch.sh cu${{ env.cuda_version_without_periods }} "torch torchvision"
123116
${CONDA_RUN} python -c 'import torch; print(f"{torch.__version__}"); print(f"{torch.__file__}"); print(f"{torch.cuda.is_available()=}")'
117+
118+
- uses: actions/download-artifact@v4
119+
with:
120+
name: meta-pytorch_torchcodec__${{ matrix.python-version }}_cu${{ env.cuda_version_without_periods }}_x86_64
121+
path: dist/
122+
124123
- name: Install torchcodec from the wheel
124+
run: ${CONDA_RUN} bash packaging/install_torchcodec_wheel.sh "*cu${{ env.cuda_version_without_periods }}-cp${{ env.python_version_without_periods }}*.whl"
125+
126+
- name: Install test dependencies
127+
run: ${CONDA_RUN} bash packaging/install_test_dependencies.sh
128+
- name: Run Python tests
129+
run: |
130+
${CONDA_RUN} FAIL_WITHOUT_CUDA=1 pytest --override-ini="addopts=-v" test --tb=short
131+
- name: Run Python benchmark
125132
run: |
126-
wheel_path=`find pytorch/torchcodec/dist -type f -name "*cu${{ env.cuda_version_without_periods }}-cp${{ env.python_version_without_periods }}*.whl"`
127-
echo Installing $wheel_path
128-
${CONDA_RUN} python -m pip install $wheel_path -vvv
133+
${CONDA_RUN} time python benchmarks/decoders/gpu_benchmark.py --devices=cuda:0,cpu --resize_devices=none
134+
135+
build-docs:
136+
runs-on: linux.4xlarge.nvidia.gpu
137+
env:
138+
PYTHON_VERSION: '3.10'
139+
CUDA_VERSION: '12.6'
140+
FFMPEG_VERSION: '7'
141+
container:
142+
image: "pytorch/manylinux2_28-builder:cuda12.6" # must be same as env!!
143+
options: "--gpus all -e NVIDIA_DRIVER_CAPABILITIES=video,compute,utility"
144+
needs: build
145+
steps:
146+
- name: Setup env vars
147+
run: |
148+
cuda_version_without_periods=$(echo "${{ env.CUDA_VERSION }}" | sed 's/\.//g')
149+
echo cuda_version_without_periods=${cuda_version_without_periods} >> $GITHUB_ENV
150+
python_version_without_periods=$(echo "${{ env.PYTHON_VERSION }}" | sed 's/\.//g')
151+
echo python_version_without_periods=${python_version_without_periods} >> $GITHUB_ENV
129152
130153
- name: Check out repo
131154
uses: actions/checkout@v3
132155

133-
- name: Install test dependencies
134-
run: |
135-
# Ideally we would find a way to get those dependencies from pyproject.toml
136-
${CONDA_RUN} python -m pip install numpy pytest pillow
156+
- name: Remove src/ folder
157+
run: bash packaging/remove_src.sh
137158

138-
- name: Delete the src/ folder just for fun
159+
- name: Setup miniconda using test-infra
160+
uses: pytorch/test-infra/.github/actions/setup-miniconda@main
161+
with:
162+
python-version: ${{ env.PYTHON_VERSION }}
163+
# We install conda packages at the start because otherwise conda may have conflicts with dependencies.
164+
default-packages: "nvidia/label/cuda-${{ env.CUDA_VERSION }}.0::libnpp nvidia::cuda-nvrtc=${{ env.CUDA_VERSION }} nvidia::cuda-toolkit=${{ env.CUDA_VERSION }} nvidia::cuda-cudart=${{ env.CUDA_VERSION }} nvidia::cuda-driver-dev=${{ env.CUDA_VERSION }} conda-forge::ffmpeg=${{ env.FFMPEG_VERSION }}"
165+
- name: Check env, set LD_LIBRARY_PATH
139166
run: |
140-
# The only reason we checked-out the repo is to get access to the
141-
# tests. We don't care about the rest. Out of precaution, we delete
142-
# the src/ folder to be extra sure that we're running the code from
143-
# the installed wheel rather than from the source.
144-
# This is just to be extra cautious and very overkill because a)
145-
# there's no way the `torchcodec` package from src/ can be found from
146-
# the PythonPath: the main point of `src/` is precisely to protect
147-
# against that and b) if we ever were to execute code from
148-
# `src/torchcodec`, it would fail loudly because the built .so files
149-
# aren't present there.
150-
rm -r src/
151-
ls
152-
- name: Run Python tests
167+
${CONDA_RUN} env
168+
${CONDA_RUN} conda info
169+
${CONDA_RUN} nvidia-smi
170+
${CONDA_RUN} conda list
171+
echo LD_LIBRARY_PATH=$CONDA_PREFIX/lib:/usr/local/cuda/lib64/:${LD_LIBRARY_PATH} >> $GITHUB_ENV
172+
- name: Assert ffmpeg exists
153173
run: |
154-
${CONDA_RUN} FAIL_WITHOUT_CUDA=1 pytest --override-ini="addopts=-v" test --tb=short
155-
- name: Run Python benchmark
174+
${CONDA_RUN} ffmpeg -buildconf
175+
- name: Update pip
176+
run: ${CONDA_RUN} python -m pip install --upgrade pip
177+
- name: Install PyTorch
156178
run: |
157-
${CONDA_RUN} time python benchmarks/decoders/gpu_benchmark.py --devices=cuda:0,cpu --resize_devices=none
179+
${CONDA_RUN} bash packaging/install_pytorch.sh cu${{ env.cuda_version_without_periods }} "torch torchvision"
180+
${CONDA_RUN} python -c 'import torch; print(f"{torch.__version__}"); print(f"{torch.__file__}"); print(f"{torch.cuda.is_available()=}")'
181+
182+
- uses: actions/download-artifact@v4
183+
with:
184+
name: meta-pytorch_torchcodec__${{ env.PYTHON_VERSION }}_cu${{ env.cuda_version_without_periods }}_x86_64
185+
path: dist/
186+
187+
- name: Install torchcodec from the wheel
188+
run: ${CONDA_RUN} bash packaging/install_torchcodec_wheel.sh "*cu${{ env.cuda_version_without_periods }}-cp${{ env.python_version_without_periods }}*.whl"
189+
190+
- name: Install doc dependencies
191+
run: |
192+
cd docs
193+
${CONDA_RUN} python -m pip install -r requirements.txt
194+
- name: Build docs
195+
run: |
196+
cd docs
197+
${CONDA_RUN} make html
198+
- uses: actions/upload-artifact@v4
199+
with:
200+
name: Built-Docs
201+
path: docs/build/html/

0 commit comments

Comments
 (0)