radiance 1.2.4

- EmbeddingGemma 2 (google/embeddinggemma-2): text, image, video and audio embeddings on the
  card (libr4d) and on the CPU (libavx); prompt_name, Matryoshka dimensions, image budgets,
  mixed content parts and the messages form on /v1/embeddings
- #43: on serves that lend the activation arena to the experts (Qwen3.8-Flash-Next with
  expert_tiered), every image after the first read its rows from the wrong place -- garbage
  replies, or an earlier request's image. Fixed
- the Qwen vision towers' attention resolves on the card again (broken on main after 1.2.3,
  never released)
- #42: a warning at startup when amdgpu cwsr_enable is 0, and a stalled queue is reported as
  slow or stuck; the guide covers the GPU-hang-and-reset chain
This commit is contained in:
Deadcode committed 2026-10-07 22:42:45 +02:00
1 parent 05af4db458
commit 7d840861af
76 files changed
+8324 -467

No files matched your search

+20 -7
View File
@@ -148,9 +148,15 @@ int meta_merge_generation_config(const std::string& dir, MetaOwn* out) {
* `size.shortest_edge` means two different things in the two files. Absent is not an error: a
* text model has neither. */
int meta_merge_preprocessor_configs(const std::string& dir, MetaOwn* out) {
/* processor_config.json is the newer single file: one object a sub-processor
* (`image_processor`, `video_processor`, `feature_extractor`) beside the processor's own keys
* -- EmbeddingGemma 2's image budget and its audio token rate are only there. */
static const struct { const char* file; const char* prefix; } kFiles[] = {
{ "preprocessor_config.json", "preprocessor" },
{ "video_preprocessor_config.json", "video_preprocessor" },
{ "processor_config.json", "processor" },
/* sentence-transformers' own: an embedding model's named prompts and its default. */
{ "config_sentence_transformers.json", "sentence_transformers" },
};
for (const auto& f : kFiles) {
const std::string path = dir + "/" + f.file;
@@ -823,23 +829,30 @@ int ckpt_resolve(Checkpoint& ck, const Program& prog, const std::string& name, b
" holds none of them");
}
/* THE LOGICAL SHAPE: the pieces joined along concat_dim, every other extent agreeing. */
/* THE LOGICAL SHAPE: the pieces joined along concat_dim, every other extent agreeing. A
* rank-0 tensor is one element and is read as shape [1]: safetensors stores a scalar
* parameter (Gemma 4's clipped-linear bounds) with an empty shape. */
const SrcTensor& p0 = *out->pieces[0];
const int d = out->concat_dim;
if (p0.shape.empty() || p0.shape.size() > RAD_MAX_RANK || d < 0 || d >= (int)p0.shape.size())
auto shape_of = [](const SrcTensor& t) {
return t.shape.empty() ? std::vector<int64_t>{ 1 } : t.shape;
};
const std::vector<int64_t> s0 = shape_of(p0);
if (s0.size() > RAD_MAX_RANK || d < 0 || d >= (int)s0.size())
return refuse(RAD_E_SHAPE, "'" + p0.name + "' cannot be joined along dim " +
std::to_string(d));
out->rank = (uint32_t)p0.shape.size();
for (uint32_t i = 0; i < out->rank; ++i) out->shape[i] = p0.shape[i];
out->rank = (uint32_t)s0.size();
for (uint32_t i = 0; i < out->rank; ++i) out->shape[i] = s0[i];
for (size_t k = 1; k < out->pieces.size(); ++k) {
const SrcTensor& pk = *out->pieces[k];
bool fits = pk.shape.size() == p0.shape.size();
const std::vector<int64_t> sk = shape_of(pk);
bool fits = sk.size() == s0.size();
for (uint32_t i = 0; fits && i < out->rank; ++i)
if ((int)i != d && pk.shape[i] != p0.shape[i]) fits = false;
if ((int)i != d && sk[i] != s0[i]) fits = false;
if (!fits)
return refuse(RAD_E_SHAPE, "'" + pk.name + "' and '" + p0.name +
"' do not join along dim " + std::to_string(d));
out->shape[d] += pk.shape[(size_t)d];
out->shape[d] += sk[(size_t)d];
}
rad_enc_view(out->rank, out->shape, &out->rows, &out->cols);