Skip to content

Commit e4591a1

Browse files
Merge branch 'main' into tessera_pass_draft
2 parents 38f8a46 + f5cf0aa commit e4591a1

File tree

79 files changed

+4035
-1357
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+4035
-1357
lines changed

.github/workflows/build-reactantjll.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,30 @@ concurrency:
3131
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
3232

3333
jobs:
34+
get-reactant-commit:
35+
name: 'Get Reactant commit'
36+
runs-on: ubuntu-latest
37+
timeout-minutes: 10
38+
39+
steps:
40+
- name: Get latest Reactant commit
41+
id: get-reactant-main
42+
shell: bash
43+
run: |
44+
REACTANT_MAIN="$(git ls-remote https://github.com/EnzymeAD/Reactant.jl.git main | awk '{print $1}')"
45+
echo "reactant_main=${REACTANT_MAIN}"
46+
echo "reactant_main=${REACTANT_MAIN}" >> "${GITHUB_OUTPUT}"
47+
outputs:
48+
reactant_main: ${{ steps.get-reactant-main.outputs.reactant_main }}
49+
3450
build-jll:
3551
name: Build Reactant_jll
3652
if: github.event.pull_request.draft == false
3753
uses: EnzymeAD/ReactantBuilder/.github/workflows/build-reactant-reusable.yml@main
54+
needs: get-reactant-commit
3855
with:
3956
reactantbuilder_ref: 'main'
4057
enzyme_jax_commit: ${{ github.sha }}
58+
# If you want to use a different commit than `main`, put here the sha256
59+
# hash, but it must always be a hash, can't use branch name here.
60+
reactant_commit: ${{ needs.get-reactant-commit.outputs.reactant_main }}

.github/workflows/pr-jax-main.yml

Lines changed: 0 additions & 84 deletions
This file was deleted.

.github/workflows/test-gb-25.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ jobs:
5454
# - '0123456789abcdef0123456789abcdef01234567'
5555
reactant_commit:
5656
- 'main'
57+
# - ap/symbol_ref_kernel_call
5758

5859
steps:
5960
- name: Check GPUs
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
name: "Update upstream dependency"
2+
3+
on:
4+
workflow_call:
5+
secrets:
6+
ENZYMEAD_BOT_ID:
7+
required: true
8+
ENZYMEAD_BOT_PRIVATE_KEY:
9+
required: true
10+
inputs:
11+
upstream_repo:
12+
description: 'The GitHub repository of the upstream dependency'
13+
required: true
14+
type: 'string'
15+
upstream_commit:
16+
description: 'The commit of the upstream dependency to update to (optional)'
17+
required: false
18+
type: 'string'
19+
default: ''
20+
variable_name:
21+
description: 'The name of the Bazel variable referencing the commit to update'
22+
required: true
23+
type: 'string'
24+
base_branch:
25+
description: 'Name of the base branch against which to open the PR (optional, defaults to main)'
26+
required: false
27+
type: 'string'
28+
default: 'main'
29+
30+
jobs:
31+
pr-update-dep:
32+
name: 'Update dependency'
33+
runs-on: ubuntu-latest
34+
timeout-minutes: 10
35+
36+
steps:
37+
- uses: actions/create-github-app-token@v2
38+
id: generate_token
39+
with:
40+
app-id: "${{ secrets.ENZYMEAD_BOT_ID }}"
41+
private-key: "${{ secrets.ENZYMEAD_BOT_PRIVATE_KEY }}"
42+
- uses: actions/checkout@v5
43+
- name: Set branch name
44+
run: |
45+
echo "BRANCH_NAME=update-$(echo ${{ inputs.upstream_repo }} | tr '/A-Z' '-a-z')" >> "${GITHUB_ENV}"
46+
- name: Prepare commit message
47+
run: |
48+
echo "COMMIT_MSG_PREFIX=Update ${{ inputs.upstream_repo }} to commit " >> "${GITHUB_ENV}"
49+
- name: Get upstream commit
50+
shell: bash
51+
run: |
52+
OLD_UPSTREAM_COMMIT=$(grep '${{ inputs.variable_name }} *= *".*"' workspace.bzl | cut -d= -f2 | tr -d '" ')
53+
54+
if [[ -n '${{ inputs.upstream_commit }}' ]]; then
55+
NEW_UPSTREAM_COMMIT="${{ inputs.upstream_commit }}"
56+
else
57+
NEW_UPSTREAM_COMMIT="$(git ls-remote https://github.com/${{ inputs.upstream_repo }}.git main | awk '{print $1}')"
58+
fi
59+
60+
echo "OLD_UPSTREAM_COMMIT=${OLD_UPSTREAM_COMMIT}" >> "${GITHUB_ENV}"
61+
echo "NEW_UPSTREAM_COMMIT=${NEW_UPSTREAM_COMMIT}" >> "${GITHUB_ENV}"
62+
echo "DIFF_MSG=Diff: https://github.com/${{ inputs.upstream_repo }}/compare/${OLD_UPSTREAM_COMMIT}...${NEW_UPSTREAM_COMMIT}" >> "${GITHUB_ENV}"
63+
- name: Modify upstream commit
64+
run: |
65+
sed -i 's/${{ inputs.variable_name }} *= *".*"/${{ inputs.variable_name }} = "${{ env.NEW_UPSTREAM_COMMIT }}"/' workspace.bzl
66+
- name: Decide whether to open the pull request
67+
id: decide
68+
run: |
69+
# Fetch latest commit on the branch
70+
LATEST_COMMIT_MESSAGE="$(curl -s -H 'Authorization: token ${{ secrets.GITHUB_TOKEN }}' 'https://api.github.com/repos/${{ github.repository }}/commits/${{ env.BRANCH_NAME }}' | jq -r '.commit.message')"
71+
echo "Latest commit message on the branch '${{ env.BRANCH_NAME }}' is:"
72+
echo "----------"
73+
echo "${LATEST_COMMIT_MESSAGE}"
74+
echo "----------"
75+
if [[ "${LATEST_COMMIT_MESSAGE}" == "null" || "${LATEST_COMMIT_MESSAGE}" == "${{ env.COMMIT_MSG_PREFIX }}"* ]]; then
76+
# Open the PR only if the target branch doesn't exist or latest commit message
77+
# starts with the expected prefix.
78+
echo "We're going to open the pull request..."
79+
echo "should_pr=true" >> "${GITHUB_OUTPUT}"
80+
else
81+
# Otherwise there are other commits to the branch and we don't want to
82+
# override them!
83+
echo "There seem to be extra commits, we won't open the pull request"
84+
echo "should_pr=false" >> "${GITHUB_OUTPUT}"
85+
fi
86+
- name: Create Pull Request
87+
if: ${{ steps.decide.outputs.should_pr == 'true' }}
88+
uses: peter-evans/create-pull-request@v7
89+
with:
90+
token: ${{ steps.generate_token.outputs.token }}
91+
commit-message: |
92+
${{ env.COMMIT_MSG_PREFIX }}${{ env.NEW_UPSTREAM_COMMIT }}
93+
94+
${{ env.DIFF_MSG }}
95+
body: ${{ env.DIFF_MSG }}
96+
base: ${{ inputs.base_branch }}
97+
branch: ${{ env.BRANCH_NAME }}
98+
title: '${{ env.COMMIT_MSG_PREFIX }}${{ env.NEW_UPSTREAM_COMMIT }}'
99+
delete-branch: true
100+
draft: false
101+
author: 'enzymead-bot[bot] <238314553+enzymead-bot[bot]@users.noreply.github.com>'
102+
labels: 'dependencies'
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: "Open PR to update Enzyme commit"
2+
3+
on:
4+
schedule:
5+
- cron: '19 10 * * *'
6+
workflow_dispatch:
7+
inputs:
8+
enzyme_commit:
9+
description: 'The Enzyme commit to update to (optional)'
10+
default: ''
11+
type: 'string'
12+
13+
concurrency:
14+
# Skip intermediate builds: always.
15+
# Cancel intermediate builds: only if it is a pull request build.
16+
group: ${{ github.workflow }}-${{ github.ref }}
17+
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
18+
19+
jobs:
20+
pr-latest-enzyme:
21+
name: "Update Enzyme"
22+
uses: ./.github/workflows/update-dependency.yml
23+
with:
24+
upstream_repo: "EnzymeAD/Enzyme"
25+
upstream_commit: ${{ inputs.enzyme_commit }}
26+
variable_name: "ENZYME_COMMIT"
27+
secrets: inherit

.github/workflows/update-jax.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: "Open PR to update JAX commit"
2+
3+
on:
4+
schedule:
5+
- cron: '19 22 * * *'
6+
workflow_dispatch:
7+
inputs:
8+
jax_commit:
9+
description: 'The JAX commit to update to (optional)'
10+
default: ''
11+
type: 'string'
12+
13+
concurrency:
14+
# Skip intermediate builds: always.
15+
# Cancel intermediate builds: only if it is a pull request build.
16+
group: ${{ github.workflow }}-${{ github.ref }}
17+
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
18+
19+
jobs:
20+
pr-latest-jax:
21+
name: "Update JAX"
22+
uses: ./.github/workflows/update-dependency.yml
23+
with:
24+
upstream_repo: "jax-ml/jax"
25+
upstream_commit: ${{ inputs.jax_commit }}
26+
variable_name: "JAX_COMMIT"
27+
secrets: inherit

WORKSPACE

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
3333
# ],
3434
# )
3535

36+
load("//third_party/ml_toolchain:workspace.bzl", ml_toolchain_workspace = "repo")
37+
38+
ml_toolchain_workspace()
39+
3640
load("//third_party/jax:workspace.bzl", jax_workspace = "repo")
3741

3842
jax_workspace()

patches/xla.patch

Lines changed: 0 additions & 101 deletions
This file was deleted.

0 commit comments

Comments
 (0)