Skip to content
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
2 changes: 1 addition & 1 deletion .github/workflows/cpp_tests.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: CPP tests

on:
push:
# push:
branches: [ main ]
pull_request:

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Docs
on:
push:
branches: [ main ]
pull_request:
# pull_request:

permissions:
id-token: write
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Lint
on:
push:
branches: [ main ]
pull_request:
# pull_request:

concurrency:
group: unit-test${{ github.workflow }}-${{ github.ref == 'refs/heads/main' && github.run_number || github.ref }}
Expand Down
137 changes: 137 additions & 0 deletions .github/workflows/linux_cuda_aarch64_wheel.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
name: Build and test Linux CUDA aarch64 wheels

on:
pull_request:
push:
branches:
- nightly
- main
- release/*
tags:
- v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref_name }}-${{ github.ref_type == 'branch' && github.sha }}-${{ github.event_name == 'workflow_dispatch' }}
cancel-in-progress: true

permissions:
id-token: write
contents: write

defaults:
run:
shell: bash -l -eo pipefail {0}

jobs:
generate-matrix:
uses: pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@main
with:
package-type: wheel
os: linux-aarch64
test-infra-repository: pytorch/test-infra
test-infra-ref: main
with-cpu: disable
with-xpu: disable
with-rocm: disable
with-cuda: enable
build-python-only: "disable"
build:
needs: generate-matrix
strategy:
fail-fast: false
name: Build and Upload wheel
uses: pytorch/test-infra/.github/workflows/build_wheels_linux.yml@main
with:
repository: meta-pytorch/torchcodec
ref: ""
test-infra-repository: pytorch/test-infra
test-infra-ref: main
build-matrix: ${{ needs.generate-matrix.outputs.matrix }}
pre-script: packaging/pre_build_script.sh
post-script: packaging/post_build_script.sh
smoke-test-script: packaging/fake_smoke_test.py
package-name: torchcodec
trigger-event: ${{ github.event_name }}
architecture: aarch64
build-platform: "python-build-package"
build-command: "BUILD_AGAINST_ALL_FFMPEG_FROM_S3=1 python -m build --wheel -vvv --no-isolation"

install-and-test:
runs-on: linux.arm64.2xlarge
container:
image: pytorch/manylinuxaarch64-builder:cuda12.6
env:
cuda_version_without_periods: "126"
strategy:
fail-fast: false
matrix:
python-version: ['3.10']
ffmpeg-version-for-tests: ['4.4.2', '5.1.2', '6.1.1', '7.0.1', '8.0']
needs: build
steps:
- uses: actions/download-artifact@v4
with:
name: meta-pytorch_torchcodec__${{ matrix.python-version }}_cu${{ env.cuda_version_without_periods }}_aarch64
path: pytorch/torchcodec/dist/
- name: Setup conda env
uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
# Using miniforge instead of miniconda ensures that the default
# conda channel is conda-forge instead of main/default. This ensures
# ABI consistency between dependencies:
# https://conda-forge.org/docs/user/transitioning_from_defaults/
miniforge-version: latest
activate-environment: test
python-version: ${{ matrix.python-version }}
- name: Update pip
run: python -m pip install --upgrade pip
- name: Install PyTorch
run: |
python -m pip install --pre torch torchvision --index-url https://download.pytorch.org/whl/nightly/cpu
- name: Install torchcodec from the wheel
run: |
wheel_path=`find pytorch/torchcodec/dist -type f -name "*.whl"`
echo Installing $wheel_path
python -m pip install $wheel_path -vvv

- name: Check out repo
uses: actions/checkout@v3
- name: Install ffmpeg, post build
run: |
# Ideally we would have checked for that before installing the wheel,
# but we need to checkout the repo to access this file, and we don't
# want to checkout the repo before installing the wheel to avoid any
# side-effect. It's OK.
source packaging/helpers.sh
assert_ffmpeg_not_installed

conda install "ffmpeg=${{ matrix.ffmpeg-version-for-tests }}" -c conda-forge
ffmpeg -version
echo LD_LIBRARY_PATH=$CONDA_PREFIX/lib:/usr/local/cuda/lib64/:${LD_LIBRARY_PATH} >> $GITHUB_ENV

- name: Install test dependencies
run: |
# Ideally we would find a way to get those dependencies from pyproject.toml
python -m pip install numpy pytest pillow

- name: Delete the src/ folder just for fun
run: |
# The only reason we checked-out the repo is to get access to the
# tests. We don't care about the rest. Out of precaution, we delete
# the src/ folder to be extra sure that we're running the code from
# the installed wheel rather than from the source.
# This is just to be extra cautious and very overkill because a)
# there's no way the `torchcodec` package from src/ can be found from
# the PythonPath: the main point of `src/` is precisely to protect
# against that and b) if we ever were to execute code from
# `src/torchcodec`, it would fail loudly because the built .so files
# aren't present there.
rm -r src/
ls
- name: Run Python tests
run: |

pytest --override-ini="addopts=-v" test

2 changes: 1 addition & 1 deletion .github/workflows/linux_cuda_wheel.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Build and test Linux CUDA wheels

on:
pull_request:
# pull_request:
push:
branches:
- nightly
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/linux_wheel.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Build and test Linux wheel

on:
pull_request:
# pull_request:
push:
branches:
- nightly
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/macos_wheel.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Build and test MacOS wheel

on:
pull_request:
# pull_request:
push:
branches:
- nightly
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/windows_wheel.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Build and test Windows wheel

on:
pull_request:
# pull_request:
push:
branches:
- nightly
Expand Down
76 changes: 52 additions & 24 deletions src/torchcodec/_core/fetch_and_expose_non_gpl_ffmpeg_libs.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,31 +15,59 @@ set(
)

if (LINUX)
set(
platform_url
${base_url}/linux_x86_64
)
if (CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64|arm64|ARM64")
set(
platform_url
${base_url}/linux_aarch64
)

set(
f4_sha256
1a083f1922443bedb5243d04896383b8c606778a7ddb9d886c8303e55339fe0c
)
set(
f5_sha256
65d6ad54082d94dcb3f801d73df2265e0e1bb303c7afbce7723e3b77ccd0e207
)
set(
f6_sha256
8bd5939c2f4a4b072e837e7870c13fe7d13824e5ff087ab534e4db4e90b7be9c
)
set(
f7_sha256
1cb946d8b7c6393c2c3ebe1f900b8de7a2885fe614c45d4ec32c9833084f2f26
)
set(
f8_sha256
c55b3c1a4b5e4d5fdd7c632bea3ab6f45b4e37cc8e0999dda3f84a8ed8defad8
)
set(
f4_sha256
a310a2ed9ffe555fd3278dae15065541098dd35e124564671dcda6a6620ac842
)
set(
f5_sha256
89ca7996bccbc2db49adaa401d20fdbabffe0e1b4e07a0f81d6b143e858b7c8d
)
set(
f6_sha256
ae44c67b4587d061b8e9cc8990ca891ee013fe52ad79e5016ba29871562621da
)
set(
f7_sha256
948e2cac66ca6f68ff526d5e84138e94bce0f1a7c83f502d15d85d0bd3ddc112
)
set(
f8_sha256
b9cfd99ae75a14e58300854967d4dc49de0b3daa551df51ea1f52a3f08d2c8af
)
elseif (LINUX) # assume x86_64
set(
platform_url
${base_url}/linux_x86_64
)

set(
f4_sha256
1a083f1922443bedb5243d04896383b8c606778a7ddb9d886c8303e55339fe0c
)
set(
f5_sha256
65d6ad54082d94dcb3f801d73df2265e0e1bb303c7afbce7723e3b77ccd0e207
)
set(
f6_sha256
8bd5939c2f4a4b072e837e7870c13fe7d13824e5ff087ab534e4db4e90b7be9c
)
set(
f7_sha256
1cb946d8b7c6393c2c3ebe1f900b8de7a2885fe614c45d4ec32c9833084f2f26
)
set(
f8_sha256
c55b3c1a4b5e4d5fdd7c632bea3ab6f45b4e37cc8e0999dda3f84a8ed8defad8
)
endif()
elseif (APPLE)
set(
platform_url
Expand Down
Loading