From 44109cc3f02b6deb3914fc5a14d9055116043275 Mon Sep 17 00:00:00 2001 From: Pierre Quinton Date: Fri, 30 Jan 2026 08:24:34 +0100 Subject: [PATCH 01/17] ci: Add a link checker for the doc --- .github/workflows/build-deploy-docs.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/build-deploy-docs.yml b/.github/workflows/build-deploy-docs.yml index e08de9ff..17f1c48b 100644 --- a/.github/workflows/build-deploy-docs.yml +++ b/.github/workflows/build-deploy-docs.yml @@ -43,6 +43,10 @@ jobs: echo "TORCHJD_VERSION=main" >> $GITHUB_OUTPUT fi + - name: Check documentation links + working-directory: docs + run: uv run make linkcheck + - name: Build Documentation working-directory: docs run: uv run make dirhtml From 91c4f8fcfb35712f7f7bee75b8db7f4c9e166714 Mon Sep 17 00:00:00 2001 From: Pierre Quinton Date: Fri, 30 Jan 2026 08:55:24 +0100 Subject: [PATCH 02/17] wrong action, put that in tests --- .github/workflows/build-deploy-docs.yml | 4 ---- .github/workflows/tests.yml | 4 ++++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-deploy-docs.yml b/.github/workflows/build-deploy-docs.yml index 17f1c48b..e08de9ff 100644 --- a/.github/workflows/build-deploy-docs.yml +++ b/.github/workflows/build-deploy-docs.yml @@ -43,10 +43,6 @@ jobs: echo "TORCHJD_VERSION=main" >> $GITHUB_OUTPUT fi - - name: Check documentation links - working-directory: docs - run: uv run make linkcheck - - name: Build Documentation working-directory: docs run: uv run make dirhtml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 129cea7a..3a2bbf77 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -73,6 +73,10 @@ jobs: with: groups: doc + - name: Check documentation links + working-directory: docs + run: uv run make linkcheck + - name: Build Documentation working-directory: docs run: uv run make dirhtml From b259c4c145671d96482a3613262bf10f6b5f1346 Mon Sep 17 00:00:00 2001 From: Pierre Quinton Date: Fri, 30 Jan 2026 13:37:08 +0100 Subject: [PATCH 03/17] Fix 403 error for MGDA reference --- src/torchjd/aggregation/_mgda.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/torchjd/aggregation/_mgda.py b/src/torchjd/aggregation/_mgda.py index 868f5263..f6edbf6b 100644 --- a/src/torchjd/aggregation/_mgda.py +++ b/src/torchjd/aggregation/_mgda.py @@ -11,8 +11,9 @@ class MGDA(GramianWeightedAggregator): r""" :class:`~torchjd.aggregation._aggregator_bases.Aggregator` performing the gradient aggregation step of `Multiple-gradient descent algorithm (MGDA) for multiobjective optimization - `_. The implementation is - based on Algorithm 2 of `Multi-Task Learning as Multi-Objective Optimization + `_. + The implementation is based on Algorithm 2 of `Multi-Task Learning as Multi-Objective + Optimization `_. :param epsilon: The value of :math:`\hat{\gamma}` below which we stop the optimization. From 8ba824ff917a57f41bf2783d9bdf4bc4ed2c6e73 Mon Sep 17 00:00:00 2001 From: Pierre Quinton Date: Fri, 30 Jan 2026 13:44:02 +0100 Subject: [PATCH 04/17] Remove reference to the AlignedMTL repo. --- src/torchjd/aggregation/_aligned_mtl.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/torchjd/aggregation/_aligned_mtl.py b/src/torchjd/aggregation/_aligned_mtl.py index 40d3d9b1..bf17006b 100644 --- a/src/torchjd/aggregation/_aligned_mtl.py +++ b/src/torchjd/aggregation/_aligned_mtl.py @@ -51,8 +51,8 @@ class AlignedMTL(GramianWeightedAggregator): uses the mean eigenvalue (as in the original implementation). .. note:: - This implementation was adapted from the `official implementation - `_. + This implementation was adapted from the official implementation, the repository was + deleted. """ def __init__( From 963151700680a1c5437765bb75d9933c832b7e23 Mon Sep 17 00:00:00 2001 From: Pierre Quinton Date: Fri, 30 Jan 2026 14:03:36 +0100 Subject: [PATCH 05/17] add link checking for md files. --- .github/workflows/tests.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 3a2bbf77..ab52f704 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -81,6 +81,19 @@ jobs: working-directory: docs run: uv run make dirhtml + linkChecker: + name: Check links in Markdown files + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Link Checker + uses: lycheeverse/lychee-action@v1.9.0 + with: + args: --verbose --no-progress "README.md" "CONTRIBUTING.md" "CHANGELOG.md" + fail: true + mypy: name: Run mypy runs-on: ubuntu-latest From 7680fb05ed23ddf1856d519b728ee507e1d8a1c6 Mon Sep 17 00:00:00 2001 From: Pierre Quinton Date: Fri, 30 Jan 2026 14:09:35 +0100 Subject: [PATCH 06/17] Fix links in README.md --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 7342a497..5580a044 100644 --- a/README.md +++ b/README.md @@ -63,13 +63,13 @@ There are two main ways to use TorchJD. The first one is to replace the usual ca [`torchjd.autojac.mtl_backward`](https://torchjd.org/stable/docs/autojac/mtl_backward/), depending on the use-case. This will compute the Jacobian of the vector of losses with respect to the model parameters, and aggregate it with the specified -[`Aggregator`](https://torchjd.org/stable/docs/aggregation/index.html#torchjd.aggregation.Aggregator). +[`Aggregator`](https://torchjd.org/stable/docs/aggregation#torchjd.aggregation.Aggregator). Whenever you want to optimize the vector of per-sample losses, you should rather use the -[`torchjd.autogram.Engine`](https://torchjd.org/stable/docs/autogram/engine.html). Instead of +[`torchjd.autogram.Engine`](https://torchjd.org/stable/docs/autogram/engine/). Instead of computing the full Jacobian at once, it computes the Gramian of this Jacobian, layer by layer, in a memory-efficient way. A vector of weights (one per element of the batch) can then be extracted from this Gramian, using a -[`Weighting`](https://torchjd.org/stable/docs/aggregation/index.html#torchjd.aggregation.Weighting), +[`Weighting`](https://torchjd.org/stable/docs/aggregation#torchjd.aggregation.Weighting), and used to combine the losses of the batch. Assuming each element of the batch is processed independently from the others, this approach is equivalent to [`torchjd.autojac.backward`](https://torchjd.org/stable/docs/autojac/backward/) while being @@ -210,7 +210,7 @@ for input, target1, target2 in zip(inputs, task1_targets, task2_targets): > [!NOTE] > Here, because the losses are a matrix instead of a simple vector, we compute a *generalized > Gramian* and we extract weights from it using a -> [GeneralizedWeighting](https://torchjd.org/docs/aggregation/index.html#torchjd.aggregation.GeneralizedWeighting). +> [GeneralizedWeighting](https://torchjd.org/stable/docs/aggregation/#torchjd.aggregation.GeneralizedWeighting). More usage examples can be found [here](https://torchjd.org/stable/examples/). @@ -220,7 +220,7 @@ TorchJD provides many existing aggregators from the literature, listed in the fo | Aggregator | Weighting | Publication | |------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| [UPGrad](https://torchjd.org/stable/docs/aggregation/upgrad.html#torchjd.aggregation.UPGrad) (recommended) | [UPGradWeighting](https://torchjd.org/stable/docs/aggregation/upgrad#torchjd.aggregation.UPGradWeighting) | [Jacobian Descent For Multi-Objective Optimization](https://arxiv.org/pdf/2406.16232) | +| [UPGrad](https://torchjd.org/stable/docs/aggregation/upgrad/#torchjd.aggregation.UPGrad) (recommended) | [UPGradWeighting](https://torchjd.org/stable/docs/aggregation/upgrad/#torchjd.aggregation.UPGradWeighting) | [Jacobian Descent For Multi-Objective Optimization](https://arxiv.org/pdf/2406.16232) | | [AlignedMTL](https://torchjd.org/stable/docs/aggregation/aligned_mtl#torchjd.aggregation.AlignedMTL) | [AlignedMTLWeighting](https://torchjd.org/stable/docs/aggregation/aligned_mtl#torchjd.aggregation.AlignedMTLWeighting) | [Independent Component Alignment for Multi-Task Learning](https://arxiv.org/pdf/2305.19000) | | [CAGrad](https://torchjd.org/stable/docs/aggregation/cagrad#torchjd.aggregation.CAGrad) | [CAGradWeighting](https://torchjd.org/stable/docs/aggregation/cagrad#torchjd.aggregation.CAGradWeighting) | [Conflict-Averse Gradient Descent for Multi-task Learning](https://arxiv.org/pdf/2110.14048) | | [ConFIG](https://torchjd.org/stable/docs/aggregation/config#torchjd.aggregation.ConFIG) | - | [ConFIG: Towards Conflict-free Training of Physics Informed Neural Networks](https://arxiv.org/pdf/2408.11104) | From b54a8aee6ad07a242330388605265c58f38229b4 Mon Sep 17 00:00:00 2001 From: Pierre Quinton Date: Fri, 30 Jan 2026 14:12:44 +0100 Subject: [PATCH 07/17] Fix link in CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 47049a6a..e5c02ebd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -299,7 +299,7 @@ Informed Neural Networks](https://arxiv.org/pdf/2408.11104). - `Aggregator` base class to aggregate Jacobian matrices. - `AlignedMTL` from [Independent Component Alignment for Multi-Task Learning]( - https://openaccess.thecvf.com/content/CVPR2023/papers/Senushkin_Independent_Component_Alignment_for_Multi-Task_Learning_CVPR_2023_paper.pdf>). + https://openaccess.thecvf.com/content/CVPR2023/html/Senushkin_Independent_Component_Alignment_for_Multi-Task_Learning_CVPR_2023_paper.html>). - `CAGrad` from [Conflict-Averse Gradient Descent for Multi-task Learning](https://arxiv.org/pdf/2110.14048.pdf). - `Constant` to aggregate with constant weights. From e409b13f23e5f262805468bea1b440a8266d43a7 Mon Sep 17 00:00:00 2001 From: Pierre Quinton Date: Fri, 30 Jan 2026 14:32:05 +0100 Subject: [PATCH 08/17] Fix link to AlignedMTL in changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e5c02ebd..552e5a59 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -299,7 +299,7 @@ Informed Neural Networks](https://arxiv.org/pdf/2408.11104). - `Aggregator` base class to aggregate Jacobian matrices. - `AlignedMTL` from [Independent Component Alignment for Multi-Task Learning]( - https://openaccess.thecvf.com/content/CVPR2023/html/Senushkin_Independent_Component_Alignment_for_Multi-Task_Learning_CVPR_2023_paper.html>). + https://openaccess.thecvf.com/content/CVPR2023/papers/Senushkin_Independent_Component_Alignment_for_Multi-Task_Learning_CVPR_2023_paper.pdf). - `CAGrad` from [Conflict-Averse Gradient Descent for Multi-task Learning](https://arxiv.org/pdf/2110.14048.pdf). - `Constant` to aggregate with constant weights. From 252791f1764af3cbe373126098c154709f3fe095 Mon Sep 17 00:00:00 2001 From: Pierre Quinton Date: Fri, 30 Jan 2026 15:22:09 +0100 Subject: [PATCH 09/17] change version of `lychee` --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ab52f704..2656ee36 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -89,7 +89,7 @@ jobs: uses: actions/checkout@v4 - name: Link Checker - uses: lycheeverse/lychee-action@v1.9.0 + uses: lycheeverse/lychee-action@v2 with: args: --verbose --no-progress "README.md" "CONTRIBUTING.md" "CHANGELOG.md" fail: true From 494bbe404b905ca28984532ec81b55a96d4f8a30 Mon Sep 17 00:00:00 2001 From: Pierre Quinton Date: Fri, 30 Jan 2026 15:25:45 +0100 Subject: [PATCH 10/17] make lychee test the whole repo. --- .github/workflows/tests.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2656ee36..ee10beaa 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -73,10 +73,6 @@ jobs: with: groups: doc - - name: Check documentation links - working-directory: docs - run: uv run make linkcheck - - name: Build Documentation working-directory: docs run: uv run make dirhtml @@ -91,8 +87,11 @@ jobs: - name: Link Checker uses: lycheeverse/lychee-action@v2 with: - args: --verbose --no-progress "README.md" "CONTRIBUTING.md" "CHANGELOG.md" + args: --verbose --no-progress "." fail: true + env: + # This reduces false positive due to rate limits + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} mypy: name: Run mypy From 4f25e6c790225464c2317fce4b7e5b56a7e119c5 Mon Sep 17 00:00:00 2001 From: Pierre Quinton Date: Sat, 31 Jan 2026 11:06:05 +0100 Subject: [PATCH 11/17] Exclude the template file for crawlers --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ee10beaa..8efe0678 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -87,7 +87,7 @@ jobs: - name: Link Checker uses: lycheeverse/lychee-action@v2 with: - args: --verbose --no-progress "." + args: --verbose --no-progress "." --exlude-path "docs/source/_templates/page.html" fail: true env: # This reduces false positive due to rate limits From d7a2ebee36a341e6258f502748c2aee82aa2807b Mon Sep 17 00:00:00 2001 From: Pierre Quinton Date: Sat, 31 Jan 2026 11:07:04 +0100 Subject: [PATCH 12/17] fixup --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8efe0678..ed403b74 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -87,7 +87,7 @@ jobs: - name: Link Checker uses: lycheeverse/lychee-action@v2 with: - args: --verbose --no-progress "." --exlude-path "docs/source/_templates/page.html" + args: --verbose --no-progress "." --exclude-path "docs/source/_templates/page.html" fail: true env: # This reduces false positive due to rate limits From 6347f5c24e086095ef38ad40335368431190323a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Val=C3=A9rian=20Rey?= Date: Sat, 31 Jan 2026 22:39:56 +0100 Subject: [PATCH 13/17] Fix linkChecker name --- .github/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ed403b74..008554b4 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -77,8 +77,8 @@ jobs: working-directory: docs run: uv run make dirhtml - linkChecker: - name: Check links in Markdown files + check-links: + name: Check no link is broken runs-on: ubuntu-latest steps: - name: Checkout code From ef24003ac99f5bea7c6fd0e2d5eef02aaa2d565e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Val=C3=A9rian=20Rey?= <31951177+ValerianRey@users.noreply.github.com> Date: Sat, 31 Jan 2026 22:40:59 +0100 Subject: [PATCH 14/17] Fix docstring formulation --- src/torchjd/aggregation/_aligned_mtl.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/torchjd/aggregation/_aligned_mtl.py b/src/torchjd/aggregation/_aligned_mtl.py index bf17006b..f0e62860 100644 --- a/src/torchjd/aggregation/_aligned_mtl.py +++ b/src/torchjd/aggregation/_aligned_mtl.py @@ -51,8 +51,8 @@ class AlignedMTL(GramianWeightedAggregator): uses the mean eigenvalue (as in the original implementation). .. note:: - This implementation was adapted from the official implementation, the repository was - deleted. + This implementation was adapted from the official implementation of SamsungLabs/MTL, + which is not available anymore at the time of writing. """ def __init__( From 50d27a93c9e49277555aa6207cf457811e3522f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Val=C3=A9rian=20Rey?= Date: Sat, 31 Jan 2026 23:15:11 +0100 Subject: [PATCH 15/17] Add cache --- .github/workflows/tests.yml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 008554b4..9c5fc591 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -84,10 +84,23 @@ jobs: - name: Checkout code uses: actions/checkout@v4 + # This will restore the cache for the current commit if it exists, or the most recent lychee + # cache otherwise (including those saved for the main branch). It will also save the cache at + # for the current commit if none existed for it, and only if the link check succeeded. We + # don't want to save a cache when the action failed, because the reason for failure might be + # temporary (rate limiting, network issue, etc.), and we always want to retry those links + # everytime this action is run. + - name: Restore lychee cache + uses: actions/cache@v4 + with: + path: .lycheecache + key: cache-lychee-${{ github.sha }} + restore-keys: cache-lychee- + - name: Link Checker uses: lycheeverse/lychee-action@v2 with: - args: --verbose --no-progress "." --exclude-path "docs/source/_templates/page.html" + args: --verbose --no-progress --cache --max-cache-age 1d "." --exclude-path "docs/source/_templates/page.html" fail: true env: # This reduces false positive due to rate limits From ce345ebbf7bd5151eb7f19eee5d6dbb228059090 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Val=C3=A9rian=20Rey?= Date: Sat, 31 Jan 2026 23:16:54 +0100 Subject: [PATCH 16/17] minor renamings --- .github/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 9c5fc591..b0bcacb3 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -97,13 +97,13 @@ jobs: key: cache-lychee-${{ github.sha }} restore-keys: cache-lychee- - - name: Link Checker + - name: Run lychee uses: lycheeverse/lychee-action@v2 with: args: --verbose --no-progress --cache --max-cache-age 1d "." --exclude-path "docs/source/_templates/page.html" fail: true env: - # This reduces false positive due to rate limits + # This reduces false positives due to rate limits GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} mypy: From 518854d3ccefa9196b6f0af72c8405ede52f0719 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Val=C3=A9rian=20Rey?= Date: Sat, 31 Jan 2026 23:21:59 +0100 Subject: [PATCH 17/17] typo --- .github/workflows/tests.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b0bcacb3..e48a7346 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -85,9 +85,9 @@ jobs: uses: actions/checkout@v4 # This will restore the cache for the current commit if it exists, or the most recent lychee - # cache otherwise (including those saved for the main branch). It will also save the cache at - # for the current commit if none existed for it, and only if the link check succeeded. We - # don't want to save a cache when the action failed, because the reason for failure might be + # cache otherwise (including those saved for the main branch). It will also save the cache for + # the current commit if none existed for it, and only if the link check succeeded. We don't + # want to save a cache when the action failed, because the reason for failure might be # temporary (rate limiting, network issue, etc.), and we always want to retry those links # everytime this action is run. - name: Restore lychee cache