Repository navigation
Conversation
This was referenced Jul 18, 2026
tobocop2
force-pushed
the
debertav2-f16-dtype
branch
2 times, most recently
from
July 18, 2026 02:33
57e2dcc to
0211b5f
Compare
Closed
4 of 6 tasks
disentangled_attention_bias initialized its score accumulator as F32 and XSoftmax::apply built its fill tensors as F32 regardless of the input dtype, so forward failed with a dtype mismatch for F16 models. Cast the scalars to the working dtype; the F32 path is unchanged. Signed-off-by: tobocop2 <5562156+tobocop2@users.noreply.github.com>
tobocop2
force-pushed
the
debertav2-f16-dtype
branch
from
July 18, 2026 03:01
0211b5f to
6a08c94
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
DebertaV2Model::forwardfails for F16 models withdtype mismatch in add, lhs: F32, rhs: F16.Fixes #3750.
Solution
Two spots in
debertav2.rsbuild F32 scalar tensors and combine them with tensors of the model's dtype:scoreaccumulator indisentangled_attention_biasXSoftmax::applyCast them to the working dtype — same pattern as
scalein this file and the mask fill inbert.rs. The F32 path is unchanged.Testing
New regression test runs a tiny DeBERTa-v2 forward at F32 and F16; the F16 case fails without this fix. Workspace tests, clippy, and fmt all pass.