diff --git a/src/split/tools/iqdot_test.cu b/src/split/tools/iqdot_test.cu index 47b08ecae3..25ecf6259c 100644 --- a/src/split/tools/iqdot_test.cu +++ b/src/split/tools/iqdot_test.cu @@ -60,7 +60,10 @@ bool run(const char* name, int nblocks, unsigned seed) { std::vector y((size_t) nblocks * 8); for (auto& b : y) { for (int i = 0; i < 32; ++i) b.qs[i] = (int8_t) (int) (rng() % 255 - 127); - b.ds = make_half2(__float2half((float) (rng() % 1000) / 500.0f), __float2half((float) ((int) (rng() % 200) - 100))); + // s drawn first, then d (as qdot_golden.cuh make_inputs: a fixed order on every compiler) + const float s = (float) ((int) (rng() % 200) - 100); + const float d = (float) (rng() % 1000) / 500.0f; + b.ds = make_half2(__float2half(d), __float2half(s)); } char* dw; block_q8_1* dy; diff --git a/src/split/tools/qdot_golden.cuh b/src/split/tools/qdot_golden.cuh index 461b23a5a0..87b46e25bd 100644 --- a/src/split/tools/qdot_golden.cuh +++ b/src/split/tools/qdot_golden.cuh @@ -80,7 +80,11 @@ inline Inputs make_inputs(int B, const std::vector& h16, int nblocks, int q in.y = std::vector((size_t) nblocks * (qk / QK8_1)); // (constructed at its size: block_q8_1 has no copy constructor, so no resize) for (auto& b : in.y) { for (int i = 0; i < 32; ++i) b.qs[i] = (int8_t) (int) (rng() % 255 - 127); - b.ds = make_half2(__float2half((float) (rng() % 1000) / 500.0f), __float2half((float) ((int) (rng() % 200) - 100))); + // s drawn first, then d, in named locals: as two arguments of one call their order was unspecified (g++ under nvcc drew s first, + // clang under HIP d first); this is g++'s order, so qdot_golden.txt is unchanged + const float s = (float) ((int) (rng() % 200) - 100); + const float d = (float) (rng() % 1000) / 500.0f; + b.ds = make_half2(__float2half(d), __float2half(s)); } return in; } diff --git a/src/split/tools/qdot_test.cu b/src/split/tools/qdot_test.cu index 0d303fe97c..e4cfcb2b20 100644 --- a/src/split/tools/qdot_test.cu +++ b/src/split/tools/qdot_test.cu @@ -97,7 +97,10 @@ bool run(const char* name, int B, std::vector h16, int nblocks, unsigned se std::vector y((size_t) nblocks * (qk / QK8_1)); for (auto& b : y) { for (int i = 0; i < 32; ++i) b.qs[i] = (int8_t) (int) (rng() % 255 - 127); - b.ds = make_half2(__float2half((float) (rng() % 1000) / 500.0f), __float2half((float) ((int) (rng() % 200) - 100))); + // s drawn first, then d (qdot_golden.cuh make_inputs: the same draws, a fixed order on every compiler) + const float s = (float) ((int) (rng() % 200) - 100); + const float d = (float) (rng() % 1000) / 500.0f; + b.ds = make_half2(__float2half(d), __float2half(s)); } char* dw; block_q8_1* dy;