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

fix Constant Activity in examples to Const #40

Merged
merged 1 commit into from
Mar 18, 2025
Merged

Conversation

kiranshila
Copy link
Contributor

No description provided.

@kiranshila
Copy link
Contributor Author

agh my formatter seems to have mucked with a few things

@kiranshila
Copy link
Contributor Author

Also, not sure where to ask about this - but in the examples, you have the likes of

#[autodiff(backprop, Reverse, Const, Duplicated, Active)]
fn training_loss(images: &[f32], weights: &[f32]) -> f32 {
  let loss = do_some_math(images, weights);
  loss
}

generating code like

fn backprop(images: &[f32], weights: &[f32], dweights: &mut [f32]) -> f32

but this isn't quite correct, right? There's an extra f32 seed parameter, if I'm not mistaken.

@ZuseZ4 ZuseZ4 merged commit 6b8d0ea into EnzymeAD:main Mar 18, 2025
@ZuseZ4
Copy link
Member

ZuseZ4 commented Mar 18, 2025

Thanks!
Yes, some parts were unfortunately written before we had CI working, so we forgot to update them when changing autodiff. I'm currently in the process of upstreaming all tests into rust/tests, and in the future let the Rust CI make sure that we don't regress them again. I also have more real-world examples these days of differentiating e.g. Karpathy's llm.c (a rust version of it), as well as Microsoft's ADBench implementation, so I intend to completely replace the outdated examples at some point.

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

Successfully merging this pull request may close these issues.

2 participants