Skip to content

Conversation

@ValerianRey
Copy link
Contributor

Already making the PR to keep track of progress, and to be able to update the dev-new-engine branch easily when main is updated.

* Remove batch_dim parameter from Engine
* Remove test_batched_non_batched_equivalence and test_batched_non_batched_equivalence_2
* Adapt all usages of Engine to not provide batch_dim
* Remove FunctionalJacobianComputer
* Remove args and kwargs from interface of JacobianComputer, GramianComputer and JacobianAccumulator because they were only needed for the functional interface
* Remove kwargs from interface of Hook and stop registering it with with_kwargs=True (args are mandatory though, so rename them as _).
* Change JacobianComputer to compute generalized jacobians (shape [m0, ..., mk, n]) and change GramianComputer to compute optional generalized gramians (shape [m0, ..., mk, mk, ..., m0])
* Change engine.compute_gramian to always simply do one vmap level per dimension of the output, without caring about the batch_dim.
* Remove all reshapes and movedims in engine.compute_gramian: we don't need reshape anymore since the gramian is directly a generalized gramian, and we dont need movedim anymore since we vmap on all dimensions the same way, without having to put the non-batched dim in front. Merge compute_gramian and _compute_square_gramian.
* Add temporary function to create the inital jac_output (dense). This should be updated to a tensor format that is optimized for batched computations.
@codecov
Copy link

codecov bot commented Oct 29, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

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

... and 48 files with indirect coverage changes

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

@ValerianRey ValerianRey added feat New feature or request package: autogram labels Oct 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants