tools/q4geo_synth.py: synthetic qwen4exp GGUFs at any shape in the type mix of an Unsloth UD file, and the geometry header of a shape or a real file; routing trace layer bound from the geometry

This commit is contained in:
Niko1221 committed 2026-11-07 18:16:50 +01:00
1 parent 4041af8e6c
commit 5e1ea3ff6e
2 files changed
+366 -2

No files matched your search

+2 -2
View File
@@ -1406,7 +1406,7 @@ void drive_pool(void* user, const float* x_f, const int32_t* ids, const float* w
// unaffected - it is a per-layer split, and shifting every layer by one preserves both metrics - but
// anything keyed on the layer index, which is exactly what a cache profile is, would have been wrong.
const int32_t layer_idx = (int32_t) (t->d.layers - 1);
if (layer_idx < 0 || layer_idx >= 48) {
if (layer_idx < 0 || layer_idx >= strata::core::kCompiledGeometry.n_layers) {
std::fprintf(stderr, "strata generate: the routing trace saw layer %d, outside 0..47\n", layer_idx);
return;
}
@@ -1430,7 +1430,7 @@ void drive_pool_multi_impl(void* user, const float* x_f, const int32_t* ids, int
// one record per token. The multi dispatch fuses the router weights into the kernel and does not surface
// them, so records carry unit weights: tools/make_profile.py ranks pairs by routed frequency, which is the
// signal that matters; a one-shot --dump-routing run records true weights if a weighted ranking is wanted.
if (t->routing != nullptr && layer >= 0 && layer < 48) {
if (t->routing != nullptr && layer >= 0 && layer < strata::core::kCompiledGeometry.n_layers) {
for (int64_t tok = 0; tok < n_tok; ++tok) {
const int32_t rec[2] = {(int32_t) layer, (int32_t) k};
std::fwrite(rec, sizeof rec, 1, t->routing);