Skip to content

Commit

Permalink
[PyTorch] Fix GQA error message (#1328)
Browse files Browse the repository at this point in the history
* fix GQA error message

Signed-off-by: Charlene Yang <[email protected]>

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Signed-off-by: Charlene Yang <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
cyanguwa and pre-commit-ci[bot] authored Nov 20, 2024
1 parent 994f19d commit b495120
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion transformer_engine/pytorch/attention.py
Original file line number Diff line number Diff line change
Expand Up @@ -7952,7 +7952,10 @@ def forward(
assert (
key_layer.shape[-2] == self.num_gqa_groups_per_partition
and value_layer.shape[-2] == self.num_gqa_groups_per_partition
), f"Keys and values must have num_gqa_group = {self.num_gqa_groups} heads!"
), (
"Keys and values must have num_gqa_group ="
f" {self.num_gqa_groups_per_partition} heads!"
)
assert qkv_format in [
"sbhd",
"bshd",
Expand Down

0 comments on commit b495120

Please sign in to comment.