mirror of
https://github.com/ikawrakow/ik_llama.cpp.git
synced 2026-06-28 04:30:15 -05:00
Fix #1961
This commit is contained in:
parent
670a3f6f5b
commit
c73bfbe9ce
@ -1173,13 +1173,17 @@ struct FlashQKV {
|
||||
S += expf(s - fms.M[j]);
|
||||
}
|
||||
}
|
||||
GGML_ASSERT(S > 0);
|
||||
if (S > 0) {
|
||||
auto norm = F16::set1(1/S);
|
||||
//auto norm = F16::set1(fms.S[j] > 0 ? 1/fms.S[j] : 0.f);
|
||||
for (int i = 0; i < D/F16::block_size; ++i) {
|
||||
auto r = F16::load(R + F16::block_size*i);
|
||||
F16::store(qkv + F16::block_size*i, F16::mul(norm, r));
|
||||
}
|
||||
} else {
|
||||
for (int i = 0; i < D/F16::block_size; ++i) {
|
||||
F16::store(qkv + F16::block_size*i, F16::zero());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
template <typename FMS>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user