SIGN IN SIGN UP

[assoc_scan] Memory-efficient backward via associative_scan (#192761)

This PR replaces the matrix-based gradient computation of associative_scan with a backward associative_scan. It enhances readability, maintainability and memory footprint. However, runtime needs to be checked.

It replaces #162906 and has been consolidated into a ghstack with the vmap implementation.

Pull Request resolved: https://github.com/pytorch/pytorch/pull/192761
Approved by: https://github.com/ydwu4
T
Thomas Bohnstingl committed
0303631de59c026709a7c2a90520249fb2d92d39
Parent: 0ad9c2f
Committed by PyTorch MergeBot <pytorchmergebot@users.noreply.github.com> on 8/25/2026, 3:06:56 PM