Skip to content

Commit

Permalink
qkv_out can be a single tensor or a list. Handling these cases separe…
Browse files Browse the repository at this point in the history
…tely. (#1850)

Co-authored-by: Jeff Rasley <[email protected]>
  • Loading branch information
samyam and jeffra authored Mar 24, 2022
1 parent c7af747 commit ebbcfd5
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ def selfAttention_fp():
norm_b,
config.epsilon,
(attn_qkvb is not None))
context_layer, key_layer, value_layer = compute_attention(qkv_out[0], input_mask)
context_layer, key_layer, value_layer = compute_attention(qkv_out[0] if isinstance(qkv_out, list) else qkv_out, input_mask)
output = vector_matmul_func(context_layer, attn_ow, False)

return output, key_layer, value_layer, context_layer, qkv_out[-1] # attn_out, present_key, present_value, context_output, inp_norm
Expand Down

0 comments on commit ebbcfd5

Please sign in to comment.