std::offload regression - requires lto=fat even though fat-lto is already enabled
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.2k
- PR merge metrics
- PR metrics pending
Description
When compiling for gpu offload, we always enable fat-lto:
[profile.release]
lto = "fat"
panic = "abort"
[profile.dev]
lto = "fat"
panic = "abort"
Lately I got hit with the following error when compiling a multi-crate project:
error: using the offload feature requires -C lto=fat
Commenting out the following lines solved it
- if tcx.sess.lto() != rustc_session::config::Lto::Fat {
- let _ = tcx.dcx().emit_almost_fatal(OffloadWithoutFatLTO);
- }
I expected to see this happen: It used to work
Version it worked on
It most recently worked on: Main, a week or two ago?
Version with regression
current main
cc @bjorn3 since you seem to be leading the lto cleanup efforts. Does my check strike you as something that checks for the wrong thing, or could it have regressed due to your changes? It's nothing urgent, I just disabled it locally till I have more time for debugging next week.
Relatedly, thanks for your cleanups! I wanted to give autodiff with thin-lto another try soonish, now that most of your changes landed.
Backtrace
<backtrace>
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at compiler/rustc_codegen_llvm/src/intrinsic.rs around the offload and OffloadWithoutFatLTO check. Reproduce the multi-crate GPU offload build with the shown profile settings, then inspect how the session reports LTO mode. Done means a configuration with fat LTO no longer produces the erroneous requirement error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100