Repository navigation
fix: honor standalone feature-density evaluation - #762
Merged
chanind merged 1 commit intoOct 14, 2026
Merged
Conversation
Assisted-by: OpenAI Codex
Contributor
Author
|
CI follow-up: the source build reached the full test run, which finished with 1,798 passed and 7 skipped. Its one failure is the existing gpt2-tokenized ActivationsStore fixture receiving HTTP 429 from the HF dataset revision endpoint (run 38345025413), not an assertion in the new tests. The separate Claude review action fails before review because it cannot obtain an OIDC token. Local affected offline tests and repository formatting/types pass as described above. A maintainer rerun after the rate limit clears would help validate the full hosted suite; no workflow permission changes are included in this PR. |
chanind
approved these changes
Oct 14, 2026
chanind
left a comment
Collaborator
There was a problem hiding this comment.
Makes sense, thanks for finding this!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
run_evalssilently skips feature-density evaluation whencompute_featurewise_density_statistics=Trueis the only activation-based metric selected. Its dispatch condition only checks L2, sparsity and variance flags, even thoughEvalConfigexposes feature density as a separate option. The result has nofeature_densityorconsistent_activation_heuristicvalues, and invalid zero/negative batch counts also bypass the existing validation.Include the feature-density flag in that dispatch condition and validation message. Validate batch counts before temporarily disabling
hook_zreshaping, so invalid configurations do not mutate the SAE's mode. No formulas, scalar metric selection or training behavior change.The regression fixture uses a real, randomly initialized CPU
HookedTransformer,StandardSAE, pretokenized in-memory Hugging FaceDataset, andActivationsStore; it downloads no model or dataset and replaces no domain logic. Fixed encoder parameters make active/inactive feature counts deterministic. Tests cover both included/excluded special tokens and zero/negative batch counts.Type of change
Checklist
resid_preandhook_zmode-preservation controls.Formatting, Typing and Tests
make check-ciwas not run. A full affected-file offline attempt passed the eight new cases, then stopped at the first existing pretrained-model fixture because its files are absent from the local cache (LocalEntryNotFoundError). The 42-test run is an offline subset, not a full-suite claim; model-download-dependent tests remain unvalidated locally.The local latest Datasets/dill combination initially failed during Arrow fingerprint construction before evaluation. The tests were rerun using an isolated supported dependency overlay (Datasets 4.3.0, dill 0.4.0, PyArrow 22.0.0). This PR changes no dependency pins.
Performance
No training-performance or model-quality claim. This enables only the computation explicitly requested by the existing configuration.
Duplicate checks found no matching feature-density-only dispatch fix. #755 optimizes a temporary masked activation allocation inside the evaluation helper; this change concerns dispatch in
run_evalsand does not reproduce that optimization.AI disclosure: investigated, implemented and tested with OpenAI Codex, with an independent GPT-6 Luna review followed by root corrections and test reruns; no claim of human-authored code or personal human test execution.