fishomni: Fish Audio drama-3 -- the Qwen3.5-35B-A3B backbone with its block-fp8 experts at f32 scales, a 13-layer codebook tower over the backbone's full-attention cache, the main token over 4097 candidates with repetition-aware sampling, and Fish S2's modified DAC read from codec.pth; one branch on two cards, the input's speaker turns written as fish-speech's server writes them

This commit is contained in:
zivius committed 2026-10-20 23:07:48 +02:00
1 parent f201c140ab
commit a01d1c1cd5
4 files changed
+1914 -2

No files matched your search

+10
View File
@@ -0,0 +1,10 @@
# Built in radiance's tree, or standalone against an installed radiance
# (`cmake -S arch/fishomni -B build -DCMAKE_PREFIX_PATH=<radiance prefix>`); see cmake/RadAddPlugin.cmake.
if(NOT COMMAND rad_add_plugin)
cmake_minimum_required(VERSION 3.21)
project(fishomni LANGUAGES CXX)
find_package(radiance REQUIRED)
rad_plugin_defaults()
endif()
rad_add_plugin(fishomni architectures SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/fishomni.cpp)
File diff suppressed because it is too large. Load diff
+21
View File
@@ -0,0 +1,21 @@
# drama3-fp8.recipe -- Fish Audio drama-3 as its release ships it: block-scaled fp8 routed experts,
# everything else of the language model and the codebook tower bf16.
#
# rad-convert <fishaudio/drama-3 directory> \
# --recipe data/recipes/drama3-fp8.recipe -o drama3-fp8.rad
#
# The directory holds the model and codec.pth, its codec, which is read as checkpoint tensors
# under `codec.` (core/format/torch_zip.h). The model is kept as stored. The codec ships f32:
# its weight-normalised convolutions are folded here, and its linears, convolutions and
# codebooks cast to bf16, the precision fish-speech decodes at, while its norms, layer scales,
# ConvNeXt gains and snake parameters stay f32 -- read once a pass or less.
codec.*.n1.weight cast dtype=f32
codec.*.n2.weight cast dtype=f32
codec.*.ls1.weight cast dtype=f32
codec.*.ls2.weight cast dtype=f32
codec.norm.weight cast dtype=f32
codec.up*.ln.* cast dtype=f32
codec.up*.gamma cast dtype=f32
codec.*.alpha cast dtype=f32
codec.* cast dtype=bf16
+65 -2
View File
@@ -7,7 +7,9 @@
#include "rad_test.h"
#include "plugin/registry.h"
#include "rad_builder.h"
#include <cstring>
#include <map>
#include <set>
#include <string>
@@ -88,8 +90,8 @@ TEST(the_shipped_architectures_load_with_distinct_selection_keys) {
CHECK(keys.emplace(std::make_pair(p.arch_id, p.arch_quant), p.name).second);
}
const std::set<std::pair<std::string, std::string>> want = {
{ "anima", "" }, { "breeze", "" }, { "embeddinggemma2", "" }, { "flux3", "" },
{ "flux3distilled", "" },
{ "anima", "" }, { "breeze", "" }, { "embeddinggemma2", "" },
{ "fishomni", "bsgemm-moe" }, { "flux3", "" }, { "flux3distilled", "" },
{ "gemma3", "" }, { "gemma4", "" },
{ "gemma4", "compressed-tensors" }, { "glm5next", "" }, { "lfm2", "" }, { "llama", "" },
{ "llama", "fp8_e4m3" }, { "qwen35", "" },
@@ -133,4 +135,65 @@ TEST(every_shipped_family_has_at_most_one_plugin_for_an_imported_checkpoint) {
CHECK(!w8->arch_serves_imports);
}
/* drama-3's input as fish-speech's server writes it (chunking.py, generate.py): each speaker's turn
* tagged and stripped, turns on lines of their own, untagged text speaker 0's; refused when empty,
* when it holds a token only the prompt builder writes, or when it names a speaker other than 0..15
* the canonical way. A refusal leaves its reason in the output. */
TEST(fishomni_writes_the_input_as_the_reference_server_does) {
Registry r;
const int st = r.load_dir(dir_of("architectures"), {});
if (st == RAD_E_IO && r.plugins().empty())
ARTIFACT_MISSING("the architecture plugins under " + dir_of("architectures"));
CHECK_OK(st);
const Plugin* p = r.plugin("fishomni");
REQUIRE(p != nullptr);
REQUIRE(p->arch_text_prepare != nullptr);
auto prep = [&](const char* in, std::string* out) {
char buf[512] = {};
const int64_t n = p->arch_text_prepare(RAD_TEXT_INPUT, in, buf, sizeof buf);
*out = buf;
return n;
};
const struct { const char* in; const char* want; } ok[] = {
{ "Hello there.", "<|speaker:0|> Hello there." },
{ " Hello there. \n", "<|speaker:0|> Hello there." },
{ "\xe3\x80\x80Hello\xc2\xa0", "<|speaker:0|> Hello" }, /* U+3000, U+00A0 */
{ "<|speaker:0|> Are you ready? <|speaker:1|> Always.",
"<|speaker:0|> Are you ready?\n<|speaker:1|> Always." },
{ "Hi <|speaker:12|>Hey <|speaker:3|> ", "<|speaker:0|> Hi\n<|speaker:12|> Hey" },
{ "<|speaker:2|>[laughs] Fine.", "<|speaker:2|> [laughs] Fine." },
};
for (const auto& c : ok) {
std::string got;
const int64_t n = prep(c.in, &got);
if (got != c.want) fprintf(stderr, " '%s' -> '%s'\n", c.in, got.c_str());
CHECK_EQ(n, (int64_t)std::strlen(c.want));
CHECK_EQ(got, std::string(c.want));
}
const struct { const char* in; const char* why; } refused[] = {
{ " \t", "empty" },
{ "<|speaker:1|> ", "empty" },
{ "Say <|im_end|> now", "<|im_end|>" },
{ "<|voice|>", "<|voice|>" },
{ "a <|semantic:12|> b", "<|semantic:" },
{ "<|speaker:16|> hi", "speaker tags" },
{ "<|speaker:01|> hi", "speaker tags" },
{ "<|speaker_change|> hi", "speaker tags" },
};
for (const auto& c : refused) {
std::string why;
CHECK(prep(c.in, &why) < 0);
if (why.find(c.why) == std::string::npos) fprintf(stderr, " '%s': %s\n", c.in, why.c_str());
CHECK(why.find(c.why) != std::string::npos);
}
/* A short buffer still gets the length to retry with, and the instructions (which the model
* refuses before they get here) pass as written. */
char tiny[4] = {};
CHECK_EQ(p->arch_text_prepare(RAD_TEXT_INPUT, "Hello", tiny, sizeof tiny),
(int64_t)std::strlen("<|speaker:0|> Hello"));
char buf[64] = {};
CHECK_EQ(p->arch_text_prepare(RAD_TEXT_INSTRUCTIONS, " calm ", buf, sizeof buf), 6);
CHECK_EQ(std::string(buf), std::string(" calm "));
}
RAD_TEST_MAIN()