Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
f88db75
Processing functions (#1053)
bryce13950 Sep 21, 2025
037c6fb
Attempted Processing match (#1063)
bryce13950 Sep 21, 2025
dbbed51
Process restoration (#1064)
bryce13950 Sep 21, 2025
6a00384
Add missing configuration parameters
degenfabian Sep 21, 2025
7e691b3
Add missing configuration parameters
degenfabian Sep 21, 2025
8b434d7
Properly set up normalization_type and layer_norm_folding attributes …
degenfabian Sep 21, 2025
c0255e8
Process accuracy (#1067)
bryce13950 Sep 26, 2025
8a90656
Ablation hugging face weights (#1070)
bryce13950 Sep 27, 2025
d86abe3
Ci fixes (#1072)
bryce13950 Sep 29, 2025
ddcb4f5
Revision extra forwards (#1073)
bryce13950 Sep 30, 2025
35116ff
Test coverage (#1074)
bryce13950 Oct 9, 2025
fece8c9
Merge branch 'dev-3.x' into dev-3.x-folding
bryce13950 Oct 10, 2025
caf4c3d
Attention hooks full coverage for folding (#1078)
bryce13950 Oct 11, 2025
ed23558
Ci job splitting (#1079)
bryce13950 Oct 13, 2025
ebea4f4
fixed batch dimension (#1082)
bryce13950 Oct 14, 2025
445f747
fixed cache hooks (#1083)
bryce13950 Oct 14, 2025
f60e8d3
fixed bias displaying (#1084)
bryce13950 Oct 14, 2025
251b5ab
fixed return type none (#1085)
bryce13950 Oct 15, 2025
f053201
Create pass through for hooks in compatibility mode (#1086)
bryce13950 Oct 15, 2025
817be64
fixed alias hook props (#1087)
bryce13950 Oct 15, 2025
b6477a0
made all hooks show properly (#1088)
bryce13950 Oct 16, 2025
e44c59a
updated loading in main demo to use transformers bridge (#1010)
bryce13950 Oct 16, 2025
3380bc2
switch from poetry to uv (#1037)
mivanit Oct 16, 2025
92585df
addded full kv cache (#1089)
bryce13950 Oct 16, 2025
27ef95c
Added full hook coverage for previous keys (#988)
bryce13950 Oct 16, 2025
42e09fe
updated loading in arena content demo to use transformer bridge (#1012)
degenfabian Oct 16, 2025
674f3a4
fixed first two tests
bryce13950 Oct 16, 2025
8b259a2
regeneerated with new hooks (#1091)
bryce13950 Oct 16, 2025
d6934cb
added test coverage for ensuring compatibility (#989)
bryce13950 Oct 16, 2025
3e64a48
Revert "fixed first two tests"
bryce13950 Oct 17, 2025
0747ec8
Test hook shape coverage (#1000)
bryce13950 Oct 17, 2025
c2fa6d8
Hook compatibility (#1092)
bryce13950 Oct 23, 2025
01db4e1
Final compatibility coverage (#1090)
bryce13950 Oct 23, 2025
c6bed77
tested llama 3.1 (#1096)
bryce13950 Oct 29, 2025
0a677fb
fixed stop at layer (#1100)
bryce13950 Oct 30, 2025
84565f1
Duplicate hook fix (#1098)
bryce13950 Oct 30, 2025
9801060
Gemma2 fix (#1099)
bryce13950 Oct 30, 2025
9003f80
Fix gpt oss (#1101)
bryce13950 Nov 5, 2025
0165122
created benchmark suite (#1104)
bryce13950 Nov 5, 2025
4239a26
finalized t5 adapter (#1095)
bryce13950 Nov 5, 2025
7aca605
Model improvements (#1105)
bryce13950 Nov 6, 2025
931b45f
decoupling weight processing completely from hooked transformer (#1103)
bryce13950 Nov 6, 2025
7abff67
removed invalid comparison (#1107)
bryce13950 Nov 6, 2025
905fe6d
Revert "decoupling weight processing completely from hooked transform…
bryce13950 Nov 6, 2025
eb63a26
finalized bench mark logic (#1109)
bryce13950 Nov 6, 2025
ee9dbf1
Fix opt (#1106)
bryce13950 Nov 6, 2025
07377ad
Benchmarking and compatibility only (#1112)
bryce13950 Nov 7, 2025
268b76e
Decouple weight procesing (#1114)
bryce13950 Nov 8, 2025
86ea8a4
optimized benchmarks a bit (#1115)
bryce13950 Nov 8, 2025
9ad8198
fixed tensor storing (#1116)
bryce13950 Nov 8, 2025
3839661
added skip condition (#1117)
bryce13950 Nov 8, 2025
39e33e4
Gpt2 weight match (#1118)
bryce13950 Nov 9, 2025
c652b85
Gemma3 match (#1119)
bryce13950 Nov 9, 2025
9bd0cbe
setup real aliases (#1121)
bryce13950 Nov 10, 2025
25da794
Gpt oss match (#1120)
bryce13950 Nov 11, 2025
fadc50f
trimmed memory a bit (#1122)
bryce13950 Nov 12, 2025
04ef490
created benchmark suite for unsupported models in hooked transformer …
bryce13950 Nov 12, 2025
5bcf34e
fixed remaining gemma 3 benchmarks (#1124)
bryce13950 Nov 12, 2025
f1f774b
Gated MLP bridge (#1110)
bryce13950 Nov 12, 2025
4643ffb
setup brenchmark suite, and trimmed out extra tests (#1125)
bryce13950 Nov 12, 2025
4715592
Attention cleanup (#1126)
bryce13950 Nov 12, 2025
eb60dea
Benchmarking cross comparison revision (#1127)
bryce13950 Nov 12, 2025
80bc515
Oss match (#1128)
bryce13950 Nov 13, 2025
3efbd6e
Cleanup (#1129)
bryce13950 Nov 15, 2025
5fc23e7
Weight processing generalization (#1131)
bryce13950 Nov 17, 2025
86bea0d
Processing cleanup (#1132)
bryce13950 Nov 20, 2025
36f1c0a
Final cleanup (#1135)
bryce13950 Nov 21, 2025
41e6d4a
Supported Architectures – code artifact cleanup (#1136)
jlarson4 Nov 22, 2025
20a57dd
Qwen3 adapter (#1138)
bryce13950 Nov 23, 2025
69db6a3
Model Bridge – Source Keys Cleanup (#1137)
jlarson4 Nov 23, 2025
5babde2
cleaned up a lot of things (#1113)
bryce13950 Dec 7, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
183 changes: 132 additions & 51 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ on:
required: false
secrets:
HF_TOKEN:
required: false
required: false

permissions:
actions: write
Expand All @@ -47,37 +47,52 @@ jobs:
name: Compatibility Checks
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version:
- "3.10"
- "3.11"
- "3.12"
steps:
- uses: actions/checkout@v3
- name: Install Poetry
uses: snok/install-poetry@v1
- name: Set up Python
uses: actions/setup-python@v4
- name: Install uv
uses: astral-sh/setup-uv@v6
with:
python-version: ${{ matrix.python-version }}
cache: "poetry"
activate-environment: true
enable-cache: true
- name: Cache Models used with Tests
uses: actions/cache@v3
with:
path: |
~/.cache/huggingface/hub/models--gpt2
~/.cache/huggingface/hub/models--distilgpt2
~/.cache/huggingface/hub/models--EleutherAI--pythia-70m
~/.cache/huggingface/hub/models--EleutherAI--gpt-neo-125M
~/.cache/huggingface/hub/models--google--gemma-2-2b-it
~/.cache/huggingface/hub/models--bigscience--bloom-560m
~/.cache/huggingface/hub/models--Qwen--Qwen2-0.5B
~/.cache/huggingface/hub/models--bert-base-cased
~/.cache/huggingface/hub/models--NeelNanda--Attn_Only*
~/.cache/huggingface/hub/models--roneneldan--TinyStories-1M*
key: ${{ runner.os }}-huggingface-models
~/.cache/huggingface/hub/models--NeelNanda--SoLU*
~/.cache/huggingface/hub/models--ArthurConmy--redwood_attn_2l
~/.cache/huggingface/hub/models--stas--tiny-random-llama-2
~/.cache/huggingface/hub/models--microsoft--DialoGPT-medium
key: ${{ runner.os }}-huggingface-models-v4
restore-keys: |
${{ runner.os }}-huggingface-models-v2
${{ runner.os }}-huggingface-models-v1
${{ runner.os }}-huggingface-models
- name: Install dependencies
run: |
poetry check --lock
poetry install --with dev
uv lock --check
uv sync
- name: Authenticate HuggingFace CLI
if: env.HF_TOKEN != ''
run: |
pip install huggingface_hub
huggingface-cli login --token "$HF_TOKEN"
uv pip install huggingface_hub
uv run huggingface-cli login --token "$HF_TOKEN"
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
- name: Unit Test
Expand All @@ -87,51 +102,117 @@ jobs:
- name: Acceptance Test
run: make acceptance-test
- name: Build check
run: poetry build
run: uv build

format-check:
name: Format Check
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
- name: Install uv
uses: astral-sh/setup-uv@v6
with:
python-version: "3.12"
activate-environment: true
enable-cache: true
- name: Install dependencies
run: |
uv lock --check
uv sync
- name: Check format
run: make check-format

type-check:
name: Type Check
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v3
- name: Install uv
uses: astral-sh/setup-uv@v6
with:
python-version: "3.12"
activate-environment: true
enable-cache: true
- name: Install dependencies
run: |
uv lock --check
uv sync
- name: Type check
run: uv run mypy .

code-checks:
name: Code Checks
docstring-test:
name: Docstring Test
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v3
- name: Install Poetry
uses: snok/install-poetry@v1
- name: Set up Python
uses: actions/setup-python@v4
- name: Install uv
uses: astral-sh/setup-uv@v6
with:
python-version: "3.12"
cache: "poetry"
activate-environment: true
enable-cache: true
- name: Install dependencies
run: |
uv lock --check
uv sync
- name: Docstring test
run: make docstring-test

coverage-test:
name: Full Code Coverage Test
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v3
- name: Install uv
uses: astral-sh/setup-uv@v6
with:
python-version: "3.12"
activate-environment: true
enable-cache: true
- name: Cache Models used with Tests
uses: actions/cache@v3
with:
path: |
~/.cache/huggingface/hub/models--gpt2
~/.cache/huggingface/hub/models--distilgpt2
~/.cache/huggingface/hub/models--EleutherAI--pythia-70m
~/.cache/huggingface/hub/models--EleutherAI--gpt-neo-125M
~/.cache/huggingface/hub/models--google--gemma-2-2b-it
~/.cache/huggingface/hub/models--bigscience--bloom-560m
~/.cache/huggingface/hub/models--Qwen--Qwen2-0.5B
~/.cache/huggingface/hub/models--bert-base-cased
~/.cache/huggingface/hub/models--NeelNanda--Attn_Only*
~/.cache/huggingface/hub/models--roneneldan--TinyStories-1M*
key: ${{ runner.os }}-huggingface-models
~/.cache/huggingface/hub/models--NeelNanda--SoLU*
~/.cache/huggingface/hub/models--ArthurConmy--redwood_attn_2l
~/.cache/huggingface/hub/models--stas--tiny-random-llama-2
~/.cache/huggingface/hub/models--microsoft--DialoGPT-medium
key: ${{ runner.os }}-huggingface-models-v4
restore-keys: |
${{ runner.os }}-huggingface-models-v2
${{ runner.os }}-huggingface-models-v1
${{ runner.os }}-huggingface-models
- name: Install dependencies
run: |
poetry check --lock
poetry install --with dev
- name: Check format
run: make check-format
- name: Docstring test
run: make docstring-test
- name: Type check
run: poetry run mypy .
uv lock --check
uv sync
- name: Authenticate HuggingFace CLI
if: env.HF_TOKEN != ''
run: |
pip install huggingface_hub
huggingface-cli login --token "$HF_TOKEN"
uv pip install huggingface_hub
uv run huggingface-cli login --token "$HF_TOKEN"
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
- name: Test Suite with Coverage Report
run: make coverage-report-test
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
- name: Build check
run: poetry build
run: uv build
- name: Upload Coverage Report Artifact
uses: actions/upload-artifact@v4
with:
Expand All @@ -142,12 +223,12 @@ jobs:
name: Notebook Checks
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
notebook:
# - "Activation_Patching_in_TL_Demo"
# - "Attribution_Patching_Demo"
- "ARENA_Content"
- "Colab_Compatibility"
- "BERT"
- "Exploratory_Analysis_Demo"
# - "Grokking_Demo"
Expand All @@ -162,30 +243,29 @@ jobs:
# - "T5"
steps:
- uses: actions/checkout@v3
- name: Install Poetry
uses: snok/install-poetry@v1
- name: Set up Python
uses: actions/setup-python@v4
- name: Install uv
uses: astral-sh/setup-uv@v6
with:
python-version: "3.11"
cache: "poetry"
activate-environment: true
enable-cache: true
- name: Re-use HuggingFace models cache
uses: actions/cache/restore@v3
with:
path: ~/.cache/huggingface/hub
key: ${{ runner.os }}-huggingface-models
- name: Install dependencies
run: |
poetry check --lock
poetry install --with dev,jupyter
uv lock --check
uv sync
- name: Install pandoc
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: pandoc
version: 1.0
- name: Check Notebook Output Consistency
# Note: currently only checks notebooks we have specifically setup for this
run: poetry run pytest --nbval-sanitize-with demos/doc_sanitize.cfg demos/${{ matrix.notebook }}.ipynb
run: pytest --nbval-sanitize-with demos/doc_sanitize.cfg demos/${{ matrix.notebook }}.ipynb


build-docs:
Expand All @@ -194,23 +274,24 @@ jobs:
name: 'Build Docs'
runs-on: ubuntu-latest
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev') || contains(github.head_ref, 'docs')
needs: code-checks
needs: coverage-test
steps:
- uses: actions/checkout@v4
- name: Install Poetry
uses: snok/install-poetry@v1
- name: Set up Python
uses: actions/setup-python@v4
- name: Install uv
uses: astral-sh/setup-uv@v6
with:
python-version: "3.11"
cache: "poetry"
activate-environment: true
enable-cache: true
- name: Install pandoc
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: pandoc
version: 1.0
- name: Install dependencies
run: poetry install --with docs
run: |
uv lock --check
uv sync
- name: Download Test Coverage Artifact
uses: actions/download-artifact@v4
with:
Expand All @@ -219,12 +300,12 @@ jobs:
- name: Authenticate HuggingFace CLI
if: env.HF_TOKEN != ''
run: |
pip install huggingface_hub
huggingface-cli login --token "$HF_TOKEN"
uv pip install huggingface_hub
uv run huggingface-cli login --token "$HF_TOKEN"
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
- name: Build Docs
run: poetry run build-docs
run: make build-docs
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
- name: Upload Docs Artifact
Expand All @@ -251,4 +332,4 @@ jobs:
with:
folder: docs/build
clean-exclude: |
*.*.*/
*.*.*/
27 changes: 15 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,22 +43,25 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Poetry
uses: snok/install-poetry@v1
- name: Set up Python
uses: actions/setup-python@v4
- name: Install uv
uses: astral-sh/setup-uv@v6
with:
python-version: '3.11'
cache: 'poetry'
- name: Poetry config
run: poetry self add 'poethepoet[poetry_plugin]'
activate-environment: true
enable-cache: true
- name: Install dependencies
run: poetry install --with dev
run: |
uv lock --check
uv sync --locked
- name: Set the version
run: poetry version ${{needs.semver-parser.outputs.semver}}
run: make version-set VERSION=${{needs.semver-parser.outputs.semver}}
- name: re-sync
run: uv sync
- name: Build
run: poetry build
run: uv build
- name: Publish
run: poetry publish
run: |
python -m pip install --upgrade twine
twine upload --non-interactive -u __token__ -p "$PYPI_TOKEN_PYPI" dist/*
env:
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN_PYPI }}
PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN_PYPI }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ docs/build
.coverage*
.Ds_Store
.pylintrc

docs/source/generated
# docs/source/_static/model_table
**.orig
.venv

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ logits, activations = model.run_with_cache("Hello World")
## Key Tutorials

* [Introduction to the Library and Mech
Interp](https://arena3-chapter1-transformer-interp.streamlit.app/[1.2]_Intro_to_Mech_Interp)
Interp](https://arena-chapter1-transformer-interp.streamlit.app/[1.2]_Intro_to_Mech_Interp)
* [Demo of Main TransformerLens Features](https://neelnanda.io/transformer-lens-demo)

## Gallery
Expand Down
Loading
Loading