GSoC 2025 @ The Rust Foundation
Welcome to my GSoC 2025 journey with the Rust Foundation. This page serves as the central hub to track my progress throughout the program.
About the Project
Project: ABI/Layout handling for the automatic differentiation feature
Overview
Over the last year, support for automatic differentiation (“autodiff”) has been added to the Rust compiler using Enzyme, an LLVM-IR based tool. However, two main layout-related issues limit its effectiveness:
Rust’s compiler performs ABI optimizations that improve performance but hinder Enzyme’s autodiff. For example, a function like fn foo(a: f32, b: f32) -> f32
might be optimized to fn foo(x: i64) -> f32
internally. While valid at the LLVM level, this transformation complicates differentiation. Functions tagged with #[rustc_autodiff]
should avoid these ABI optimizations to ensure correct autodiff behavior without disabling optimizations globally.
Expected Outcome
- Prevent ABI optimizations on functions marked with
#[rustc_autodiff]
. - Enable the
#[autodiff(..)]
attribute to work correctly on functions with most common and complex headers. - Maintain performance for functions without the
#[rustc_autodiff]
attribute. - Add robust test cases to the Rust compiler test suite.
- Fix frontend parsing bugs if they arise during testing.
Useful Links
- Project Proposal (current)
- GSoC 2025 Rust selected projects
- Google Summer of Code project annotation
- Project Discussion on Rust Zulip
- Automatic Differentiation Working Group
Pre-Selection Period
Before official coding started, I worked on foundational tasks and smaller improvements to get familiar with compiler internals and the autodiff feature.
- Prevent ICE in autodiff return activity validation
- Split autodiff into autodiff_forward and autodiff_reverse
Community Bonding Period
During the Community Bonding Period, I engage with mentors and contributors, refine the project scope, review the codebase, and analyze optimizations related to the #[autodiff]
attribute.
Coding Period
todo!()
Final Reflections and Outcomes
todo!()