close a group: the reference against golden (leg 2's summary), and every kernel's digest against golden (leg 1)
| 246 | |
| 247 | // close a group: the reference against golden (leg 2's summary), and every kernel's digest against golden (leg 1) |
| 248 | void close_group(Group& g, const std::vector<std::pair<const char*, uint64_t>>& ours) { |
| 249 | if (!g_golden_leg) return; |
| 250 | const GoldenLine* gp = golden_for(g.key); |
| 251 | if (gp == nullptr) { |
| 252 | fail(g.name.c_str(), "group \"" + g.key + "\" has no golden line (a new case: regenerate tests/quant/golden_x86.txt, tests/quant/make_golden.sh)"); |
| 253 | return; |
| 254 | } |
| 255 | const GoldenLine& gl = *gp; |
| 256 | if (gl.in != g.in || gl.rows != g.rows) { |
| 257 | fail(g.name.c_str(), "group \"" + g.key + "\": the INPUTS differ from the golden file's (" + std::to_string(g.rows) + " rows, digest " + hex64(g.in) + |
| 258 | "; golden " + std::to_string(gl.rows) + " rows, " + hex64(gl.in) + "): ggml's quantizers that make the test rows moved here"); |
| 259 | return; |
| 260 | } |
| 261 | if (gl.out != g.ref) g_ref_moved.push_back(g.key); |
| 262 | for (const auto& k : ours) { |
| 263 | ++g_group_checks; |
| 264 | if (k.second != gl.out) |
| 265 | fail(g.name.c_str(), std::string("kernel ") + k.first + ": group \"" + g.key + "\" differs from the golden reference (ours " + hex64(k.second) + |
| 266 | ", golden " + hex64(gl.out) + "); rows: --dump-group \"" + g.key + "\""); |
| 267 | } |
| 268 | } |
| 269 | |
| 270 | void dump_row(const Group& g, const char* who, int idx, uint64_t in, const void* out, size_t n) { |
| 271 | if (g.key == g_dump_key) std::printf("ROW %s %s %d %s %s\n", g.key.c_str(), who, idx, hex64(in).c_str(), hex_bytes(out, n).c_str()); |
no test coverage detected