Archived
radiance 1.2.2
- Static YaRN for the Qwen rotary paths (#37): a container whose config names YaRN gets it in attention, the QSA index keys and a DFlash2 drafter; one reader for every rotary type, and a LLaMA container whose type is not served (llama3, longrope, dynamic) is refused by name. - --rope-scaling yarn:FACTOR[:ORIG] (#38) writes YaRN over a container's own rotary keys at load, no reconvert; the persisted prefix cache's fingerprint carries the resolved rotary. - An uneven world's cheaper rank (#36) pages the common token count and gives the rest of its VRAM to its experts; a plan and pool that disagree refuse to start. - MoE prefill (#35): wide gather, parallel scan and run-map prefix, 256-column down tile, early weight loads -- by rule, bit-identical. - MoE decode (#34): the sorted operand's own down kernel, its column tiles by routed rows. - --draft-window fixed|adaptive (#24): a per-sequence draft window priced by measured step time, one head depth per step over the batch; fixed stays the default. New metric radiance:draft_position_accepted_total and Grafana panels. - Out-of-tree plugin builds compile to the tree's device code from any build directory.
This commit is contained in:
1 parent
6fa7707dff
commit
ac79f4dc8a
63 files changed
+2744
-8759
No files matched your search
@@ -12,6 +12,7 @@
|
||||
#include "format/tunecache.h"
|
||||
#include "format/imatrix.h"
|
||||
#include "format/safetensors.h"
|
||||
#include "format/checkpoint.h"
|
||||
|
||||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
@@ -1901,6 +1902,62 @@ TEST(a_legacy_entry_count_that_is_not_one_is_refused) {
|
||||
std::remove(path.c_str());
|
||||
}
|
||||
|
||||
/* A GGUF's rotary scaling arrives as the config.json keys the architecture reads, type and all,
|
||||
* and never as a bare factor in RadModelMeta::rope_scale. A YaRN modifier config.json has no
|
||||
* spelling for is refused. */
|
||||
TEST(a_gguf_rotary_scaling_becomes_the_config_keys_with_its_type) {
|
||||
auto meta = [](const std::vector<GgufKv>& extra, const char* leaf, MetaOwn* out) -> int {
|
||||
std::vector<GgufKv> kvs = { { "general.architecture", 8, 0, "llama" },
|
||||
{ "llama.block_count", 4, 2, "" } };
|
||||
kvs.insert(kvs.end(), extra.begin(), extra.end());
|
||||
GgufFile g;
|
||||
if (g.open(write_bin(leaf, gguf_bytes({}, kvs)).c_str()) != RAD_OK) return RAD_E_IO;
|
||||
return meta_from_gguf(g, out);
|
||||
};
|
||||
{
|
||||
MetaOwn m;
|
||||
CHECK_OK(meta({ { "llama.rope.scaling.type", 8, 0, "yarn" },
|
||||
{ "llama.rope.scaling.factor", 12, 4, "" },
|
||||
{ "llama.rope.scaling.original_context_length", 4, 32768, "" } },
|
||||
"yarn.gguf", &m));
|
||||
CHECK_EQ(m.m.rope_scale, 1.0f);
|
||||
REQUIRE(m.get("rope_scaling.type"));
|
||||
CHECK_EQ(std::string(m.get("rope_scaling.type")), std::string("yarn"));
|
||||
CHECK_EQ(std::string(m.get("rope_scaling.factor")), std::string("4"));
|
||||
CHECK_EQ(std::string(m.get("rope_scaling.original_max_position_embeddings")),
|
||||
std::string("32768"));
|
||||
}
|
||||
{ /* llama.cpp's default type is linear, and the older key names its factor. */
|
||||
MetaOwn m;
|
||||
CHECK_OK(meta({ { "llama.rope.scale_linear", 12, 2, "" } }, "linear.gguf", &m));
|
||||
CHECK_EQ(std::string(m.get("rope_scaling.type")), std::string("linear"));
|
||||
CHECK_EQ(std::string(m.get("rope_scaling.factor")), std::string("2"));
|
||||
CHECK_EQ(m.m.rope_scale, 1.0f);
|
||||
}
|
||||
{ /* A type the architecture does not implement is carried by name for it to refuse. */
|
||||
MetaOwn m;
|
||||
CHECK_OK(meta({ { "llama.rope.scaling.type", 8, 0, "longrope" },
|
||||
{ "llama.rope.scaling.factor", 12, 4, "" } }, "longrope.gguf", &m));
|
||||
CHECK_EQ(std::string(m.get("rope_scaling.type")), std::string("longrope"));
|
||||
}
|
||||
{
|
||||
MetaOwn m;
|
||||
CHECK_OK(meta({ { "llama.rope.scaling.type", 8, 0, "none" },
|
||||
{ "llama.rope.scaling.factor", 12, 4, "" } }, "none.gguf", &m));
|
||||
CHECK(!m.get("rope_scaling.type"));
|
||||
MetaOwn n;
|
||||
CHECK_OK(meta({}, "plain.gguf", &n));
|
||||
CHECK(!n.get("rope_scaling.type"));
|
||||
}
|
||||
{
|
||||
MetaOwn m;
|
||||
CHECK_EQ(meta({ { "llama.rope.scaling.type", 8, 0, "yarn" },
|
||||
{ "llama.rope.scaling.factor", 12, 4, "" },
|
||||
{ "llama.rope.scaling.attn_factor", 12, 2, "" } }, "attn.gguf", &m),
|
||||
RAD_E_UNSUPPORTED);
|
||||
}
|
||||
}
|
||||
|
||||
TEST(a_gguf_version_this_reader_does_not_know_is_refused) {
|
||||
const std::string path = write_bin("v2.imatrix", gguf_bytes(
|
||||
{ { "t.in_sum2", { 2 }, { 1.0f, 2.0f } } }, {}, /*version=*/2));
|
||||
|
||||
Reference in new issue
Block a user