Skip to content

Conversation

atalman
Copy link
Contributor

@atalman atalman commented Jul 31, 2023

This is first PR to automate aarch64 domains build. Starting with torchvision.
Following this script :
https://github.com/pytorch/builder/blob/main/aarch64_linux/build_aarch64_wheel.py

cc @osalpekar @malfet @xncqr

@vercel
Copy link

vercel bot commented Jul 31, 2023

@atalman is attempting to deploy a commit to the Meta Open Source Team on Vercel.

A member of the Team first needs to authorize it.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jul 31, 2023
@atalman atalman changed the title Add aarch64 builds for domains Add aarch64 torchvision build Aug 8, 2023
linux aarch64

Modifying for aarch64

Adding aarch64 builds

adding aarch64 builds

test

test

test

Fix typo

test1

test

test1

test

fix typo

more aarch64 changes

test

Skip aarch64 errors for now

Display conda information

Add conda to path

Test

Arm64 builds

test

More conda changes

temp

test1

testc

test

test

fix sed

test11

setrepo

Test

test111

test44

moreaarch64

moreaarch64

test

test111

test111

test33

test

test

sleep30min

test

Enable debugging

test

test

remove arch

continue..

test

Aarch64 vision worklfow
Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@osalpekar osalpekar left a comment

Choose a reason for hiding this comment

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

Thanks for this! Left some comments, but looks good overall

required: false
type: string
default: x64
setup-miniconda:
Copy link
Member

Choose a reason for hiding this comment

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

IIUC this is always going to be false for aarch64 and true otherwise. In that case, should we just make this an env var and set it accordingly instead of exposing as an arg to the caller.

Copy link
Contributor Author

@atalman atalman Aug 8, 2023

Choose a reason for hiding this comment

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

I think having input parameter is better, since its more flexible and more clear to the user , given that we already expose setup-miniconda input parameter in setup binary builds action: https://github.com/pytorch/test-infra/blob/main/.github/actions/setup-binary-builds/action.yml#L21 , I want to avoid if possible defining one more if statement like this :
${{ inputs.architecture }} == 'aarch64'

@@ -97,16 +107,34 @@ jobs:
repository: ${{ inputs.test-infra-repository }}
ref: ${{ inputs.test-infra-ref }}
path: test-infra
- uses: actions/checkout@v3
Copy link
Member

Choose a reason for hiding this comment

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

IIUC per comment below, the setup script will occur in aarch64 docker and we wouldn't need to checkout builder anymore right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@osalpekar Correct, this won't be needed once we use aarch64 docker. Also its probably best to move aarch64 build scripts from builder to test-infra repo. Hence this will not be required anyways

@@ -134,6 +162,9 @@ jobs:
run: |
set -euxo pipefail
source "${BUILD_ENV_FILE}"
if [[ ${{ inputs.architecture }} == 'ARM64' ]]; then
${CONDA_RUN} conda install -y libpng jpeg
Copy link
Member

Choose a reason for hiding this comment

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

Should we add these in https://github.com/pytorch/vision/blob/main/packaging/pre_build_script.sh (vision pre-script) instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds good, let me do this in subsequent PR in torchvision

@@ -361,6 +369,11 @@ def generate_wheels_matrix(
# Define default compute architectures
arches = ["cpu"]

if os == "linux-aarch64":
Copy link
Member

Choose a reason for hiding this comment

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

So should with_cuda, with_rocm, etc. be set to false automatically if os = linux-aarch64?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hm I don't think its really needed, it will complicate logic further, since we don't actually set with_cuda or with_rocm anywhere in this script, we treat these as our input only variables.

Copy link
Member

Choose a reason for hiding this comment

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

They're enabled by default though right? Feel free to structure this however you see fit, as long as the correct matrix is generated (maybe we should have a unit-test for this in a follow-up).

@@ -55,6 +55,16 @@ on:
description: "The key created when saving a cache and the key used to search for a cache."
default: ""
type: string
architecture:
description: Architecure to build for x64 for default Linux, or ARM64 for Linux aarch64 builds
Copy link
Contributor

Choose a reason for hiding this comment

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

s/Architecure/Architecture/
Also, I propose to use x86_64 rather than x64, to match results of uname -m call on respective hosts

Suggested change
description: Architecure to build for x64 for default Linux, or ARM64 for Linux aarch64 builds
description: Architecture to build for x86_64 for default Linux, or aarch64 for Linux aarch64 builds

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds good @malfet let me do this!

Copy link
Member

@osalpekar osalpekar left a comment

Choose a reason for hiding this comment

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

Thanks for addressing the comments!

@atalman atalman merged commit d9b1b3c into pytorch:main Aug 8, 2023
atalman added a commit that referenced this pull request Aug 8, 2023
Follow up after #4445
to build torchaudio
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 Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants