Skip to content
Open
Changes from all commits
Commits
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
5 changes: 5 additions & 0 deletions tests/unit/pretrained_weight_conversions/test_apertus.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ def make_cfg(use_qk_norm=True, n_key_value_heads=4):
use_qk_norm=use_qk_norm,
n_key_value_heads=n_key_value_heads,
dtype=torch.float32,
device="cpu",
)


Expand Down Expand Up @@ -183,7 +184,11 @@ def test_zero_biases_have_correct_device(self):
"blocks.0.mlp.b_out",
"unembed.b_U",
]:
<<<<<<< brendan/fix-gpu-tests
assert sd[key].device.type == cfg.device, f"{key} on wrong device"
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I had to remove .type since cfg.device is a str now. There's a pre-existing type issue here since cfg.device has type str | None so the old code shouldn't have compiled.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

See #1230

=======
assert sd[key].device.type == str(cfg.device), f"{key} on wrong device"
>>>>>>> dev

def test_unembed_shapes(self):
cfg = make_cfg()
Expand Down
Loading