Vulkan: fix NaN in tanh.comp with AMD proprietary driver on Windows (llama/10723)

* Vulkan: fix NaN in tanh.comp

* Faster NaN-free tanh
This commit is contained in:
stduhpf 2024-12-08 19:19:19 +01:00 committed by Georgi Gerganov
parent 6585a890b4
commit 9ffbd3d969

View File

@ -16,6 +16,5 @@ void main() {
if (i >= p.KX) {
return;
}
data_d[i] = D_TYPE(tanh(data_a[i]));
data_d[i] = D_TYPE(1. - 2. / (exp(2.*data_a[i]) + 1.));
}