Skip to content

Commit 58e3045

Browse files
authored
Merge branch 'rocm-main' into ci-daily-sync-02-12-2024
2 parents aff7714 + c835a78 commit 58e3045

File tree

4 files changed

+102
-20
lines changed

4 files changed

+102
-20
lines changed

.github/workflows/ci-build.yaml

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: CI
1+
name: ROCm CPU CI
22

33
# We test all supported Python versions as follows:
44
# - 3.10 : Documentation build
@@ -11,10 +11,10 @@ on:
1111
# but only for the main branch
1212
push:
1313
branches:
14-
- main
14+
- rocm-main
1515
pull_request:
1616
branches:
17-
- main
17+
- rocm-main
1818

1919
permissions:
2020
contents: read # to fetch code
@@ -43,9 +43,7 @@ jobs:
4343

4444
build:
4545
name: "build ${{ matrix.name-prefix }} (py ${{ matrix.python-version }} on ubuntu-20.04, x64=${{ matrix.enable-x64}})"
46-
runs-on: linux-x86-n2-32
47-
container:
48-
image: index.docker.io/library/ubuntu@sha256:6d8d9799fe6ab3221965efac00b4c34a2bcc102c086a58dff9e19a08b913c7ef # ratchet:ubuntu:20.04
46+
runs-on: ROCM-Ubuntu
4947
timeout-minutes: 60
5048
strategy:
5149
matrix:
@@ -63,10 +61,6 @@ jobs:
6361
num_generated_cases: 1
6462
steps:
6563
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
66-
- name: Image Setup
67-
run: |
68-
apt update
69-
apt install -y libssl-dev
7064
- name: Set up Python ${{ matrix.python-version }}
7165
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
7266
with:
@@ -144,10 +138,8 @@ jobs:
144138
145139
documentation_render:
146140
name: Documentation - render documentation
147-
runs-on: linux-x86-n2-16
148-
container:
149-
image: index.docker.io/library/ubuntu@sha256:6d8d9799fe6ab3221965efac00b4c34a2bcc102c086a58dff9e19a08b913c7ef # ratchet:ubuntu:20.04
150-
timeout-minutes: 10
141+
runs-on: ubuntu-latest
142+
timeout-minutes: 20
151143
strategy:
152144
matrix:
153145
python-version: ['3.10']
@@ -227,9 +219,7 @@ jobs:
227219
228220
ffi:
229221
name: FFI example
230-
runs-on: linux-x86-g2-16-l4-1gpu
231-
container:
232-
image: index.docker.io/tensorflow/build:latest-python3.12@sha256:48e99608fe9434ada5b14e19fdfd8e64f4cfc83aacd328b9c2101b210e984295 # ratchet:index.docker.io/tensorflow/build:latest-python3.12
222+
runs-on: ROCM-Ubuntu
233223
timeout-minutes: 30
234224
steps:
235225
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
@@ -248,7 +238,7 @@ jobs:
248238
path: ${{ steps.pip-cache.outputs.dir }}
249239
key: ${{ runner.os }}-pip-ffi-examples-${{ hashFiles('**/setup.py', '**/requirements.txt', '**/test-requirements.txt', 'examples/**/pyproject.toml') }}
250240
- name: Install JAX
251-
run: pip install .[cuda12]
241+
run: pip install .
252242
- name: Build and install example project
253243
run: python -m pip install -v ./examples/ffi[test]
254244
env:
@@ -257,7 +247,7 @@ jobs:
257247
# a different toolchain. GCC is the default compiler on the
258248
# 'ubuntu-latest' runner, but we still set this explicitly just to be
259249
# clear.
260-
CMAKE_ARGS: -DCMAKE_CXX_COMPILER=g++ -DJAX_FFI_EXAMPLE_ENABLE_CUDA=ON
250+
CMAKE_ARGS: -DCMAKE_CXX_COMPILER=g++ #-DJAX_FFI_EXAMPLE_ENABLE_CUDA=ON
261251
- name: Run CPU tests
262252
run: python -m pytest examples/ffi/tests
263253
env:
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Pulls the latest changes from upstream into main and opens a PR to merge
2+
# them into rocm-main branch.
3+
4+
name: ROCm Nightly Upstream Sync
5+
on:
6+
workflow_dispatch:
7+
schedule:
8+
- cron: '0 6 * * 1-5'
9+
permissions:
10+
contents: write
11+
pull-requests: write
12+
env:
13+
SYNC_BRANCH_NAME: ci-upstream-sync-${{ github.run_number }}_${{ github.run_attempt }}
14+
jobs:
15+
sync-main:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- run: |
19+
gh auth status
20+
gh repo sync rocm/jax -b main
21+
env:
22+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23+
create-sync-branch:
24+
needs: sync-main
25+
runs-on: ubuntu-latest
26+
env:
27+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28+
steps:
29+
- name: Checkout code
30+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
31+
- name: Create branch
32+
run: |
33+
git fetch
34+
git checkout origin/main
35+
git checkout -b $SYNC_BRANCH_NAME
36+
# Try and merge rocm-main into this new branch so that we don't run upstream's CI code
37+
git config --global user.email "[email protected]"
38+
git config --global user.name "GitHub Actions"
39+
git merge origin/rocm-main || true
40+
# If the merge creates conflicts, we want to abort and push to origin anyways so that a dev can resolve the conflicts
41+
git merge --abort || true
42+
git push origin HEAD
43+
open-sync-pr:
44+
needs: create-sync-branch
45+
runs-on: ubuntu-latest
46+
steps:
47+
- run: |
48+
gh pr create --repo $GITHUB_REPOSITORY --head $SYNC_BRANCH_NAME --base rocm-main --title "CI: $(date +%x) upstream sync" --body "Daily sync with upstream"
49+
env:
50+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
51+
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: ROCm Open Upstream PR
2+
on:
3+
pull_request:
4+
types: [ labeled ]
5+
branches: [ rocm-main ]
6+
jobs:
7+
open-upstream:
8+
if: ${{ github.event.label.name == 'open-upstream' }}
9+
permissions:
10+
contents: write
11+
pull-requests: write
12+
runs-on: ubuntu-latest
13+
env:
14+
NEW_BRANCH_NAME: "${{ github.head_ref }}-upstream"
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
18+
- name: Rebase code to main
19+
run: |
20+
git config --global user.email "[email protected]"
21+
git config --global user.name "Github Actions"
22+
git fetch
23+
git checkout -b $NEW_BRANCH_NAME origin/${{ github.head_ref }}
24+
git rebase --onto origin/main origin/rocm-main
25+
# Force push here so that we don't run into conflicts with the origin branch
26+
git push origin HEAD --force
27+
- name: Leave link to create PR
28+
env:
29+
GH_TOKEN: ${{ github.token }}
30+
run: |
31+
# Bash is not friendly with newline characters, so make our own
32+
NL=$'\n'
33+
# Encode the PR title and body for passing as URL get parameters
34+
TITLE_ENC=$(jq -rn --arg x "[ROCm] ${{ github.event.pull_request.title }}" '$x|@uri')
35+
BODY_ENC=$(jq -rn --arg x $"${{ github.event.pull_request.body }}${NL}${NL}Created from: rocm/jax#${{ github.event.pull_request.number }}" '$x|@uri')
36+
# Create a link to the that will open up a new PR form to upstream and autofill the fields
37+
CREATE_PR_LINK="https://github.com/jax-ml/jax/compare/main...ROCm:jax:$NEW_BRANCH_NAME?expand=1&title=$TITLE_ENC&body=$BODY_ENC"
38+
# Add a comment with the link to the PR
39+
COMMENT_BODY="Feature branch from main is ready. [Create a new PR][1] destined for upstream?${NL}${NL}[1]: $CREATE_PR_LINK"
40+
gh pr comment ${{ github.event.pull_request.number }} --repo rocm/jax --body "$COMMENT_BODY"
41+

.github/workflows/upstream-nightly.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ on:
2222

2323
jobs:
2424
upstream-dev:
25-
runs-on: ubuntu-20.04-16core
25+
runs-on: ROCM-Ubuntu
2626
permissions:
2727
contents: read
2828
checks: write # for upload-artifact

0 commit comments

Comments
 (0)