-
Notifications
You must be signed in to change notification settings - Fork 140
ci: add a github action ci to test Rust std::autodiff #2430
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
base: main
Are you sure you want to change the base?
Changes from all commits
708beb1
29abf8c
871ef84
99862d2
b5fa11e
e6df833
45b9d1a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
name: Enzyme Rust CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
merge_group: | ||
|
||
jobs: | ||
rust-autodiff: | ||
name: Rust Autodiff ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
env: | ||
CCACHE_DIR: "${GITHUB_WORKSPACE}/.ccache" | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [linux-x86-n2-32] | ||
commit: [82224f6891c7e7aa0c6c865aa825100b3ea2d0fb] | ||
|
||
timeout-minutes: 90 | ||
|
||
container: | ||
image: ${{ (contains(matrix.os, 'linux') && 'ghcr.io/enzymead/reactant-docker-images@sha256:91e1edb7a7c869d5a70db06e417f22907be0e67ca86641d48adcea221fedc674' ) || '' }} | ||
wsmoses marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
steps: | ||
- name: Install dependencies | ||
run: | | ||
apt-get update | ||
apt-get install -y ninja-build cmake ccache nodejs | ||
- name: Prepare ccache directory | ||
run: | | ||
mkdir -p "$CCACHE_DIR" | ||
- name: Cache ccache | ||
uses: actions/cache@v4 | ||
with: | ||
path: ${{ env.CCACHE_DIR }} | ||
key: ccache-rust-${{ matrix.os }}-${{ matrix.commit }} | ||
- name: Install Rust toolchain | ||
run: | | ||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y | ||
. ~/.cargo/env | ||
rustup toolchain install nightly | ||
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. until Rust adds CI for Enzyme, I think this should be fixed to a specific commit |
||
rustup default nightly | ||
- uses: actions/checkout@v4 | ||
name: Checkout Enzyme | ||
- uses: actions/checkout@v4 | ||
name: Checkout Rust compiler | ||
with: | ||
repository: rust-lang/rust | ||
ref: ${{ matrix.commit }} | ||
path: rust | ||
- name: Configure Rust compiler | ||
run: | | ||
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. this is never told to use the enzyme we built above? |
||
. ~/.cargo/env | ||
cd rust | ||
# Replace rustc's built-in Enzyme submodule with the Enzyme source code from this repository | ||
rm -rf src/tools/enzyme/enzyme | ||
ln -s "${GITHUB_WORKSPACE}/enzyme" src/tools/enzyme/enzyme | ||
./configure \ | ||
--enable-llvm-link-shared \ | ||
--enable-llvm-plugins \ | ||
--enable-llvm-enzyme \ | ||
--release-channel=nightly \ | ||
--enable-llvm-assertions \ | ||
--enable-clang \ | ||
--enable-lld \ | ||
--disable-optimize-llvm \ | ||
--enable-option-checking \ | ||
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. we should use the github actions cache here, but lets see if it builds first 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. otherwise ccache doesn't do anything as the run is ephemeral |
||
--enable-ninja \ | ||
--disable-docs \ | ||
--enable-ccache | ||
- name: Build Rust compiler stage 1 | ||
working-directory: rust | ||
run: | | ||
. ~/.cargo/env | ||
./x build --stage 1 library | ||
- name: Run Rust autodiff tests | ||
working-directory: rust | ||
run: | | ||
. ~/.cargo/env | ||
./x test --stage 1 tests/codegen-llvm/autodiff | ||
./x test --stage 1 tests/pretty/autodiff | ||
./x test --stage 1 tests/ui/autodiff | ||
./x test --stage 1 tests/ui/feature-gates/feature-gate-autodiff.rs |
Uh oh!
There was an error while loading. Please reload this page.