Files
llmgw/internal/modelplan/strata_test.go
T
2026-10-30 13:00:21 +01:00

52 lines
2.2 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package modelplan
import "testing"
func TestStrataIsOfferedOnANodeWithItTheCardAndTheRAM(t *testing.T) {
arts := []Artifact{{Name: "Qwen3.8-Flash-Next-GSQ-RCO-IQ2_XS-00001-of-00002.gguf", Format: "gguf", Bytes: 68e9},
{Name: "something-else-Q4_K_M.gguf", Format: "gguf", Bytes: 5e9}}
nodes := []PoolNode{
{ID: "cuda01", Class: "6000-24g", GPUMemGB: 24, GPUs: 1, FreeGPUs: 1, HostMemGB: 251, HostFreeGB: 200,
Engines: []string{"llamacpp", "strata"}},
{ID: "no-strata", Class: "6000-24g", GPUMemGB: 24, GPUs: 1, FreeGPUs: 1, HostMemGB: 251, Engines: []string{"llamacpp"}},
{ID: "small-ram", Class: "6000-24g", GPUMemGB: 24, GPUs: 1, FreeGPUs: 1, HostMemGB: 32, Engines: []string{"strata"}},
{ID: "small-card", Class: "t4-8g", GPUMemGB: 8, GPUs: 1, FreeGPUs: 1, HostMemGB: 251, Engines: []string{"strata"}},
}
opts := StrataOptions("qwen", arts, nodes)
if len(opts) != 1 {
t.Fatalf("%+v", opts)
}
o := opts[0]
if o.Engine != "strata" || o.StrataSize != "IQ2_XS" || o.Hosts != 1 || !o.FreeNow || o.NeedGB != 52 || o.GPUs() != 1 {
t.Errorf("%+v", o)
}
// It ranks before llama.cpp on the CPU, and says what it needs.
all := append(Options(arts[:1], Shape{}, nodes, 16384), opts...)
Rank(all)
if all[0].Engine != "strata" {
t.Errorf("first is %+v", all[0])
}
if o.Label() != "1 × 6000-24g with Strata, experts in RAM" || o.MemoryText() == "" {
t.Errorf("%q %q", o.Label(), o.MemoryText())
}
}
// DeepSeek's engine is built for RTX 30 and newer: not offered on a Turing
// card, which Strata's setup refuses after the replica is placed.
func TestDeepSeekOnStrataNeedsANewerCard(t *testing.T) {
arts := []Artifact{{Name: "IST-DAS-1.75bpw.gguf", Format: "gguf"}}
node := func(cc float64) []PoolNode {
return []PoolNode{{ID: "n", Class: "6000-24g", GPUMemGB: 24, GPUs: 1, FreeGPUs: 1, HostMemGB: 251,
Engines: []string{"strata"}, CC: cc}}
}
if got := StrataOptions("deepseek41", arts, node(7.5)); len(got) != 0 {
t.Errorf("offered on 7.5: %+v", got)
}
if got := StrataOptions("deepseek41", arts, node(8.9)); len(got) != 1 {
t.Errorf("not offered on 8.9: %+v", got)
}
if got := StrataOptions("qwen", []Artifact{{Name: "IQ2_XS.gguf"}}, node(7.5)); len(got) != 1 {
t.Errorf("Qwen not offered on 7.5: %+v", got)
}
}