- Read
.jules/bolt.md(creating it if missing) and append a journal entry about avoiding tensor metadata clones during reverse-mode autograd passes by usingOption::take()and value-based accumulation. Verify the creation/modification usingcat. - Modify
crates/aether-core/src/ml/autograd.rsto changeaccumulate_gradsignature to takegrad: Tensorby value and update its implementation. Also, refactorContext::backwardto usegrads[out.index].take()forgrad_outinstead of.clone(), pass computed gradients by value toaccumulate_grad, and re-insertgrad_outintograds[out.index]. Verify the modification usinggit diff. - Complete pre-commit steps to ensure proper testing, verification, review, and reflection are done.
- Run
cargo test -p aether-coreto verify everything works correctly. Submit a PR with title⚡ Bolt: Optimize backward pass gradient accumulationand include What, Why, Impact, and Measurement in the description.