TP: fix Phi3, Bert, Plamo2/3, ChatGLM (#25536)

This commit is contained in:
Johannes Gäßler
2026-07-16 16:23:23 +03:00
committed by GitHub
parent 86b719bf21
commit 2e1fd76490
2 changed files with 19 additions and 6 deletions
+3 -1
View File
@@ -40,8 +40,10 @@ static double nmse(const std::vector<float> & a, const std::vector<float> & b) {
}
static void set_tensor_data(struct ggml_tensor * tensor, void * userdata) {
size_t seed = *(const size_t *) userdata;
std::hash<std::string> hasher;
std::mt19937 gen(hasher(tensor->name) + *(const size_t *) userdata);
seed ^= hasher(tensor->name);
std::mt19937 gen(seed);
std::normal_distribution<float> dis(0.0f, 1.0e-2f);
const int64_t ne = ggml_nelements(tensor);