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

Fix fused_qkv print model ValueError #7109

Merged
merged 3 commits into from
Mar 4, 2025

Conversation

Yejing-Lai
Copy link
Contributor

Suppose qkv_linear_weight_shape = [in_features, out_features].
The qkv linear weight shape is [3, in_features, out_features] if using fued_qkv gemm optimization. It will cause "ValueError: too many values to unpack (expected 2)" issue when printing the model.

Solution: Take the last two weight dimensions shapes as in_features and out_features.

@loadams loadams added this pull request to the merge queue Mar 4, 2025
@loadams loadams removed this pull request from the merge queue due to a manual request Mar 4, 2025
@hwchen2017 hwchen2017 enabled auto-merge March 4, 2025 17:20
@hwchen2017 hwchen2017 added this pull request to the merge queue Mar 4, 2025
Merged via the queue into deepspeedai:master with commit 71807bc Mar 4, 2025
10 of 11 checks passed
raza-sikander pushed a commit to raza-sikander/DeepSpeed that referenced this pull request Mar 6, 2025
Suppose qkv_linear_weight_shape = [in_features, out_features].
The qkv linear weight shape is [3, in_features, out_features] if using
fued_qkv gemm optimization. It will cause "ValueError: too many values
to unpack (expected 2)" issue when printing the model.

Solution: Take the last two weight dimensions shapes as in_features and
out_features.

Signed-off-by: Lai, Yejing <[email protected]>
Co-authored-by: Hongwei Chen <[email protected]>
Co-authored-by: Logan Adams <[email protected]>
raza-sikander pushed a commit to raza-sikander/DeepSpeed that referenced this pull request Mar 6, 2025
Suppose qkv_linear_weight_shape = [in_features, out_features].
The qkv linear weight shape is [3, in_features, out_features] if using
fued_qkv gemm optimization. It will cause "ValueError: too many values
to unpack (expected 2)" issue when printing the model.

Solution: Take the last two weight dimensions shapes as in_features and
out_features.

Signed-off-by: Lai, Yejing <[email protected]>
Co-authored-by: Hongwei Chen <[email protected]>
Co-authored-by: Logan Adams <[email protected]>
Signed-off-by: Shaik Raza Sikander <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants