Skip to content

Fix autodiff builds on Apple CI #140137

Open
Open
@ZuseZ4

Description

@ZuseZ4

Summary

We intend to enable autodiff next weekend.
Currently the dist-x86_64-linux and dist-aarch-linux runner succeeded, so we can ship autodiff in nightly for linux.
It would be nice, if std::autodiff would simultaneously become available for macos users.
For that, we'd want to fix the three apple dist builders, which all fail with the same error, of not finding the llvm dir, after building enzyme and llvm. This fails pretty late in the compilation pipeline, so I assume it's an easy fix, by just updating or adding the correct path to llvm.

The autodiff backend (which builds Enzyme) was originally introduced here: https://github.com/rust-lang/rust/pull/129176/files
The current implementations life at

// We want to link against registerEnzyme and in the future we want to use additional
and
.define("LLVM_DIR", builder.llvm_out(target));
.
Especially this commit fixed local MacOS builds, but as we can see that's not enough for CI yet.

You can test if your changes are successful through try builds (you'll need to ask a rustc member to run one for you).

To avoid having to guess the name of the right LLVM dir, you can probably download the logs of either of the 3 failed apple dist builds. I am not an expert here though, so I'd suggest to ping onur-ozkan who helped with previous autodiff bootstrap issues, or maybe jieyouxu (just add an @ before their name). Since it would be nice to have this as part of the first release and the fix should be quite small, I think it's fine if more than one person looks into it, so I think there's no need to claim it.

Command used

See https://github.com/rust-lang/rust/pull/140064/files

Expected behaviour

Build succeeds, similar to dist-x86_64-linux
#140064 (comment)

Actual behaviour

You can see the failing issue

failed try with plugins & llvm-enzyme enabled: dist-x86_64-apple (#140064 (comment))
failed try with plugins & llvm-enzyme enabled: dist-apple-various (#140064 (comment))
failed try with plugins & llvm-enzyme enabled: dist-aarch64-apple (#140064 (comment))

Bootstrap configuration (bootstrap.toml)

Varies a bit based on the runner, see #140064

Operating system

MacOS, different ones.

HEAD

HEAD

Additional context

Build Log

<log>

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-CIArea: Our Github Actions CIC-bugCategory: This is a bug.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.F-autodiff`#![feature(autodiff)]`O-appleOperating system: Apple (macOS, iOS, tvOS, visionOS, watchOS)T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions