mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-05 07:48:45 +00:00
native_dense_price_test: write the hyper-connection rows of the fixture pack as real BF16 rows
The fixture wrote every row of its pack as a shape-only quantized row. WeightTable::load refuses a
shape-only row that is not in its skip set, and add_hc_skip is only called on one card (a layer
split loads the hyper-connection rows as the BF16 rows a real pack has), so all three loads failed
before anything was priced ("this pack holds the tensor only in its GGUF form"; 4 checks FAILED on
an RTX PRO 5000, l620-20261113-0218-6b2f). The projections and the PLE key stay shape-only rows;
the six hyper-connection rows are kind-4 rows with 2,048 bytes each in dense.bin and the pool.
Test file only; no engine code changes.
This commit is contained in:
1 parent
71fbb60677
commit
cca88a0112
1 file changed
+21
-4
@@ -65,13 +65,30 @@ const std::vector<std::string>& names() {
|
||||
return n;
|
||||
}
|
||||
|
||||
// every row a shape-only quantized row (what iq_pack writes for a tensor the GGUF serves): no bytes in the pool
|
||||
// the projections and the PLE key are shape-only quantized rows (what iq_pack writes for a tensor the GGUF serves): no bytes in
|
||||
// the pool. The hyper-connection rows are real BF16 rows (kind 4, 256 x 4 x 2 = 2,048 B each), as in a real pack: on a layer
|
||||
// split generate.cpp does not skip them (add_hc_skip runs on one card only), and WeightTable::load refuses a shape-only row
|
||||
// that is not in its skip set.
|
||||
constexpr uint64_t HC_ROW_BYTES = NE0 * NE1 * 2;
|
||||
bool is_hc_row(const std::string& n) { return n.find("hc_") != std::string::npos; }
|
||||
|
||||
void write_pack(const fs::path& dir) {
|
||||
fs::create_directories(dir);
|
||||
std::string idx = "# align 256 pool 256 tensors " + std::to_string(names().size()) + "\n";
|
||||
for (const auto& n : names()) idx += n + " 0 0 0 0 0 0 256 4 8 0 32 0 0 0 0 0 0 0\n";
|
||||
uint64_t hc_rows = 0;
|
||||
for (const auto& n : names()) hc_rows += is_hc_row(n) ? 1 : 0;
|
||||
std::string idx = "# align 256 pool " + std::to_string(hc_rows * HC_ROW_BYTES) + " tensors " + std::to_string(names().size()) + "\n";
|
||||
uint64_t at = 0;
|
||||
for (const auto& n : names()) {
|
||||
if (is_hc_row(n)) {
|
||||
const std::string off = std::to_string(at), len = std::to_string(HC_ROW_BYTES);
|
||||
idx += n + " 0 4 " + off + " " + len + " " + off + " " + len + " 256 4 0 0 0 0 0 0 0 0 0 0\n";
|
||||
at += HC_ROW_BYTES;
|
||||
} else {
|
||||
idx += n + " 0 0 0 0 0 0 256 4 8 0 32 0 0 0 0 0 0 0\n";
|
||||
}
|
||||
}
|
||||
std::ofstream(dir / "index.txt", std::ios::binary) << idx;
|
||||
std::vector<char> bytes(16, 0);
|
||||
std::vector<char> bytes((size_t) (hc_rows * HC_ROW_BYTES ? hc_rows * HC_ROW_BYTES : 16), 0);
|
||||
std::ofstream(dir / "dense.bin", std::ios::binary).write(bytes.data(), (std::streamsize) bytes.size());
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user