Skip to content
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

Update lora input linear adapter output dim. #911

Merged
merged 2 commits into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion axlearn/common/lora.py
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ def __init__(self, cfg: Config, *, parent: Module):
"adapter",
cfg.adapter.set(
input_dim=cfg.query_dim,
output_dim=cfg.query_dim,
output_dim=cfg.num_heads * cfg.per_head_dim,
num_heads=cfg.num_heads,
),
)
Expand Down
6 changes: 3 additions & 3 deletions axlearn/common/lora_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def test_alpha_is_zero(self):

class LoraFusedQKVLinearTest(TestCase):
def test_forward(self):
model_dim = 6
model_dim = 16
num_heads = 2
per_head_dim = 3
seq_len = 4
Expand Down Expand Up @@ -197,7 +197,7 @@ def test_forward(self):
),
)
def test_extend_step(self, layer):
model_dim = 8
model_dim = 16
num_heads = 2
per_head_dim = 4 # change this to 4 to adapt the need of RoPE.
seq_len = 4
Expand Down Expand Up @@ -267,7 +267,7 @@ def test_extend_step(self, layer):
)

def test_prefill_states(self):
model_dim = 6
model_dim = 16
num_heads = 2
per_head_dim = 3
seq_len = 4
Expand Down
Loading