Skip to content

Commit fa72687

Browse files
author
semantic-release
committed
chore(release): 0.21.2
1 parent ebdaae5 commit fa72687

File tree

3 files changed

+34
-2
lines changed

3 files changed

+34
-2
lines changed

CHANGELOG.md

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

33

4+
## v0.21.2 (2026-03-09)
5+
6+
### Bug Fixes
7+
8+
- **vis**: Avoid graphviz.Digraph memory bomb when ELK fails on large graphs
9+
([`f5563ee`](https://github.com/johnmarktaylor91/torchlens/commit/f5563eee457383772c9b148cca058b87e126b6b3))
10+
11+
When ELK layout fails (OOM/timeout) on 1M+ node graphs, the fallback path previously built a
12+
graphviz.Digraph in Python — nested subgraph body-list copies exploded memory and hung
13+
indefinitely. Now render_elk_direct handles the failure internally: reuses already-collected Phase
14+
1 data to generate DOT text without positions and renders directly with sfdp, bypassing
15+
graphviz.Digraph entirely.
16+
17+
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
18+
19+
- **vis**: Bypass ELK for large graphs — use Python topological layout
20+
([`37cce3a`](https://github.com/johnmarktaylor91/torchlens/commit/37cce3ab5607591f622b4fd7f5916bca16736d59))
21+
22+
ELK's stress algorithm allocates TWO O(n²) distance matrices (n² × 16 bytes). At 100k nodes that's
23+
160 GB, at 1M nodes it's 16 TB — the root cause of the std::bad_alloc. The old >150k stress switch
24+
could never work.
25+
26+
For graphs above 100k nodes, we now skip ELK entirely and compute a topological rank layout in
27+
Python (Kahn's algorithm, O(n+m)). Module bounding boxes are computed from node positions. The
28+
result feeds into the same neato -n rendering path, preserving cluster boxes.
29+
30+
If ELK fails for smaller graphs, the Python layout is also used as a fallback instead of the old
31+
sfdp path that built a graphviz.Digraph (which exploded on nested subgraph body-list copies).
32+
33+
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
34+
35+
436
## v0.21.1 (2026-03-09)
537

638
### Bug Fixes

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 = "torchlens"
7-
version = "0.21.1"
7+
version = "0.21.2"
88
description = "A package for extracting activations from PyTorch models"
99
readme = "README.md"
1010
license = "GPL-3.0-only"

torchlens/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
first imported. See the bottom of this file for details.
1010
"""
1111

12-
__version__ = "0.21.1"
12+
__version__ = "0.21.2"
1313

1414
# ---- Public API: user-facing entry points --------------------------------
1515

0 commit comments

Comments
 (0)