Skip to content

Commit 7deb5dc

Browse files
authored
Merge branch 'main' into chore/use-glm-5.2-in-opencode-action
2 parents 03e00cc + 09968d2 commit 7deb5dc

21 files changed

Lines changed: 1459 additions & 24 deletions

File tree

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,29 @@ changelog does not include internal changes that do not affect the user.
88

99
## [Unreleased]
1010

11+
## [0.17.0] - 2026-06-24
12+
13+
### Added
14+
15+
- Added `ExcessMTL` and `ExcessMTLWeighting` from [Robust Multi-Task Learning with Excess
16+
Risks](https://proceedings.mlr.press/v235/he24n.html) (ICML 2024). `ExcessMTLWeighting` is a
17+
stateful `Weighting` that maintains task weights across calls via an exponentiated gradient update
18+
driven by per-task excess risk estimates. The excess risk is approximated using an AdaGrad-style
19+
diagonal Hessian. An optional `n_warmup_steps` parameter controls how many forward calls collect
20+
gradient statistics before weight updates begin.
21+
22+
## [0.16.0] - 2026-06-22
23+
1124
### Added
1225

1326
- Added `COSMOS` from [Scalable Pareto Front Approximation for Deep Multi-Objective
1427
Learning](https://arxiv.org/pdf/2103.13392) (ICDM 2021), a `Scalarizer` that combines a linear
1528
scalarization with a cosine-similarity penalty pulling the vector of values toward a preference
1629
direction.
30+
- Added `PBI` (Penalty-based Boundary Intersection) from [MOEA/D: A Multiobjective Evolutionary
31+
Algorithm Based on Decomposition](https://ieeexplore.ieee.org/document/4358754) (IEEE TEVC 2007), a
32+
`Scalarizer` that decomposes the values into a component along a preference direction and a
33+
penalized perpendicular component.
1734

1835
## [0.15.0] - 2026-06-15
1936

CONTRIBUTING.md

Lines changed: 7 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,13 @@ CC=gcc uv pip install --python-version=3.14 -e '.[full]' --group check --group d
9595
uv run pre-commit install
9696
```
9797

98+
## Working with agents
99+
100+
We encourage contributors to use AI agents when contributing to TorchJD, but there are a few rules:
101+
- The initiative should come from a human. We do not want PRs from fully automated bots.
102+
- The changes should be reviewed by a human before a non-draft PR is open.
103+
- To avoid vendor lock-in, we do not provide any file that is specific to an agent vendor. To use a specific agent that does not follow open file naming conventions, you have to adapt a few things yourself (e.g. symlink files). For example, to work with claude, you have to symlink `CLAUDE.md` to `AGENTS.md`, and `.claude/skill/` to `skills/`.
104+
98105
## Checks
99106

100107
### Running tests
@@ -275,26 +282,3 @@ The three plot scripts produce PDFs saved to `tests/trajectories/results/<object
275282
> [!NOTE]
276283
> The plot scripts require a LaTeX installation for rendering:
277284
> `sudo apt-get install texlive-latex-extra texlive-fonts-recommended dvipng cm-super`
278-
279-
280-
## Release
281-
282-
*This section is addressed to maintainers.*
283-
284-
To release a new `torchjd` version, you have to:
285-
- If the release introduces changes to the interface, make sure that `README.md` reflects those
286-
changes.
287-
- Make sure that all tests, including those on cuda, pass (for this, you need access to a machine
288-
that has a cuda-enabled GPU).
289-
- Make sure that all important changes since the last release have been reported in the
290-
`[Unreleased]` section at the top of the changelog.
291-
- Add a `[X.Y.Z] - yyyy-mm-dd` header in the changelog just below the `[Unreleased]` header.
292-
- Change the version in `pyproject.toml`.
293-
- Make a pull request with those changes and merge it.
294-
- Make a draft of the release on GitHub (click on `Releases`, then `Draft a new release`, then fill
295-
the details).
296-
- Publish the release (click on `Publish release`). This should trigger the deployment of the new
297-
version on PyPI and the building and deployment of the documentation on github-pages.
298-
- Check that the new version is correctly deployed to PyPI, that it is installable and that it
299-
works.
300-
- Check that the documentation has been correctly deployed.

NOTICES

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,34 @@ SOFTWARE.
143143

144144
-------------------------------------------------------------------------------
145145

146+
Project: ExcessMTL
147+
Source: https://github.com/uiuctml/ExcessMTL/blob/main/LibMTL/LibMTL/weighting/ExcessMTL.py
148+
Used in: src/torchjd/aggregation/_excess_mtl.py
149+
150+
MIT License
151+
152+
Copyright (c) 2024 UIUC TML Lab
153+
154+
Permission is hereby granted, free of charge, to any person obtaining a copy
155+
of this software and associated documentation files (the "Software"), to deal
156+
in the Software without restriction, including without limitation the rights
157+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
158+
copies of the Software, and to permit persons to whom the Software is
159+
furnished to do so, subject to the following conditions:
160+
161+
The above copyright notice and this permission notice shall be included in all
162+
copies or substantial portions of the Software.
163+
164+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
165+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
166+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
167+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
168+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
169+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
170+
SOFTWARE.
171+
172+
-------------------------------------------------------------------------------
173+
146174
Project: SDMGrad
147175
Source: https://github.com/OptMN-Lab/SDMGrad/blob/main/methods/weight_methods.py
148176
Used in: src/torchjd/aggregation/_sdmgrad.py

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,7 @@ TorchJD provides many existing aggregators from the literature, listed in the fo
231231
| [Constant](https://torchjd.org/stable/docs/aggregation/constant#torchjd.aggregation.Constant) | [ConstantWeighting](https://torchjd.org/stable/docs/aggregation/constant#torchjd.aggregation.ConstantWeighting) | - |
232232
| - | [CRMOGMWeighting](https://torchjd.org/stable/docs/aggregation/cr_mogm/#torchjd.aggregation.CRMOGMWeighting) | [On the Convergence of Stochastic Multi-Objective Gradient Manipulation and Beyond](https://proceedings.neurips.cc/paper_files/paper/2022/file/f91bd64a3620aad8e70a27ad9cb3ca57-Paper-Conference.pdf) |
233233
| [DualProj](https://torchjd.org/stable/docs/aggregation/dualproj#torchjd.aggregation.DualProj) | [DualProjWeighting](https://torchjd.org/stable/docs/aggregation/dualproj#torchjd.aggregation.DualProjWeighting) | [Gradient Episodic Memory for Continual Learning](https://arxiv.org/pdf/1706.08840) |
234+
| [ExcessMTL](https://torchjd.org/stable/docs/aggregation/excess_mtl#torchjd.aggregation.ExcessMTL) | [ExcessMTLWeighting](https://torchjd.org/stable/docs/aggregation/excess_mtl#torchjd.aggregation.ExcessMTLWeighting) | [Robust Multi-Task Learning with Excess Risks](https://proceedings.mlr.press/v235/he24n.html) |
234235
| [FairGrad](https://torchjd.org/stable/docs/aggregation/fairgrad#torchjd.aggregation.FairGrad) | [FairGradWeighting](https://torchjd.org/stable/docs/aggregation/fairgrad#torchjd.aggregation.FairGradWeighting) | [Fair Resource Allocation in Multi-Task Learning](https://arxiv.org/pdf/2402.15638) |
235236
| [GradDrop](https://torchjd.org/stable/docs/aggregation/graddrop#torchjd.aggregation.GradDrop) | - | [Just Pick a Sign: Optimizing Deep Multitask Models with Gradient Sign Dropout](https://arxiv.org/pdf/2010.06808) |
236237
| [GradVac](https://torchjd.org/stable/docs/aggregation/gradvac#torchjd.aggregation.GradVac) | [GradVacWeighting](https://torchjd.org/stable/docs/aggregation/gradvac#torchjd.aggregation.GradVacWeighting) | [Gradient Vaccine: Investigating and Improving Multi-task Optimization in Massively Multilingual Models](https://arxiv.org/pdf/2010.05874) |
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
:hide-toc:
2+
3+
ExcessMTL
4+
=========
5+
6+
.. autoclass:: torchjd.aggregation.ExcessMTL
7+
:members: __call__, reset
8+
9+
.. autoclass:: torchjd.aggregation.ExcessMTLWeighting
10+
:members: __call__, reset

docs/source/docs/aggregation/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ Abstract base classes
3030
constant.rst
3131
cr_mogm.rst
3232
dualproj.rst
33+
excess_mtl.rst
3334
fairgrad.rst
3435
graddrop.rst
3536
gradvac.rst

docs/source/docs/scalarization/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Abstract base class
2121
geometric_mean.rst
2222
imtl_l.rst
2323
mean.rst
24+
pbi.rst
2425
random.rst
2526
stch.rst
2627
sum.rst
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
:hide-toc:
2+
3+
PBI
4+
===
5+
6+
.. autoclass:: torchjd.scalarization.PBI
7+
:members: __call__

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "torchjd"
7-
version = "0.15.0"
7+
version = "0.17.0"
88
description = "Library for Jacobian Descent with PyTorch."
99
readme = "README.md"
1010
authors = [

skills/check-release/SKILL.md

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
---
2+
name: check-release
3+
description: Verifies that a TorchJD release was published correctly by checking the docs site, installing from PyPI, and smoke-testing newly added classes. Use after a release has been merged and published.
4+
---
5+
6+
# Check TorchJD Release
7+
8+
This skill verifies that a release is live and correct after it has been published.
9+
10+
**For agents:** invoke as `/check-release X.Y.Z` (e.g. `/check-release 0.16.0`).
11+
If no version is provided, read the current version from `pyproject.toml`.
12+
13+
---
14+
15+
## Instructions
16+
17+
### Step 1: Determine the version
18+
19+
Read `pyproject.toml` to find the `version` field under `[project]`. Use the version provided as
20+
an argument, or the one from `pyproject.toml` if none is given.
21+
22+
### Step 2: Identify newly added classes
23+
24+
Read `CHANGELOG.md` and find the `## [X.Y.Z]` section. Extract the names of any newly added
25+
public classes, functions, or methods listed under `### Added`. You will use these in later steps.
26+
27+
### Step 3: Check the docs site
28+
29+
Fetch `https://torchjd.org`.
30+
31+
- Verify that the versions dropdown (or switcher) includes `vX.Y.Z` as an entry.
32+
- Verify that the `stable` entry is present.
33+
34+
If the version entry is missing, report it and stop — the rest of the checks depend on the docs
35+
being live.
36+
37+
### Step 4: Verify the new-version docs contain the newly added classes
38+
39+
For each newly added class or function identified in Step 2, fetch its expected docs page under
40+
`https://torchjd.org/vX.Y.Z/`. Use the URL patterns from similar existing classes found in
41+
`README.md` or by browsing the stable docs (`https://torchjd.org/stable/`) to infer the correct
42+
path (e.g. `https://torchjd.org/vX.Y.Z/docs/aggregation`,
43+
`https://torchjd.org/vX.Y.Z/docs/scalarization`, etc.).
44+
45+
Confirm that each new class/function name appears on the fetched page.
46+
47+
### Step 5: Verify the stable docs also reflect the new version
48+
49+
Fetch the same doc pages under `https://torchjd.org/stable/` and confirm the newly added
50+
classes/functions appear there too (i.e. `stable` points to the new release).
51+
52+
### Step 6: Install torchjd from PyPI in a temp environment
53+
54+
Run the following commands to create an isolated install:
55+
56+
```bash
57+
cd /tmp && mkdir -p test_torchjd_install && cd test_torchjd_install
58+
uv venv && uv pip install torchjd
59+
```
60+
61+
Verify the installed version matches X.Y.Z:
62+
63+
```bash
64+
cd /tmp/test_torchjd_install && uv pip show torchjd
65+
```
66+
67+
If the version is wrong, you may need to install with `--no-cache`.
68+
69+
### Step 7: Smoke-test the newly added classes
70+
71+
Write a minimal Python script `/tmp/test_torchjd_install/smoke_test.py` that:
72+
73+
- Imports each newly added class or function by its fully-qualified name from `torchjd`.
74+
- Instantiates or calls each one with a minimal valid input (e.g. a small `torch.Tensor`, a dummy
75+
preference vector, or no arguments if the class takes none).
76+
- Does NOT assert correctness of values — only that the code runs without raising an exception.
77+
78+
Use the existing test suite under `tests/` or the docs pages fetched in Step 4 as a reference for
79+
correct import paths and minimal usage patterns.
80+
81+
Run the script:
82+
83+
```bash
84+
cd /tmp/test_torchjd_install && uv run python smoke_test.py
85+
```
86+
87+
Report the result. If it crashes, show the traceback.
88+
89+
### Step 8: Clean up
90+
91+
```bash
92+
rm -rf /tmp/test_torchjd_install
93+
```
94+
95+
### Step 9: Report
96+
97+
Summarize what was verified:
98+
- Docs site: version dropdown ✓/✗, new-version page ✓/✗, stable page ✓/✗
99+
- PyPI install: version matches ✓/✗
100+
- Smoke test: each newly added class ✓/✗ (list them)
101+
102+
If everything passes, the release is confirmed good. If anything failed, describe what needs
103+
attention.

0 commit comments

Comments
 (0)