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

Convenience Features #3

Closed
ZuseZ4 opened this issue Jan 15, 2023 · 2 comments
Closed

Convenience Features #3

ZuseZ4 opened this issue Jan 15, 2023 · 2 comments

Comments

@ZuseZ4
Copy link
Member

ZuseZ4 commented Jan 15, 2023

Now that we got basic functionality working, let's start tracking "Nice to have" features.

  1. Optimization:
    We want to run Enzyme on (O3) optimized input, which hasn't been unrolled or vectorized.
    In rust-lang@ba6a9b1 I deactivated these three optimizations: unroll_loops, config.vectorize_slp, config.vectorize_loop.
    In the next step we want to optimize the LLVMModule again, this time with those three parameters set to their original value. Eventually we then should tell Enzyme to not optimize generated functions anymore, since it will be done along with the rest of the module, to avoid optimizing 3x. A good example of why we need this is https://github.com/rust-ml/autodiff-examples/blob/f54363ab03a827ec2377f11c969f6084a9a4a135/examples/recursive.rs#L30, which by default gets unrolled by rustc, leading to a huge code bloat.

  2. Documentation and testcases would be nice. Started in https://github.com/rust-ml/autodiff-examples

  3. EnzymeRegisterAllocationHandler to handle Rust users that use #[global_allocator] (low priority).

  4. Add flag to print information about allocations in the reverse pass (primal too?)

  5. Use field_shuffle_seed to verify that we create correct TypeTrees.

  6. Allow easier alternating between EnzymeDbg and EnzymeRel

  7. Enable the Enzyme Dbg parser for Rust types unconditionally.

bytesnake pushed a commit that referenced this issue May 27, 2023
…t, r=tmiasko

Encode def span for foreign return-position `impl Trait` in trait

Fixes rust-lang#111031, yet another def-span encoding issue :/

Includes a smaller repro than the issue, but I can confirm it ICEs:

```
query stack during panic:
#0 [def_span] looking up span for `rpitit::Foo::bar::{opaque#0}`
#1 [object_safety_violations] determining object safety of trait `rpitit::Foo`
#2 [check_is_object_safe] checking if trait `rpitit::Foo` is object safe
#3 [typeck] type-checking `main`
#4 [used_trait_imports] finding used_trait_imports `main`
#5 [analysis] running analysis passes on this crate
```

Luckily since this only affects nightly, this desn't need to be backported.
@ZuseZ4
Copy link
Member Author

ZuseZ4 commented Oct 21, 2023

TODO: make

let profile = match (builder.config.llvm_optimize, builder.config.llvm_release_debuginfo) {
easy to toggle

@ZuseZ4
Copy link
Member Author

ZuseZ4 commented Mar 31, 2024

Things here are either fixed, or have their own issue.

@ZuseZ4 ZuseZ4 closed this as completed Mar 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant