Skip to content

Fix BF16 dot emulation for dynamic B#9595

Open
copybara-service[bot] wants to merge 1 commit intomasterfrom
test_875083836
Open

Fix BF16 dot emulation for dynamic B#9595
copybara-service[bot] wants to merge 1 commit intomasterfrom
test_875083836

Conversation

@copybara-service
Copy link
Contributor

Fix BF16 dot emulation for dynamic B

When input_c_id to a dot operator is YNN_INVALID_VALUE_ID, we would do this:

return dot(a_bf16, b_bf16, residual)

Instead of:

ab = dot(a_bf16, b_bf16, input_c_id)
return add(ab, residual)

However this does not work when B is dynamic as the initializer to the dot is not expected to be dynamic.

This CL updates code to use dot + add.

When `input_c_id` to a dot operator is `YNN_INVALID_VALUE_ID`, we would do this:

```
return dot(a_bf16, b_bf16, residual)
```

Instead of:

```
ab = dot(a_bf16, b_bf16, input_c_id)
return add(ab, residual)
```

However this does not work when B is dynamic as the initializer to the dot is not expected to be dynamic.

This CL updates code to use dot + add.

PiperOrigin-RevId: 875083836
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.

1 participant