Skip to content

Commit eb82b07

Browse files
committed
Auto merge of rust-lang#139344 - Zalathar:rollup-uklkyeb, r=Zalathar
Rollup of 14 pull requests Successful merges: - rust-lang#137869 (Demote i686-pc-windows-gnu to Tier 2) - rust-lang#137880 (Autodiff batching) - rust-lang#138546 (Add integer to string formatting tests) - rust-lang#138947 (Refactor Apple version handling in the compiler) - rust-lang#138950 (replace extra_filename with strict version hash in metrics file names) - rust-lang#139213 (Run coretests and alloctests with cg_clif in CI) - rust-lang#139274 (Rustdoc: typecheck settings.js) - rust-lang#139295 (Remove creation of duplicate `AnonPipe`) - rust-lang#139298 (Allow for missing invisible close delim when reparsing an expression.) - rust-lang#139313 (Deduplicate some `rustc_middle` function bodies by calling the `rustc_type_ir` equivalent) - rust-lang#139317 (compiletest: Encapsulate all of the code that touches libtest) - rust-lang#139322 (Add helper function for checking LLD usage to `run-make-support`) - rust-lang#139335 (Pass correct param-env to `error_implies`) - rust-lang#139342 (Add a mailmap entry for myself) Failed merges: - rust-lang#138949 (Rename `is_like_osx` to `is_like_darwin`) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 9e14530 + 823eed4 commit eb82b07

File tree

85 files changed

+1686
-874
lines changed

Some content is hidden

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

85 files changed

+1686
-874
lines changed

.mailmap

+2
Original file line numberDiff line numberDiff line change
@@ -408,6 +408,8 @@ Luqman Aden <[email protected]> <[email protected]>
408408
409409
410410
Maik Klein <[email protected]>
411+
412+
411413
Malo Jaffré <[email protected]>
412414
Manish Goregaokar <[email protected]>
413415

compiler/rustc_ast/src/expand/autodiff_attrs.rs

+13
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,17 @@ pub struct AutoDiffAttrs {
7777
/// e.g. in the [JAX
7878
/// Documentation](https://jax.readthedocs.io/en/latest/_tutorials/advanced-autodiff.html#how-it-s-made-two-foundational-autodiff-functions).
7979
pub mode: DiffMode,
80+
/// A user-provided, batching width. If not given, we will default to 1 (no batching).
81+
/// Calling a differentiated, non-batched function through a loop 100 times is equivalent to:
82+
/// - Calling the function 50 times with a batch size of 2
83+
/// - Calling the function 25 times with a batch size of 4,
84+
/// etc. A batched function takes more (or longer) arguments, and might be able to benefit from
85+
/// cache locality, better re-usal of primal values, and other optimizations.
86+
/// We will (before LLVM's vectorizer runs) just generate most LLVM-IR instructions `width`
87+
/// times, so this massively increases code size. As such, values like 1024 are unlikely to
88+
/// work. We should consider limiting this to u8 or u16, but will leave it at u32 for
89+
/// experiments for now and focus on documenting the implications of a large width.
90+
pub width: u32,
8091
pub ret_activity: DiffActivity,
8192
pub input_activity: Vec<DiffActivity>,
8293
}
@@ -222,13 +233,15 @@ impl AutoDiffAttrs {
222233
pub const fn error() -> Self {
223234
AutoDiffAttrs {
224235
mode: DiffMode::Error,
236+
width: 0,
225237
ret_activity: DiffActivity::None,
226238
input_activity: Vec::new(),
227239
}
228240
}
229241
pub fn source() -> Self {
230242
AutoDiffAttrs {
231243
mode: DiffMode::Source,
244+
width: 0,
232245
ret_activity: DiffActivity::None,
233246
input_activity: Vec::new(),
234247
}

compiler/rustc_builtin_macros/messages.ftl

+1
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ builtin_macros_autodiff_ret_activity = invalid return activity {$act} in {$mode}
7979
builtin_macros_autodiff_ty_activity = {$act} can not be used for this type
8080
builtin_macros_autodiff_unknown_activity = did not recognize Activity: `{$act}`
8181
82+
builtin_macros_autodiff_width = autodiff width must fit u32, but is {$width}
8283
builtin_macros_bad_derive_target = `derive` may only be applied to `struct`s, `enum`s and `union`s
8384
.label = not applicable here
8485
.label2 = not a `struct`, `enum` or `union`

0 commit comments

Comments
 (0)