-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Summary
Validate completeness of the circuit-tracer adapter abstraction layer introduced in the NNsight support workstream (S1–S9). The NNsight backend for circuit-tracer is functional and passes all parity tests, but several abstraction-layer concerns need validation before the circuit-tracer integration can be considered production-ready.
Priority: High
These items affect the long-term maintainability and correctness of the circuit-tracer adapter across both TransformerLens and NNsight backends.
Tasks
1. AnalysisStore backend-agnostic validation
Verify that AnalysisStore containers produced by circuit-tracer analysis operations are fully backend-agnostic — i.e., a consumer of analysis results cannot distinguish whether TransformerLens or NNsight was the execution backend. Check all stored tensor keys, metadata fields, and dataset columns.
2. Serialized artifact parity
Confirm that serialized analysis artifacts (saved via AnalysisStore.save() or similar) are byte-identical or structurally equivalent across backends. This includes tensor .pt files, dataset parquet shards, and any YAML/JSON metadata.
3. latent_model_handles lifecycle validation
The latent_model_handles mechanism (used for SAE activation caching during circuit-tracer graph construction) should be validated for proper cleanup across both backends. Ensure handles are properly released after analysis completes and no hooks/traces leak.
4. Cross-backend smoke test
Create a minimal end-to-end smoke test that:
- Runs a circuit-tracer analysis with TransformerLens backend
- Runs the same analysis with NNsight backend
- Compares the resulting graph structures (node counts, edge counts, feature attributions)
- Currently only unit-level parity tests exist (
test_adapters_circuit_tracer.py); a higher-level integration test would catch composition-level issues.
5. Protocol gaps documentation
Document any CircuitTracerProtocol or AnalysisOpProtocol methods that are backend-specific or have different semantics between TransformerLens and NNsight. Update docs/adapter_development_guide.md with a "Backend Compatibility Matrix" section.
Context
- Branch:
nnsight-support - Related files:
src/interpretune/adapters/circuit_tracer.py— adapter with dual-backend supportsrc/interpretune/analysis/— analysis operations and AnalysisStoretests/core/test_adapters_circuit_tracer.py— existing unit teststests/core/test_sae_backend_parity.py— SAE-level backend parity tests (reference pattern)