-
Notifications
You must be signed in to change notification settings - Fork 135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add value error if both d sae and expansion factor set #301
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,7 +28,6 @@ def tokenize_with_bos(model: HookedTransformer, text: str) -> list[int]: | |
{ | ||
"model_name": "tiny-stories-1M", | ||
"dataset_path": "roneneldan/TinyStories", | ||
"tokenized": False, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why were these values changed? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Because I checked throughout the codebase that there are no references to a field There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. oooh nice, so if we mistype attributes in tests now we'll get an error? 🥇 |
||
"hook_name": "blocks.1.hook_resid_pre", | ||
"hook_layer": 1, | ||
"d_in": 64, | ||
|
@@ -37,15 +36,13 @@ def tokenize_with_bos(model: HookedTransformer, text: str) -> list[int]: | |
{ | ||
"model_name": "tiny-stories-1M", | ||
"dataset_path": "roneneldan/TinyStories", | ||
"tokenized": False, | ||
"hook_name": "blocks.1.attn.hook_z", | ||
"hook_layer": 1, | ||
"d_in": 64, | ||
}, | ||
{ | ||
"model_name": "gelu-2l", | ||
"dataset_path": "NeelNanda/c4-tokenized-2b", | ||
"tokenized": True, | ||
"hook_name": "blocks.1.hook_resid_pre", | ||
"hook_layer": 1, | ||
"d_in": 512, | ||
|
@@ -54,7 +51,6 @@ def tokenize_with_bos(model: HookedTransformer, text: str) -> list[int]: | |
{ | ||
"model_name": "gpt2", | ||
"dataset_path": "apollo-research/Skylion007-openwebtext-tokenizer-gpt2", | ||
"tokenized": True, | ||
"hook_name": "blocks.1.hook_resid_pre", | ||
"hook_layer": 1, | ||
"d_in": 768, | ||
|
@@ -63,7 +59,6 @@ def tokenize_with_bos(model: HookedTransformer, text: str) -> list[int]: | |
{ | ||
"model_name": "gpt2", | ||
"dataset_path": "Skylion007/openwebtext", | ||
"tokenized": False, | ||
"hook_name": "blocks.1.hook_resid_pre", | ||
"hook_layer": 1, | ||
"d_in": 768, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,15 +16,13 @@ | |
{ | ||
"model_name": "tiny-stories-1M", | ||
"dataset_path": "roneneldan/TinyStories", | ||
"tokenized": False, | ||
"hook_name": "blocks.1.hook_resid_pre", | ||
"hook_layer": 1, | ||
"d_in": 64, | ||
}, | ||
{ | ||
"model_name": "tiny-stories-1M", | ||
"dataset_path": "roneneldan/TinyStories", | ||
"tokenized": False, | ||
"hook_name": "blocks.1.hook_resid_pre", | ||
"hook_layer": 1, | ||
"d_in": 64, | ||
|
@@ -34,15 +32,13 @@ | |
{ | ||
"model_name": "tiny-stories-1M", | ||
"dataset_path": "apollo-research/roneneldan-TinyStories-tokenizer-gpt2", | ||
"tokenized": False, | ||
"hook_name": "blocks.1.hook_resid_pre", | ||
"hook_layer": 1, | ||
"d_in": 64, | ||
}, | ||
{ | ||
"model_name": "tiny-stories-1M", | ||
"dataset_path": "roneneldan/TinyStories", | ||
"tokenized": False, | ||
"hook_name": "blocks.1.attn.hook_z", | ||
"hook_layer": 1, | ||
"d_in": 64, | ||
|
@@ -202,7 +198,8 @@ def test_sae_save_and_load_from_pretrained_gated(tmp_path: Path) -> None: | |
|
||
def test_sae_save_and_load_from_pretrained_topk(tmp_path: Path) -> None: | ||
cfg = build_sae_cfg( | ||
activation_fn_str="topk", activation_fn_kwargs={"k": 30}, device="cpu" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why was this changed? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For similar reasons as in this comment. |
||
activation_fn_kwargs={"k": 30}, | ||
device="cpu", | ||
) | ||
model_path = str(tmp_path) | ||
sae = SAE.from_dict(cfg.get_base_sae_cfg_dict()) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -204,7 +204,6 @@ def test_train_sae_group_on_language_model__runs( | |
checkpoint_dir = tmp_path / "checkpoint" | ||
cfg = build_sae_cfg( | ||
checkpoint_path=str(checkpoint_dir), | ||
train_batch_size=32, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why was this changed? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For similar reasons as in this comment. |
||
training_tokens=100, | ||
context_size=8, | ||
) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fair enough! This feels less hacky than doing
__post_init__()
like before 👍There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haha, yeah, we shouldn't effectively call
__post_init__()
twice.