-
Notifications
You must be signed in to change notification settings - Fork 7k
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
[Cherrypick 0.13] Add M1 build and test jobs #6112
[Cherrypick 0.13] Add M1 build and test jobs #6112
Conversation
This would package libpng and libjpeg.dylib into wheel files Add a very simple test step, copied from https://github.com/pytorch/pytorch.github.io/blob/1eaa33a3d3f1b83b64c5031c6dd04dbb238d6105/scripts/test_install.py#L78 Cherry-picked from https://github.com/pytorch/builder/blob/d0bc74cc363a9da5a8b6a40e883d40d25d050036/build_m1_domains.sh#L22
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Yosua
Fast! Thanks @NicolasHug ! |
FYI we will need to also cherrypick #6111 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It needs some more changes to be usable on release branches, please hold until they are done. (For example, one need to change version from 0.14 back to 0.13)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@NicolasHug grabbed the latest differences from numerous M1 related PRs merged on main.
I understand that this is a straight copy-paste of the final configs from main. They all LGTM.
Before merging we will need @malfet 's input on #6117 (comment). #6117 has made changes to |
@NicolasHug I think his PR at #6117 does solve the issue and if it's not already cherrypicked, needs to be included here. I agree, let's wait to see what he thinks. |
* [BE] Unify version computation Instead of hardcoding dev version in various script, use one from `version.txt` if `setup_build_version` is called without arguments Also, pass `--pre` option to M1 build/test pip install commands to build TorchVision against nightly pytorch * Pin torchvision dependency to a specific pytorch version
Clean up Conda build folder before every run Enable artifact upload to GitHub for every workflow run, but upload to Conda/S3 only on nightly pushes Test plan: `conda install -c pytorch-nightly torchvision; python -c "import torchvision;print(torchvision.io.read_image('hummingbird.jpg').shape)"`
setup_build_version | ||
WHL_NAME=torchvision-${BUILD_VERSION}-cp${PY_VERS/.}-cp${PY_VERS/.}-macosx_11_0_arm64.whl | ||
conda create -yp ${ENV_NAME} python=${PY_VERS} numpy libpng jpeg wheel pkg-config | ||
conda run -p ${ENV_NAME} python3 -mpip install torch --pre -f https://download.pytorch.org/whl/test/cpu/torch_test.html |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: This ended up being overwritten in #6140.
…ick013/m1-build-setup
* Adding tagged builds * Testing * Testing * Testing * Testing * Adding conda builds
Replace `steps.extract_branch.outputs.branch` (which were probably taken from https://stackoverflow.com/questions/58033366/how-to-get-the-current-branch-within-github-actions ) with straightforward `github.event.ref` Tested in https://github.com/malfet/deleteme/runs/6822647720?check_suite_focus=true and https://github.com/malfet/deleteme/runs/6822691158?check_suite_focus=true
run: | | ||
# reference ends with an RC suffix | ||
if [[ ${GITHUB_REF_NAME} = *-rc[0-9]* ]]; then | ||
echo "CHANNEL=test" >> "$GITHUB_ENV" | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like the builds are using the nightly channel instead of the test channel, see e.g. https://github.com/pytorch/vision/runs/6858724488?check_suite_focus=true#step:4:133
Should we update the tag to also consider branches like the current release/0.13
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a nice followup(cc: @atalman), but for the time being feel free to just change CHANNEL environment variable on line 16 to test
...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done merged fix for this
run: | | ||
# reference ends with an RC suffix | ||
if [[ ${GITHUB_REF_NAME} = *-rc[0-9]* ]]; then | ||
echo "CHANNEL=test" >> "$GITHUB_ENV" | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a nice followup(cc: @atalman), but for the time being feel free to just change CHANNEL environment variable on line 16 to test
...
run: | | ||
# reference ends with an RC suffix | ||
if [[ ${GITHUB_REF_NAME} = *-rc[0-9]* ]]; then | ||
echo "CHANNEL=test" >> "$GITHUB_ENV" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@atalman : Hmm, don't we need to setup channel for build_conda workflow as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done! Fix is commited: fb9a761
More things need to be cherrypicked. For example #6158 At this point, with so many changes, it might be worth checking that this PR contains all possible improvements done on main related to M1s. |
Co-authored-by: Vasilis Vryniotis <datumbox@users.noreply.github.com>
I tried to keep track of everything and updated #6081 (comment), but yes. There are so many PRs that this will require a very careful review. |
@NicolasHug Agreed. Happy to lend a pair of eyes at the last PR if you want. Ping me when ready. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The build jobs are currently failing with a dependency resolution conflict https://github.com/pytorch/vision/runs/6864443482?check_suite_focus=true
Marking red so we don't merge by mistake.
…ick013/m1-build-setup
cd32d58
to
fb9a761
Compare
@NicolasHug @YosuaMichael There is another PR that adds M1 support by @atalman at #6167 that passes all the tests. Might be worth merging that one instead. |
Agree, lets use #6167 for the cherry pick and close this PR, I have edited on the release tracker, what do you think @NicolasHug ? |
Cherrypick from main: #5948 and #6110
This change will add a file
.github/workflows/build-m1-binaries.yml
which build m1 on the CI.EDIT: this more generally picks all M1-related stuff, including #6122 and #6132 (and a lot more stuff tracked in #6081 (comment))