-
Notifications
You must be signed in to change notification settings - Fork 1
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 macOS amd64 artifact #9
Open
vctrmn
wants to merge
15
commits into
zml:master
Choose a base branch
from
vctrmn:feature/add-macos_amd64-target
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
526aaf5
Testing CI build
vctrmn 4986934
Github hosted macos runner
vctrmn 26e26e8
correct runner
vctrmn 056b2e9
testing default CI with github-hosted runner
vctrmn 97199f3
fixing macos version
vctrmn 7ccbc74
fix macos version
vctrmn 9abd578
testing amd64
vctrmn 6957e18
retesting with darwin-arm64
vctrmn ea7be4d
testing using pre-installed bazelisk
vctrmn 7ac5af1
test with macos-12
vctrmn c7cc8ae
testing amd64
vctrmn 211426d
amd64
vctrmn 3fcdd32
clean code
vctrmn 54b74fe
test
vctrmn 53f36b7
Clean code
vctrmn File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,36 +2,43 @@ name: PJRT GPU library | |
on: | ||
push: | ||
tags: | ||
- '*' | ||
- "*" | ||
pull_request: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
permissions: | ||
contents: write | ||
contents: write | ||
jobs: | ||
pjrt-osx-artifacts: | ||
strategy: | ||
matrix: | ||
pjrt: | ||
- target: cpu | ||
config: "--config=release_macos_base" | ||
artifact: bazel-bin/xla/pjrt/c/libpjrt_c_api_cpu_plugin.dylib | ||
runs_on: ["macos-12"] | ||
platform: darwin-amd64 | ||
bazel_target: //xla/pjrt/c:pjrt_c_api_cpu_plugin | ||
- target: cpu | ||
config: "--config=release_macos_arm64" | ||
artifact: bazel-bin/xla/pjrt/c/libpjrt_c_api_cpu_plugin.dylib | ||
runs_on: ['self-hosted', 'macOS'] | ||
runs_on: ["self-hosted", "macOS"] | ||
platform: darwin-arm64 | ||
bazel_target: //xla/pjrt/c:pjrt_c_api_cpu_plugin | ||
|
||
runs-on: ${{ matrix.pjrt.runs_on }} | ||
steps: | ||
- name: "Checking out openxla repository" | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: zml/xla | ||
token: ${{ secrets.OPENXLA_READ_ONLY }} | ||
ref: 97a3db78e4db918033d4f3c5934026c5f3c531e7 | ||
|
||
- name: Setup Bazel | ||
if: ${{ contains(matrix.pjrt.runs_on, 'self-hosted') }} # Run only for self-hosted macOS | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bazelisk is already installed in Github hosted runners; For example |
||
run: | | ||
wget https://github.com/bazelbuild/bazelisk/releases/download/v1.20.0/bazelisk-linux-amd64 -O /usr/local/bin/bazel | ||
chmod +x /usr/local/bin/bazel | ||
|
@@ -63,7 +70,7 @@ jobs: | |
with: | ||
name: pjrt-${{ matrix.pjrt.target }}_${{ matrix.pjrt.platform }}.tar.gz | ||
path: pjrt-${{ matrix.pjrt.target }}_${{ matrix.pjrt.platform }}.tar.gz | ||
|
||
pjrt-artifacts: | ||
strategy: | ||
matrix: | ||
|
@@ -72,42 +79,40 @@ jobs: | |
config: "--config=cuda" | ||
artifact: libpjrt_c_api_gpu_plugin.so | ||
renamed_artifact: libpjrt_cuda.so | ||
runs_on: ['runs-on','runner=32cpu-linux-x64', 'image=ubuntu24-amd64'] | ||
runs_on: | ||
["runs-on", "runner=32cpu-linux-x64", "image=ubuntu24-amd64"] | ||
platform: linux-amd64 | ||
bazel_target: //xla/pjrt/c:pjrt_c_api_gpu_plugin | ||
- target: rocm | ||
config: "--config=rocm" | ||
artifact: libpjrt_c_api_gpu_plugin.so | ||
renamed_artifact: libpjrt_rocm.so | ||
runs_on: ['runs-on','runner=32cpu-linux-x64', 'image=ubuntu24-amd64'] | ||
runs_on: | ||
["runs-on", "runner=32cpu-linux-x64", "image=ubuntu24-amd64"] | ||
platform: linux-amd64 | ||
bazel_target: //xla/pjrt/c:pjrt_c_api_gpu_plugin | ||
- target: cpu | ||
config: "" | ||
artifact: libpjrt_c_api_cpu_plugin.so | ||
renamed_artifact: libpjrt_cpu.so | ||
runs_on: ['runs-on','runner=32cpu-linux-x64', 'image=ubuntu24-amd64'] | ||
runs_on: | ||
["runs-on", "runner=32cpu-linux-x64", "image=ubuntu24-amd64"] | ||
platform: linux-amd64 | ||
bazel_target: //xla/pjrt/c:pjrt_c_api_cpu_plugin | ||
|
||
runs-on: ${{ matrix.pjrt.runs_on }} | ||
steps: | ||
- name: "Checking out repository" | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Bazel | ||
run: | | ||
wget https://github.com/bazelbuild/bazelisk/releases/download/v1.20.0/bazelisk-linux-amd64 -O ~/bin/bazel | ||
chmod +x ~/bin/bazel | ||
|
||
- name: Force remove container | ||
run: | | ||
docker rm -f pjrt-${{ matrix.pjrt.target }} | ||
|
||
- name: "Build ${{ matrix.pjrt.target }} ${{ matrix.pjrt.platform }} image" | ||
run: | | ||
~/bin/bazel run //${{ matrix.pjrt.target }}:${{ matrix.pjrt.target }}_stripped_tarball | ||
|
||
- name: "Run ${{ matrix.pjrt.target }} ${{ matrix.pjrt.platform }} image" | ||
run: | | ||
docker run \ | ||
|
@@ -122,12 +127,10 @@ jobs: | |
--disk_cache=/tmp/cache \ | ||
${{ matrix.pjrt.config }} --repo_env=HERMETIC_PYTHON_VERSION=3.11 \ | ||
${{ matrix.pjrt.bazel_target }} | ||
|
||
- name: "Retrieve ${{ matrix.pjrt.target }} ${{ matrix.pjrt.platform }} artifacts" | ||
run: | | ||
docker cp pjrt-${{ matrix.pjrt.target }}:/xla/bazel-bin/xla/pjrt/c/${{ matrix.pjrt.artifact }} ${{ matrix.pjrt.renamed_artifact }} | ||
docker rm -f pjrt-${{ matrix.pjrt.target }} | ||
|
||
docker cp pjrt-${{ matrix.pjrt.target }}:/xla/bazel-bin/xla/pjrt/c/${{ matrix.pjrt.artifact }} ${{ matrix.pjrt.renamed_artifact }} | ||
docker rm -f pjrt-${{ matrix.pjrt.target }} | ||
- name: Create compressed ${{ matrix.pjrt.target }} ${{ matrix.pjrt.platform }} release file | ||
uses: a7ul/[email protected] | ||
with: | ||
|
@@ -136,27 +139,27 @@ jobs: | |
files: | | ||
./${{ matrix.pjrt.renamed_artifact }} | ||
outPath: pjrt-${{ matrix.pjrt.target }}_${{ matrix.pjrt.platform }}.tar.gz | ||
|
||
- name: Upload ${{ matrix.pjrt.target }} ${{ matrix.pjrt.platform }} artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: pjrt-${{ matrix.pjrt.target }}_${{ matrix.pjrt.platform }}.tar.gz | ||
path: pjrt-${{ matrix.pjrt.target }}_${{ matrix.pjrt.platform }}.tar.gz | ||
|
||
release: | ||
needs: ["pjrt-artifacts","pjrt-osx-artifacts"] | ||
runs-on: ['runs-on','runner=2cpu-linux-x64'] | ||
needs: ["pjrt-artifacts", "pjrt-osx-artifacts"] | ||
runs-on: ["runs-on", "runner=2cpu-linux-x64"] | ||
steps: | ||
- run: rm -rf pjrt*.tar.gz | ||
- name: Download all artifacts | ||
uses: actions/download-artifact@v4 | ||
if: startsWith(github.ref, 'refs/tags/') | ||
- name: Release | ||
uses: softprops/action-gh-release@v2 | ||
if: startsWith(github.ref, 'refs/tags/') | ||
with: | ||
files: | | ||
pjrt-rocm_linux-amd64.tar.gz/pjrt-rocm_linux-amd64.tar.gz | ||
pjrt-cuda_linux-amd64.tar.gz/pjrt-cuda_linux-amd64.tar.gz | ||
pjrt-cpu_linux-amd64.tar.gz/pjrt-cpu_linux-amd64.tar.gz | ||
pjrt-cpu_darwin-arm64.tar.gz/pjrt-cpu_darwin-arm64.tar.gz | ||
- run: rm -rf pjrt*.tar.gz | ||
- name: Download all artifacts | ||
uses: actions/download-artifact@v4 | ||
if: startsWith(github.ref, 'refs/tags/') | ||
- name: Release | ||
uses: softprops/action-gh-release@v2 | ||
if: startsWith(github.ref, 'refs/tags/') | ||
with: | ||
files: | | ||
pjrt-cpu_darwin-arm64.tar.gz/pjrt-cpu_darwin-arm64.tar.gz | ||
pjrt-cpu_darwin-amd64.tar.gz/pjrt-cpu_darwin-amd64.tar.gz | ||
pjrt-rocm_linux-amd64.tar.gz/pjrt-rocm_linux-amd64.tar.gz | ||
pjrt-cuda_linux-amd64.tar.gz/pjrt-cuda_linux-amd64.tar.gz | ||
pjrt-cpu_linux-amd64.tar.gz/pjrt-cpu_linux-amd64.tar.gz |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 zml/xla repo is public (forked)