Skip to content
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

Rollup of 8 pull requests #139358

Closed
wants to merge 35 commits into from
Closed

Conversation

Zalathar
Copy link
Contributor

@Zalathar Zalathar commented Apr 4, 2025

Successful merges:

Failed merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

GuillaumeGomez and others added 30 commits March 16, 2025 14:45
Also convert OSVersion into a proper struct for better type-safety.
this also makes `changeSetting` more robust in case it somehow
gets called before `main.js` has finished loading.
changes:
* Add type signature
* Add null checks
* getHelpButton and getSettingsButton are only called once,
  which should marginally improve performance due to less queries.

unfortunatly 2 @ts-expect-error was needed,
as typescript is unaware the EventTarget is likely an Element.
With this, almost the entire file is fully typechecked,
the only exception being the Element.contains(EventTarget) pattern
that is used several times, those are annotated with
@ts-expect-error
"true" looks like a string value, `true` makes it more clear
that we are talking about the actual boolean value.
this allows us to eliminate the last 3 @ts-expect-error
in this file.
In accordance with RFC 3771.

I also added a stub doc page for the target and renamed the
windows-gnullvm page for consistency.
…he_destroyer_of_i686-pc-windows-gnu, r=workingjubilee

Demote i686-pc-windows-gnu to Tier 2

In accordance with [RFC 3771](rust-lang/rfcs#3771). FCP has been completed.

tracking issue rust-lang#138422

I also added a stub doc page for the target and renamed the windows-gnullvm page for consistency.
Autodiff batching

Enzyme supports batching, which is especially known from the ML side when training neural networks.
There we would normally have a training loop, where in each iteration we would pass in some data (e.g. an image), and a target vector. Based on how close we are with our prediction we compute our loss, and then use backpropagation to compute the gradients and update our weights.
That's quite inefficient, so what you normally do is passing in a batch of 8/16/.. images and targets, and compute the gradients for those all at once, allowing better optimizations.

Enzyme supports batching in two ways, the first one (which I implemented here) just accepts a Batch size,
and then each Dual/Duplicated argument has not one, but N shadow arguments.  So instead of
```rs
for i in 0..100 {
   df(x[i], y[i], 1234);
}
```
You can now do
```rs
for i in 0..100.step_by(4) {
   df(x[i+0],x[i+1],x[i+2],x[i+3], y[i+0], y[i+1], y[i+2], y[i+3], 1234);
}
```
which will give the same results, but allows better compiler optimizations. See the testcase for details.

There is a second variant, where we can mark certain arguments and instead of having to pass in N shadow arguments, Enzyme assumes that the argument is N times longer. I.e. instead of accepting 4 slices with 12 floats each, we would accept one slice with 48 floats. I'll implement this over the next days.

I will also add more tests for both modes.

For any one preferring some more interactive explanation, here's a video of Tim's llvm dev talk, where he presents his work. https://www.youtube.com/watch?v=edvaLAL5RqU
I'll also add some other docs to the dev guide and user docs in another PR.

r? ghost

Tracking:

- rust-lang#124509
- rust-lang#135283
…ests, r=Amanieu

Add integer to string formatting tests

As discussed in rust-lang#136264, there doesn't seem to have tests to ensure that int to string conversion is performed correctly, only sporadic tests here and there. Now we have some basic tests. :)

r? ``@Mark-Simulacrum``
Zalathar added 5 commits April 4, 2025 20:05
…=Noratrieb

Refactor Apple version handling in the compiler

Move various Apple version handling code in the compiler out `rustc_codegen_ssa` and into a place where it can be accessed by `rustc_attr_parsing`, which I found to be necessary when doing rust-lang#136867. Thought I'd split it out to make it easier to land, and to make further changes like rust-lang#131477 have fewer conflicts / PR dependencies.

There should be no functional changes in this PR.

``@rustbot`` label O-apple
r? rust-lang/compiler
replace extra_filename with strict version hash in metrics file names

Should resolve the potential issue of overwriting metrics from the same crate when compiled with different features or flags.

r? ``@estebank``

try-job: test-various
…t-error-part5, r=notriddle

Rustdoc: typecheck settings.js

This makes the file fully typechecked with no instances of ```@ts-expect-error``` and no type casts.

r? ``@notriddle``
…7970, r=fmease

Fix 2024 edition doctest panic output

Fixes rust-lang#137970.

The problem was that the output was actually displayed by rustc itself because we're exiting with `Result<(), String>`, and the display is really not great. So instead, we get the output, we print it and then we return an `ExitCode`.

r? `@aDotInTheVoid`
@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) A-testsuite Area: The testsuite used to check the correctness of rustc F-autodiff `#![feature(autodiff)]` O-apple Operating system: Apple (macOS, iOS, tvOS, visionOS, watchOS) S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. rollup A PR which is a rollup labels Apr 4, 2025
@Zalathar
Copy link
Contributor Author

Zalathar commented Apr 4, 2025

@bors r+ rollup=never p=5

@bors
Copy link
Collaborator

bors commented Apr 4, 2025

📌 Commit 08153dc has been approved by Zalathar

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 4, 2025
@bors
Copy link
Collaborator

bors commented Apr 4, 2025

🔒 Merge conflict

This pull request and the master branch diverged in a way that cannot be automatically merged. Please rebase on top of the latest master branch, and let the reviewer approve again.

How do I rebase?

Assuming self is your fork and upstream is this repository, you can resolve the conflict following these steps:

  1. git checkout rollup-sriyaf3 (switch to your branch)
  2. git fetch upstream master (retrieve the latest master)
  3. git rebase upstream/master -p (rebase on top of it)
  4. Follow the on-screen instruction to resolve conflicts (check git status if you got lost).
  5. git push self rollup-sriyaf3 --force-with-lease (update this PR)

You may also read Git Rebasing to Resolve Conflicts by Drew Blessing for a short tutorial.

Please avoid the "Resolve conflicts" button on GitHub. It uses git merge instead of git rebase which makes the PR commit history more difficult to read.

Sometimes step 4 will complete without asking for resolution. This is usually due to difference between how Cargo.lock conflict is handled during merge and rebase. This is normal, and you should still perform step 5 to update this PR.

Error message
Auto-merging compiler/rustc_target/src/spec/mod.rs
Auto-merging compiler/rustc_target/src/spec/base/apple/mod.rs
Auto-merging compiler/rustc_driver_impl/src/lib.rs
Auto-merging compiler/rustc_codegen_ssa/src/codegen_attrs.rs
Auto-merging compiler/rustc_codegen_ssa/src/back/mod.rs
CONFLICT (content): Merge conflict in compiler/rustc_codegen_ssa/src/back/mod.rs
Auto-merging compiler/rustc_codegen_ssa/src/back/metadata.rs
Auto-merging compiler/rustc_codegen_ssa/src/back/link.rs
Automatic merge failed; fix conflicts and then commit the result.

@bors bors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Apr 4, 2025
@Zalathar Zalathar closed this Apr 4, 2025
@Zalathar Zalathar deleted the rollup-sriyaf3 branch April 4, 2025 12:02
@bors
Copy link
Collaborator

bors commented Apr 4, 2025

☔ The latest upstream changes (presumably #139354) made this pull request unmergeable. Please resolve the merge conflicts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-attributes Area: Attributes (`#[…]`, `#![…]`) A-testsuite Area: The testsuite used to check the correctness of rustc F-autodiff `#![feature(autodiff)]` O-apple Operating system: Apple (macOS, iOS, tvOS, visionOS, watchOS) rollup A PR which is a rollup S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants