MCPcopy Create free account
hub / github.com/Niko1221/Strata / close_group

Function close_group

engine/tests/quant/quant_parity.cpp:248–268  ·  view source on GitHub ↗

close a group: the reference against golden (leg 2's summary), and every kernel's digest against golden (leg 1)

Source from the content-addressed store, hash-verified

246
247// close a group: the reference against golden (leg 2's summary), and every kernel's digest against golden (leg 1)
248void 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
270void 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());

Callers 5

test_dotFunction · 0.85
test_actFunction · 0.85
test_dequantFunction · 0.85
test_boundaryFunction · 0.85
test_fp16Function · 0.85

Calls 6

golden_forFunction · 0.85
hex64Function · 0.85
push_backMethod · 0.80
failFunction · 0.70
to_stringFunction · 0.50
stringFunction · 0.50

Tested by

no test coverage detected