Skip to content

Commit b0d2162

Browse files
committed
Merge branch 'main' of github.com:pytorch/torchcodec into new-theme
2 parents f7c9025 + 75a3325 commit b0d2162

File tree

105 files changed

+10508
-1706
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+10508
-1706
lines changed

.github/workflows/build_ffmpeg.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@ jobs:
2727
strategy:
2828
fail-fast: false
2929
matrix:
30-
ffmpeg-version: ["4.4.4", "5.1.4", "6.1.1", "7.0.1"]
30+
ffmpeg-version: ["4.4.4", "5.1.4", "6.1.1", "7.0.1", "8.0"]
3131
uses: pytorch/test-infra/.github/workflows/linux_job_v2.yml@main
3232
permissions:
3333
id-token: write
3434
contents: read
3535
with:
3636
job-name: Build
3737
upload-artifact: ffmpeg-lgpl-linux_x86_64-${{ matrix.ffmpeg-version }}
38-
repository: pytorch/torchcodec
38+
repository: meta-pytorch/torchcodec
3939
script: |
4040
export FFMPEG_VERSION="${{ matrix.ffmpeg-version }}"
4141
export FFMPEG_ROOT="${PWD}/ffmpeg"
@@ -52,12 +52,12 @@ jobs:
5252
strategy:
5353
fail-fast: false
5454
matrix:
55-
ffmpeg-version: ["4.4.4", "5.1.4", "6.1.1", "7.0.1"]
55+
ffmpeg-version: ["4.4.4", "5.1.4", "6.1.1", "7.0.1", "8.0"]
5656
uses: pytorch/test-infra/.github/workflows/macos_job.yml@main
5757
with:
5858
job-name: Build
5959
upload-artifact: ffmpeg-lgpl-macos-${{ matrix.ffmpeg-version }}
60-
repository: pytorch/torchcodec
60+
repository: meta-pytorch/torchcodec
6161
runner: macos-14-xlarge
6262
script: |
6363
export FFMPEG_VERSION="${{ matrix.ffmpeg-version }}"
@@ -75,12 +75,12 @@ jobs:
7575
strategy:
7676
fail-fast: false
7777
matrix:
78-
ffmpeg-version: ["4.4.4", "5.1.4", "6.1.1", "7.0.1"]
78+
ffmpeg-version: ["4.4.4", "5.1.4", "6.1.1", "7.0.1", "8.0"]
7979
uses: pytorch/test-infra/.github/workflows/windows_job.yml@main
8080
with:
8181
job-name: Build
8282
upload-artifact: ffmpeg-lgpl-windows_x86_64-${{ matrix.ffmpeg-version }}
83-
repository: pytorch/torchcodec
83+
repository: meta-pytorch/torchcodec
8484
script: |
8585
export FFMPEG_VERSION="${{ matrix.ffmpeg-version }}"
8686
export FFMPEG_ROOT="${PWD}/ffmpeg"

.github/workflows/docs.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
name: Build and Upload wheel
3434
uses: pytorch/test-infra/.github/workflows/build_wheels_linux.yml@main
3535
with:
36-
repository: pytorch/torchcodec
36+
repository: meta-pytorch/torchcodec
3737
ref: ""
3838
test-infra-repository: pytorch/test-infra
3939
test-infra-ref: main
@@ -51,10 +51,10 @@ jobs:
5151
strategy:
5252
fail-fast: false
5353
matrix:
54-
# 3.9 corresponds to the minimum python version for which we build
54+
# 3.10 corresponds to the minimum python version for which we build
5555
# the wheel unless the label cliflow/binaries/all is present in the
5656
# PR.
57-
python-version: ['3.9']
57+
python-version: ['3.10']
5858
cuda-version: ['12.6']
5959
ffmpeg-version-for-tests: ['7']
6060
container:
@@ -70,7 +70,7 @@ jobs:
7070
echo python_version_without_periods=${python_version_without_periods} >> $GITHUB_ENV
7171
- uses: actions/download-artifact@v4
7272
with:
73-
name: pytorch_torchcodec__${{ matrix.python-version }}_cu${{ env.cuda_version_without_periods }}_x86_64
73+
name: meta-pytorch_torchcodec__${{ matrix.python-version }}_cu${{ env.cuda_version_without_periods }}_x86_64
7474
path: pytorch/torchcodec/dist/
7575
- name: Setup miniconda using test-infra
7676
uses: pytorch/test-infra/.github/actions/setup-miniconda@main

.github/workflows/linux_cuda_wheel.yaml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
name: Build and Upload wheel
4444
uses: pytorch/test-infra/.github/workflows/build_wheels_linux.yml@main
4545
with:
46-
repository: pytorch/torchcodec
46+
repository: meta-pytorch/torchcodec
4747
ref: ""
4848
test-infra-repository: pytorch/test-infra
4949
test-infra-ref: main
@@ -61,15 +61,17 @@ jobs:
6161
strategy:
6262
fail-fast: false
6363
matrix:
64-
# 3.9 corresponds to the minimum python version for which we build
64+
# 3.10 corresponds to the minimum python version for which we build
6565
# the wheel unless the label cliflow/binaries/all is present in the
6666
# PR.
6767
# For the actual release we should add that label and change this to
6868
# include more python versions.
69-
python-version: ['3.9']
70-
cuda-version: ['12.6', '12.8']
69+
python-version: ['3.10']
70+
# We test against 12.6 and 13.0 to avoid having too big of a CI matrix,
71+
# but for releases we should add 12.8.
72+
cuda-version: ['12.6', '13.0']
7173
# TODO: put back ffmpeg 5 https://github.com/pytorch/torchcodec/issues/325
72-
ffmpeg-version-for-tests: ['4.4.2', '6', '7']
74+
ffmpeg-version-for-tests: ['4.4.2', '6', '7', '8.0']
7375

7476
container:
7577
image: "pytorch/manylinux2_28-builder:cuda${{ matrix.cuda-version }}"
@@ -84,14 +86,15 @@ jobs:
8486
echo python_version_without_periods=${python_version_without_periods} >> $GITHUB_ENV
8587
- uses: actions/download-artifact@v4
8688
with:
87-
name: pytorch_torchcodec__${{ matrix.python-version }}_cu${{ env.cuda_version_without_periods }}_x86_64
89+
name: meta-pytorch_torchcodec__${{ matrix.python-version }}_cu${{ env.cuda_version_without_periods }}_x86_64
8890
path: pytorch/torchcodec/dist/
8991
- name: Setup miniconda using test-infra
9092
uses: pytorch/test-infra/.github/actions/setup-miniconda@main
9193
with:
9294
python-version: ${{ matrix.python-version }}
9395
# We install conda packages at the start because otherwise conda may have conflicts with dependencies.
94-
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 }}"
96+
# Note: xorg-libxau was addded to fix a problem with ffmpeg 4. We should consider removing it.
97+
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 }} conda-forge::xorg-libxau"
9598
- name: Check env
9699
run: |
97100
${CONDA_RUN} env
@@ -137,7 +140,7 @@ jobs:
137140
ls
138141
- name: Run Python tests
139142
run: |
140-
${CONDA_RUN} FAIL_WITHOUT_CUDA=1 pytest test -v --tb=short
143+
${CONDA_RUN} FAIL_WITHOUT_CUDA=1 pytest --override-ini="addopts=-v" test --tb=short
141144
- name: Run Python benchmark
142145
run: |
143146
${CONDA_RUN} time python benchmarks/decoders/gpu_benchmark.py --devices=cuda:0,cpu --resize_devices=none

.github/workflows/linux_wheel.yaml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
name: Build and Upload Linux wheel
4545
uses: pytorch/test-infra/.github/workflows/build_wheels_linux.yml@main
4646
with:
47-
repository: pytorch/torchcodec
47+
repository: meta-pytorch/torchcodec
4848
ref: ""
4949
test-infra-repository: pytorch/test-infra
5050
test-infra-ref: main
@@ -62,26 +62,30 @@ jobs:
6262
strategy:
6363
fail-fast: false
6464
matrix:
65-
python-version: ['3.9']
66-
ffmpeg-version-for-tests: ['4.4.2', '5.1.2', '6.1.1', '7.0.1']
65+
python-version: ['3.10']
66+
ffmpeg-version-for-tests: ['4.4.2', '5.1.2', '6.1.1', '7.0.1', '8.0']
6767
needs: build
6868
steps:
6969
- uses: actions/download-artifact@v4
7070
with:
71-
name: pytorch_torchcodec__${{ matrix.python-version }}_cpu_x86_64
71+
name: meta-pytorch_torchcodec__${{ matrix.python-version }}_cpu_x86_64
7272
path: pytorch/torchcodec/dist/
7373
- name: Setup conda env
74-
uses: conda-incubator/setup-miniconda@v2
74+
uses: conda-incubator/setup-miniconda@v3
7575
with:
7676
auto-update-conda: true
77-
miniconda-version: "latest"
77+
# Using miniforge instead of miniconda ensures that the default
78+
# conda channel is conda-forge instead of main/default. This ensures
79+
# ABI consistency between dependencies:
80+
# https://conda-forge.org/docs/user/transitioning_from_defaults/
81+
miniforge-version: latest
7882
activate-environment: test
7983
python-version: ${{ matrix.python-version }}
8084
- name: Update pip
8185
run: python -m pip install --upgrade pip
8286
- name: Install PyTorch
8387
run: |
84-
python -m pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cpu
88+
python -m pip install --pre torch torchvision --index-url https://download.pytorch.org/whl/nightly/cpu
8589
- name: Install torchcodec from the wheel
8690
run: |
8791
wheel_path=`find pytorch/torchcodec/dist -type f -name "*.whl"`
@@ -123,4 +127,4 @@ jobs:
123127
ls
124128
- name: Run Python tests
125129
run: |
126-
pytest test -vvv
130+
pytest --override-ini="addopts=-v" test

.github/workflows/macos_wheel.yaml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,16 @@ jobs:
4444
name: Build and Upload Mac wheel
4545
uses: pytorch/test-infra/.github/workflows/build_wheels_macos.yml@main
4646
with:
47-
repository: pytorch/torchcodec
47+
repository: meta-pytorch/torchcodec
4848
ref: ""
4949
test-infra-repository: pytorch/test-infra
5050
test-infra-ref: main
5151
build-matrix: ${{ needs.generate-matrix.outputs.matrix }}
5252
pre-script: packaging/pre_build_script.sh
5353
post-script: packaging/post_build_script.sh
5454
smoke-test-script: packaging/fake_smoke_test.py
55-
runner-type: macos-m1-stable
55+
runner-type: macos-14
56+
setup-miniconda: true
5657
package-name: torchcodec
5758
trigger-event: ${{ github.event_name }}
5859
build-platform: "python-build-package"
@@ -63,14 +64,14 @@ jobs:
6364
strategy:
6465
fail-fast: false
6566
matrix:
66-
python-version: ['3.9']
67-
ffmpeg-version-for-tests: ['4.4.2', '5.1.2', '6.1.1', '7.0.1']
67+
python-version: ['3.10']
68+
ffmpeg-version-for-tests: ['4.4.2', '5.1.2', '6.1.1', '7.0.1', '8.0']
6869
needs: build
6970
steps:
7071
- name: Download wheel
7172
uses: actions/download-artifact@v4
7273
with:
73-
name: pytorch_torchcodec__${{ matrix.python-version }}_cpu_
74+
name: meta-pytorch_torchcodec__${{ matrix.python-version }}_cpu_
7475
path: pytorch/torchcodec/dist/
7576

7677
- name: Setup conda env
@@ -85,7 +86,7 @@ jobs:
8586

8687
- name: Install PyTorch
8788
run: |
88-
python -m pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cpu
89+
python -m pip install --pre torch torchvision --index-url https://download.pytorch.org/whl/nightly/cpu
8990
9091
- name: Install torchcodec from the wheel
9192
run: |
@@ -122,4 +123,4 @@ jobs:
122123
123124
- name: Run Python tests
124125
run: |
125-
pytest test -vvv
126+
pytest --override-ini="addopts=-v" test

.github/workflows/reference_resources.yaml

Lines changed: 47 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
workflow_dispatch:
55
pull_request:
66
paths:
7-
- test/generate_reference_resources.sh
7+
- test/generate_reference_resources.py
88
- .github/workflows/reference_resources.yaml # self reference
99
schedule:
1010
- cron: '0 0 * * 0' # on sunday
@@ -14,14 +14,51 @@ defaults:
1414
shell: bash -l -eo pipefail {0}
1515

1616
jobs:
17+
generate-matrix:
18+
uses: pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@main
19+
with:
20+
package-type: wheel
21+
os: linux
22+
test-infra-repository: pytorch/test-infra
23+
test-infra-ref: main
24+
with-xpu: disable
25+
with-rocm: disable
26+
with-cuda: disable
27+
build-python-only: "disable"
28+
29+
build:
30+
needs: generate-matrix
31+
strategy:
32+
fail-fast: false
33+
name: Build and Upload Linux wheel
34+
uses: pytorch/test-infra/.github/workflows/build_wheels_linux.yml@main
35+
with:
36+
repository: meta-pytorch/torchcodec
37+
ref: ""
38+
test-infra-repository: pytorch/test-infra
39+
test-infra-ref: main
40+
build-matrix: ${{ needs.generate-matrix.outputs.matrix }}
41+
pre-script: packaging/pre_build_script.sh
42+
post-script: packaging/post_build_script.sh
43+
smoke-test-script: packaging/fake_smoke_test.py
44+
package-name: torchcodec
45+
trigger-event: ${{ github.event_name }}
46+
build-platform: "python-build-package"
47+
build-command: "BUILD_AGAINST_ALL_FFMPEG_FROM_S3=1 python -m build --wheel -vvv --no-isolation"
48+
1749
test-reference-resource-generation:
50+
needs: build
1851
runs-on: ubuntu-latest
1952
strategy:
2053
fail-fast: false
2154
matrix:
22-
python-version: ['3.9']
55+
python-version: ['3.10']
2356
ffmpeg-version-for-tests: ['4.4.2', '5.1.2', '6.1.1', '7.0.1']
2457
steps:
58+
- uses: actions/download-artifact@v4
59+
with:
60+
name: meta-pytorch_torchcodec__${{ matrix.python-version }}_cpu_x86_64
61+
path: pytorch/torchcodec/dist/
2562
- name: Setup conda env
2663
uses: conda-incubator/setup-miniconda@v2
2764
with:
@@ -38,16 +75,21 @@ jobs:
3875
- name: Update pip
3976
run: python -m pip install --upgrade pip
4077

41-
- name: Instal generation dependencies
78+
- name: Install generation dependencies
4279
run: |
4380
# Note that we're installing stable - this is for running a script where we're a normal PyTorch
4481
# user, not for building TorhCodec.
4582
python -m pip install torch --index-url https://download.pytorch.org/whl/cpu
46-
python -m pip install numpy pillow
83+
python -m pip install numpy pillow pytest
4784
85+
- name: Install torchcodec from the wheel
86+
run: |
87+
wheel_path=`find pytorch/torchcodec/dist -type f -name "*.whl"`
88+
echo Installing $wheel_path
89+
python -m pip install $wheel_path -vvv
4890
- name: Check out repo
4991
uses: actions/checkout@v3
5092

5193
- name: Run generation reference resources
5294
run: |
53-
test/generate_reference_resources.sh
95+
python -m test.generate_reference_resources

0 commit comments

Comments
 (0)