Skip to content

torchcodec: Add version 0.16.0 - #2105

Open
luhenry wants to merge 4 commits into
mainfrom
torchcodec
Open

luhenry wants to merge 4 commits into
mainfrom
torchcodec

Conversation

@luhenry

@luhenry luhenry commented Sep 19, 2026

Copy link
Copy Markdown
Member

Compiles PyTorch's video decoder: a C++20 core linked against libtorch and FFmpeg, plus a separate FFmpeg-free image-decoder library. Upstream publishes no riscv64 wheel.

Mirrors upstream's linux_wheel.yaml.

Differs from upstream

  • FFmpeg built from source in the container - upstream's prebuilt non-GPL tarballs have no riscv64 build.
  • FFmpeg 6.1, so the single libtorchcodec_core6.so matches ubuntu-24.04-riscv's system FFmpeg.
  • TORCHCODEC_BUILD_AVIF=0, TORCHCODEC_BUILD_HEIC=0 - libavif comes from the same bucket, libheif is in neither Rocky 10 nor a riscv64 EPEL.
  • Warnings-as-errors off - untested compiler/arch combination.

Testing

  • torchvision not on the registry, so test_transform_ops.py is deselected.
  • Slow tests skipped (the suite's own default) rather than force-enabled as upstream's CI does.

License: Wheel bundles libjpeg-turbo, libpng, zlib and libwebp (all permissive); upstream ships their licence texts from its own repair script, which this build does not use, so the build adds them.

Patches

  • 0001-pyproject-glob-the-licence-texts-of-the-bundled-image.patch - Upstream-Status: Inappropriate. Without it PEP 639's explicit license-files list silently drops the vendored-library licence texts. Not riscv64-specific, but only meaningful for a plain-auditwheel repair.

Not built locally: the manylinux riscv64 image is unreachable from this host, and an x86 rehearsal of a libtorch project needs a CPU-only torch that PyPI does not serve. First CI run is the first build.

torchcodec is PyTorch's video decoder: a scikit-build-core/CMake project that
compiles a C++20 core against libtorch and FFmpeg, plus a separate,
FFmpeg-free image-decoder library.

Upstream links its wheels against prebuilt non-GPL FFmpeg tarballs it hosts on
S3, which carry no riscv64 build, so the workflow takes the project's other
supported path -- pkg-config against an installed FFmpeg -- and builds that
FFmpeg from source in the container, LGPL and never shipped. FFmpeg 6.1 because
the major version is baked into the libtorchcodec_core<N>.so name the Python
loader dlopen()s, and 6.1 is what ubuntu-24.04-riscv ships.

AVIF and HEIC image decoding are off: libavif comes from the same S3 bucket and
libheif is packaged in neither Rocky 10 nor a riscv64 EPEL. JPEG, PNG, WebP and
the vendored giflib are built as usual.

Also records two reusable gotchas found along the way (383, 384).
RPM installs %license files regardless of tsflags=nodocs (only %doc is
dropped), and all four packages whose licences the wheel needs mark them
%license -- confirmed against the CentOS Stream 10 spec files, which are also
where `%files devel` confirms libwebp-devel ships the CMake package config
find_package(WebP) needs. The reinstall stays as belt-and-braces but must not
fail the build when a package is no longer available from a repo.
@luhenry luhenry changed the title torchcodec: build 0.16.0 wheels for riscv64 torchcodec: Add version 0.16.0 Sep 19, 2026
Restores skills/python-project-porting/references/{gotchas-index.md,
gotchas/local-validation-and-rehearsal.md, gotchas/native-deps-and-linking.md}
to main's current content. The two gotchas this PR had added (383/384,
torch+CUDA rehearsal and versioned-dlopen ABI contract) also collided with
gotcha numbers other agents had already taken on main in the meantime -
they'll be re-added on main directly with fresh numbers instead.
luhenry added a commit that referenced this pull request Sep 19, 2026
These were originally added inside PR #2105 (torchcodec), which is not
allowed to touch skills/ - removed from that branch and landed here
instead, renumbered from their original 383/384 (already taken by other
concurrent work by the time this was caught).
…is branch no longer touches

# Conflicts:
#	skills/python-project-porting/references/gotchas-index.md
#	skills/python-project-porting/references/gotchas/local-validation-and-rehearsal.md
@github-actions

github-actions Bot commented Sep 19, 2026

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://riseproject-dev.github.io/python-wheels/pr-preview/pr-2105/

Built to branch gh-pages at 2026-09-19 11:22 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant