Skip to content

Use new proposed AttributionTargets API for circuit-tracer, misc infra improvements#187

Merged
speediedan merged 2 commits intomainfrom
ct-attribution-targets
Nov 7, 2025
Merged

Use new proposed AttributionTargets API for circuit-tracer, misc infra improvements#187
speediedan merged 2 commits intomainfrom
ct-attribution-targets

Conversation

@speediedan
Copy link
Copy Markdown
Owner

This PR updates the circuit-tracer integration to use the new proposed AttributionTargets API, switches basic examples to use CLT by default, improves infrastructure utilities, and includes minor test adjustments for PyTorch 2.9 compatibility. Changes span the circuit_tracer adapter, attribution analysis notebooks, example scripts, version management, and CI requirements.
pending circuit-tracer PRs used:
Attribution Targets Encapsulation
Allow offload_modules to handle single module and container offloading cases
Expand Range of GPUs Capable of Running Full Test Suite

Copilot AI review requested due to automatic review settings November 7, 2025 18:46
@github-actions github-actions bot added module: adapters Adapter system area: examples Example code and demos area: notebooks Jupyter notebooks area: tests Testing code area: docs Documentation files area: build Build system and packaging area: scripts Shell scripts and automation dependencies Dependency updates config Configuration file changes adapter: circuit_tracer Circuit tracer adapter labels Nov 7, 2025
@github-actions
Copy link
Copy Markdown

github-actions bot commented Nov 7, 2025

No CI pin file changes detected by regen-ci-req-check.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates the circuit-tracer dependency to a newer commit and implements package name normalization according to PEP 503 to better handle packages with different naming conventions (hyphens vs underscores).

Key Changes:

  • Updates circuit-tracer commit pin from b228bf1... to 004f1b2... across all dependency files and notebooks
  • Implements PEP 503 package name normalization in PackageVersionManager to canonicalize package names (converting underscores, dots to hyphens)
  • Refactors circuit-tracer API usage to use attribution_targets parameter instead of analysis_target_indices

Reviewed Changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/it_examples/utils/analysis_injection/version_manager.py Added _normalize_package_name() method for PEP 503 normalization; removed duplicate GIT_FALLBACK_URLS entry; updated circuit-tracer commit pin
tests/examples/test_version_manager.py Added tests for package name normalization functionality
src/interpretune/adapters/circuit_tracer.py Renamed _get_analysis_target_indices() to _get_attribution_targets() and updated to use new attribution_targets parameter
src/it_examples/notebooks/publish/attribution_analysis/analysis_points.py Updated to use targets object instead of separate logit_idx and logit_p variables; simplified annotation text
src/it_examples/notebooks/dev/attribution_analysis/analysis_points.py Same changes as publish version
src/it_examples/notebooks/publish/circuit_tracer_examples/circuit_tracer_adapter_example_basic_clt.ipynb Formatting improvements to split long f-strings and updated default parameter value
src/it_examples/notebooks/dev/circuit_tracer_examples/circuit_tracer_adapter_example_basic_clt.ipynb Same changes as publish version
src/it_examples/notebooks/publish/attribution_analysis/attribution_analysis.ipynb Updated circuit-tracer commit pin
src/it_examples/notebooks/dev/attribution_analysis/attribution_analysis.ipynb Updated circuit-tracer commit pin
src/it_examples/notebooks/publish/.notebook_hashes.json Updated hashes for modified notebooks
scripts/infra_utils.sh Simplified maybe_deactivate() to use deactivate 2>/dev/null || true for more robust error handling
scripts/build_it_env.sh Added 2>/dev/null to suppress pip show errors
requirements/ci/requirements.txt Updated circuit-tracer commit pin
requirements/ci/requirements.in Updated circuit-tracer commit pin
requirements/ci/circuit_tracer_pin.txt Updated circuit-tracer commit pin
pyproject.toml Updated circuit-tracer commit pin in commented dependency
tests/parity_acceptance/expected.py Updated expected loss value for train_cuda_bf16 test to reflect new circuit-tracer behavior

@speediedan speediedan merged commit 209ed13 into main Nov 7, 2025
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

adapter: circuit_tracer Circuit tracer adapter area: build Build system and packaging area: docs Documentation files area: examples Example code and demos area: notebooks Jupyter notebooks area: scripts Shell scripts and automation area: tests Testing code config Configuration file changes dependencies Dependency updates module: adapters Adapter system

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants