Skip to content

refactor(autogram): Remove vmap rule generation#462

Open
ValerianRey wants to merge 4 commits intomainfrom
remove-generate-vmap-rule
Open

refactor(autogram): Remove vmap rule generation#462
ValerianRey wants to merge 4 commits intomainfrom
remove-generate-vmap-rule

Conversation

@ValerianRey
Copy link
Contributor

Not sure what I'm doing here, but as far as I understand, the generated vmap rule for JacobianAccumulator is never used.
I think (correct me if I'm wrong) that it would only be used if we vmapped the forward pass of a hooked model.
And I don't think we will ever cover that case (it's just too much work for nothing it seems).
So this is 1 less line of code, one less non-tested feature, and maybe even a lighter JacobianAccumulator node.

@ValerianRey ValerianRey added cc: refactor Conventional commit type for any refactoring, not user-facing, and not typing or perf improvements package: autogram labels Oct 18, 2025
@ValerianRey ValerianRey self-assigned this Oct 18, 2025
@ValerianRey ValerianRey added cc: refactor Conventional commit type for any refactoring, not user-facing, and not typing or perf improvements package: autogram labels Oct 18, 2025
@codecov
Copy link

codecov bot commented Oct 18, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ
src/torchjd/autogram/_module_hook_manager.py 100.00% <ø> (+100.00%) ⬆️

... and 51 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@PierreQuinton
Copy link
Contributor

I added this when we where having 2 engines on the same modules. This is because the forward was then run using vmap with the functional api. This is exactly what we lose with this change (but I don't have anything against it).

@ValerianRey
Copy link
Contributor Author

ValerianRey commented Oct 19, 2025

Ok, then I'm not sure this PR is such a good idea. I'm gonna keep this open for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cc: refactor Conventional commit type for any refactoring, not user-facing, and not typing or perf improvements package: autogram

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants