Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Mac to FFmpeg build CI #201

Merged
merged 1 commit into from
Sep 7, 2024
Merged

Add Mac to FFmpeg build CI #201

merged 1 commit into from
Sep 7, 2024

Conversation

scotts
Copy link
Contributor

@scotts scotts commented Sep 5, 2024

Adds a Mac build of the FFmpeg non-GPL libraries. The code is lifted almost verbatim from TorchAudio's setup, which reuses pytorch/test-infra. Note there are subtle differences between our current Linux job spec and this new one for Mac - those differences are necessary to work with pytorch/test-infra's setup.

Since this action will only execute once a week on Sunday, I tested it by temporarily hacking it to run on a pull request. See the result of one of those runs to see successful execution: https://github.com/pytorch/torchcodec/actions/runs/10730119629

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Meta Open Source bot. label Sep 5, 2024
@scotts scotts force-pushed the mac_wheel branch 8 times, most recently from 0f99689 to 54f1574 Compare September 6, 2024 00:48
@scotts scotts marked this pull request as ready for review September 6, 2024 00:56
@scotts scotts requested a review from NicolasHug September 6, 2024 00:56
fail-fast: false
matrix:
ffmpeg-version: ["4.4.4", "5.1.4", "6.1.1", "7.0.1"]
runner: ["macos-m1-stable", "macos-12"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pytorch doesn't support x86 for mac anymore

Suggested change
runner: ["macos-m1-stable", "macos-12"]
runner: ["macos-m1-stable"]

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, interesting. The curious bit here is that my system is an x86 Mac, so if I'm going to do any local testing of Mac wheels, then I'll need to keep this in. I can just use CI for everything instead. Let me know which you think is more important: aligning with general PyTorch, or enabling local testing.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You shouldn't need to keep this in for local testing. This just instructs the CI to spin x86 instances. This is never executed on your machine. The actual build script should execute just fine for you locally.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, agreed, this never executes on my machine. But I will want to locally define BUILD_AGAINST_ALL_FFMPEG_FROM_S3 and build on my machine to test that flow locally. And if we don't build non-GPL FFmpeg x86 binaries for Mac in this step in CI, then they won't be available to upload to S3, and I won't be able to test that flow locally.

We can remove it after I've gotten everything setup, but I think at least while I'm working on this, it's better that these binaries are available.

@scotts
Copy link
Contributor Author

scotts commented Sep 6, 2024

As I look forward to how to how we'll want to pull these artifacts to use in builds, I think it will actually be easier if we build Linux and Mac ffmpeg non-GPL binaries using the same infra, and upload them together in the same tar file. I'm going to change this PR to reflect that. I'll request a re-review.

@NicolasHug, please let me know if you think we should prioritize alignment with PyTorch's support, or keep the repo in a state we can all locally test.

@scotts scotts marked this pull request as draft September 6, 2024 14:56
@NicolasHug
Copy link
Member

NicolasHug commented Sep 6, 2024

it will actually be easier if we build Linux and Mac ffmpeg non-GPL binaries using the same infra

I was going to suggest that we add a "TODO: we should migrate the linux job to pytorch infra as well". This doesn't need to happen now, but if you think it makes more sense, that's perfectly fine too!

@scotts scotts force-pushed the mac_wheel branch 3 times, most recently from f4404d2 to 29bfc1f Compare September 6, 2024 20:18
@scotts
Copy link
Contributor Author

scotts commented Sep 6, 2024

I moved Linux over to PyTorch infra as well. All binaries now get uploaded into a single tar file. Example: https://github.com/pytorch/torchcodec/actions/runs/10744678413

@scotts scotts marked this pull request as ready for review September 6, 2024 20:55
@scotts
Copy link
Contributor Author

scotts commented Sep 7, 2024

The failing test is unrelated to these changes, see Issue #203. Merging to unblock; we can remove macos-12 after the entire Mac wheel flow works.

@scotts scotts merged commit 110db88 into pytorch:main Sep 7, 2024
16 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Meta Open Source bot.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants