.github: Add GitHub Actions workflow to build wheels#50633
.github: Add GitHub Actions workflow to build wheels#50633seemethere wants to merge 11 commits intomasterfrom
Conversation
4d00b09 to
fe294bb
Compare
| "gpu_arch_type": gpu_arch_type, | ||
| "container_image": CONTAINER_IMAGES[arch] | ||
| }) | ||
| return json.dumps({"include": matrix}) |
There was a problem hiding this comment.
It's important that this is include and not includes
0200170 to
e9bcbc1
Compare
| - id: set-matrix | ||
| run: | | ||
| # outputting for debugging purposes | ||
| python .github/scripts/generate_binary_build_matrix.py |
There was a problem hiding this comment.
Is there a reason to run the script twice rather than running once and echoing the output twice (the second time with ::set-output)?
There was a problem hiding this comment.
I like outputting the matrix in the first run for debugging purposes so we can see what the actual json blob looks like. perhaps it’d be better to just store that json blob as an artifact for later debugging purposes?
There was a problem hiding this comment.
I guess I just meant, why run the script twice when the output is the same? Why not instead do something like this?
MATRIX=$(python .github/scripts/generate_binary_build_matrix.py)
echo "${MATRIX}" # outputting for debugging purposes
echo "::set-output name=matrix::${MATRIX}"There was a problem hiding this comment.
Oh you could potentially do that, but running the script is at a fairly low cost
| uses: actions/checkout@v2 | ||
| - id: set-matrix | ||
| run: | | ||
| # outputting for debugging purposes |
There was a problem hiding this comment.
apparently omitting the name here causes GHA to use the first line of the shell script as the step name
| MATRIX=$(python .github/scripts/generate_binary_build_matrix.py) | ||
| echo "::set-output name=matrix::${MATRIX}" |
There was a problem hiding this comment.
Is there a limit to the size of a string that can be passed this way as an output to the next job?
| CUDA_ARCHES = [ | ||
| "10.1", | ||
| "10.2", | ||
| "11.0" | ||
| ] | ||
|
|
||
| ROCM_ARCHES = [ | ||
| "3.10", | ||
| "4.0" | ||
| ] | ||
|
|
||
| FULL_ARCHES = [ | ||
| "cpu", | ||
| *CUDA_ARCHES, | ||
| *ROCM_ARCHES | ||
| ] | ||
|
|
||
| CONTAINER_IMAGES = { | ||
| **{ | ||
| # TODO: Re-do manylinux CUDA image tagging scheme to be similar to | ||
| # ROCM so we don't have to do this replacement | ||
| gpu_arch: f"pytorch/manylinux-cuda{gpu_arch.replace('.', '')}" | ||
| for gpu_arch in CUDA_ARCHES | ||
| }, | ||
| **{ | ||
| gpu_arch: f"pytorch/manylinux-rocm:{gpu_arch}" | ||
| for gpu_arch in ROCM_ARCHES | ||
| }, | ||
| "cpu": "pytorch/manylinux-cpu" | ||
| } |
There was a problem hiding this comment.
I guess this is assuming that no cuda version shares its version number with a rocm version? is there a reason we don't just put "cuda" or "rocm" directly into the arch name?
There was a problem hiding this comment.
It's because I don't want to do a transformation of the value from here to the build scripts, so basically it's to just keep the number as transparent as possible from this point to the build point.
Although a better solution would be to not pass a variable at all and just have it all depend on the container image where the arch version would be automatically baked in as a number into the container image.
There was a problem hiding this comment.
This approached is outlined in this PR: #45091
Signed-off-by: Eli Uriegas <eliuriegas@fb.com>
Signed-off-by: Eli Uriegas <eliuriegas@fb.com>
Signed-off-by: Eli Uriegas <eliuriegas@fb.com>
Signed-off-by: Eli Uriegas <eliuriegas@fb.com>
Signed-off-by: Eli Uriegas <eliuriegas@fb.com>
Signed-off-by: Eli Uriegas <eliuriegas@fb.com>
f73d373 to
e42efe4
Compare
Signed-off-by: Eli Uriegas <eliuriegas@fb.com>
Signed-off-by: Eli Uriegas <eliuriegas@fb.com>
Signed-off-by: Eli Uriegas <eliuriegas@fb.com>
Codecov Report
@@ Coverage Diff @@
## master #50633 +/- ##
==========================================
- Coverage 80.91% 80.91% -0.01%
==========================================
Files 1926 1926
Lines 210291 210291
==========================================
- Hits 170152 170149 -3
- Misses 40139 40142 +3 |
Signed-off-by: Eli Uriegas <eliuriegas@fb.com>
|
This is now ready for review, the workflow won't actually run (except on workflow_dispatch), but there'll be follow up PR to disable the wheel builds in the nightly CircleCI run and enable the cron trigger for this workflow (with uploads) |
facebook-github-bot
left a comment
There was a problem hiding this comment.
@seemethere has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
Signed-off-by: Eli Uriegas <eliuriegas@fb.com>
ce37fec to
1e134f4
Compare
facebook-github-bot
left a comment
There was a problem hiding this comment.
@seemethere has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
|
|
||
| jobs: | ||
| generate-build-matrix: | ||
| if: ${{ github.repository_owner == 'pytorch' }} |
There was a problem hiding this comment.
does this just mean "if not on a fork"?
There was a problem hiding this comment.
Basically, this was added in response to #49934
| container: | ||
| image: python:3.9 |
There was a problem hiding this comment.
could do this, doesn't matter too much though:
| container: | |
| image: python:3.9 | |
| container: python:3.9 |
| container: | ||
| image: ${{ matrix.container_image }} |
There was a problem hiding this comment.
same idea as above:
| container: | |
| image: ${{ matrix.container_image }} | |
| container: ${{ matrix.container_image }} |
although I'm not sure if this has the potential break things e.g. if matrix.container_image is itself a map rather than just a string
| parser.add_argument( | ||
| "--no-build-suffix", | ||
| type=strtobool, | ||
| help="Whether or not to add a build suffix typically (+cpu)", |
There was a problem hiding this comment.
I found these helpstrings a bit hard to understand (similar suggestions for the other two below); maybe something like this?
| help="Whether or not to add a build suffix typically (+cpu)", | |
| help="Don't add a build suffix (e.g. '+cpu')", |
| parser.add_argument( | ||
| "--gpu-arch-type", | ||
| type=str, | ||
| help="GPU arch you are building for, typically (cpu, cuda, rocm)", |
There was a problem hiding this comment.
| help="GPU arch you are building for, typically (cpu, cuda, rocm)", | |
| help="GPU arch you are building for (e.g. cpu, cuda, rocm)", |
| parser.add_argument( | ||
| "--gpu-arch-version", | ||
| type=str, | ||
| help="GPU arch version, typically (10.2, 4.0), leave blank for CPU", |
There was a problem hiding this comment.
| help="GPU arch version, typically (10.2, 4.0), leave blank for CPU", | |
| help="GPU arch version (e.g. 10.2 or 4.0), leave blank for CPU", |
|
@seemethere merged this pull request in 1b7a4f9. |
Summary: Based on #50633 and #51243. Things left to do: - [x] modify `.github/scripts/generate_binary_build_matrix.py` further - [x] add option for not iterating over Python version - [x] add `LIBTORCH_VARIANT` - [x] add option for cxx11 - [x] fix the artifact uploading - [x] remove `pull_request` hook before merging Pull Request resolved: #53292 Test Plan: [CI](https://github.com/pytorch/pytorch/actions/runs/665781075). Reviewed By: seemethere Differential Revision: D27189150 Pulled By: samestep fbshipit-source-id: ec91e1f0b75b8c93613d55801585ed975697be03
Summary:
Signed-off-by: Eli Uriegas <eliuriegas@fb.com>
Fixes #{issue number}
Pull Request resolved: pytorch#50633
Reviewed By: samestep
Differential Revision: D26083492
Pulled By: seemethere
fbshipit-source-id: c133671b9cf5074539133ee79fca5c680793a85d
Summary: Based on pytorch#50633 and pytorch#51243. Things left to do: - [x] modify `.github/scripts/generate_binary_build_matrix.py` further - [x] add option for not iterating over Python version - [x] add `LIBTORCH_VARIANT` - [x] add option for cxx11 - [x] fix the artifact uploading - [x] remove `pull_request` hook before merging Pull Request resolved: pytorch#53292 Test Plan: [CI](https://github.com/pytorch/pytorch/actions/runs/665781075). Reviewed By: seemethere Differential Revision: D27189150 Pulled By: samestep fbshipit-source-id: ec91e1f0b75b8c93613d55801585ed975697be03
Adds an initial draft for a workflow that'll build our release binaries for Linux wheels
Signed-off-by: Eli Uriegas eliuriegas@fb.com