Skip to content

Commit eaee3e5

Browse files
author
semantic-release
committed
0.13.3
Automatically generated by python-semantic-release
1 parent 315088c commit eaee3e5

3 files changed

Lines changed: 43 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,47 @@
11
# CHANGELOG
22

33

4+
## v0.13.3 (2026-07-27)
5+
6+
### Performance Improvements
7+
8+
- Remove torch.compile from normalizers (fixes import on Python 3.14)
9+
([#361](https://github.com/EleutherAI/bergson/pull/361),
10+
[`315088c`](https://github.com/EleutherAI/bergson/commit/315088c21fd17c9d2663b5172214688030baf67d))
11+
12+
* fix: guard torch.compile so bergson imports on Python 3.14
13+
14+
torch.compile raises RuntimeError at decoration time on interpreters Dynamo doesn't support (Python
15+
3.14+ with torch <= 2.9). The normalizers in bergson/gradients.py apply it at import time, so
16+
importing bergson crashed outright on 3.14.
17+
18+
- Add compile_if_supported: falls back to the eager function with a warning when torch.compile is
19+
unavailable - Add tests covering the fallback path, including a subprocess test that simulates the
20+
3.14 condition on any interpreter - Add an import-py314 CI job that installs bergson on Python
21+
3.14 and imports it, catching future import-time regressions
22+
23+
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
24+
25+
* ci: run compile-fallback tests on the Python 3.14 job
26+
27+
* perf: remove torch.compile from normalizers
28+
29+
A100 benchmarks (torch 2.7.1, py3.11) show the compiled normalizers are net slower in the common
30+
case: ~50us of dynamo guard overhead per call dominates the sub-100us kernels at 768-dim shapes
31+
and on every bias path, and each run pays 0.3-1.5s compile latency per graph (17 graphs observed
32+
from bin-packing's varying batch sizes). Compiled kernels only win on very large tensors (up to
33+
~2x on [4, 50304, 768] bf16), a regime worth a few percent of end-to-end build time at most, and
34+
only when --optimizer_state is set.
35+
36+
Removing the decorators also makes bergson importable on Python 3.14, where torch.compile raises at
37+
decoration time (torch <= 2.9). The import-py314 CI job guards against reintroducing import-time
38+
compiles.
39+
40+
---------
41+
42+
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
43+
44+
445
## v0.13.2 (2026-07-24)
546

647
### Bug Fixes

bergson/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = "0.13.2"
1+
__version__ = "0.13.3"
22

33
import logging
44

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ dependencies = [
3737
"bitsandbytes",
3838
"huggingface-hub>=1.13.0",
3939
]
40-
version = "0.13.2"
40+
version = "0.13.3"
4141
[project.optional-dependencies]
4242
dev = [
4343
"pre-commit",

0 commit comments

Comments
 (0)