Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 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
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
177 changes: 127 additions & 50 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 @@ -54,30 +54,43 @@ jobs:
- "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-v2
restore-keys: |
${{ 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 +100,116 @@ 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-v2
restore-keys: |
${{ 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 @@ -147,7 +225,6 @@ jobs:
# - "Activation_Patching_in_TL_Demo"
# - "Attribution_Patching_Demo"
- "ARENA_Content"
- "Colab_Compatibility"
- "BERT"
- "Exploratory_Analysis_Demo"
# - "Grokking_Demo"
Expand All @@ -162,30 +239,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 +270,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 +296,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 Down
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 }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@ docs/build
.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