Skip to content

Commit

Permalink
Update lora input linear adapter output dim. (#911)
Browse files Browse the repository at this point in the history
* Update lora input linear adapter output dim.

* Update unit tests.
  • Loading branch information
JianyuWangV authored Jan 15, 2025
1 parent 3405a6e commit cfb5336
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
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

0 comments on commit cfb5336

Please sign in to comment.