okami.mom/strata
git clone https://git.nkp.pet/okami.mom/strata
53623e56f
main
1"""Render the four measured configuration points from results.csv.""" 2from pathlib import Path 3import csv 4import matplotlib 5matplotlib .use ("Agg" ) 6import matplotlib .pyplot as plt 7from matplotlib .patches import Patch 8 9ROOT = Path (__file__ ).resolve ().parent 10rows = list (csv .DictReader ((ROOT / "results.csv" ).open (encoding = "utf-8" ,newline = "" ))) 11ink ,muted ,grid = "#162c43" ,"#506176" ,"#e4eaf0" 12colors = {"chunk1024" :"#9caabe" ,"chunk8192" :"#087f8c" } 13plt .rcParams .update ({"font.family" :"DejaVu Sans" ,"font.size" :11 , 14"text.color" :ink ,"axes.labelcolor" :muted , 15"xtick.color" :muted ,"ytick.color" :ink , 16"axes.spines.top" :False ,"axes.spines.right" :False , 17"axes.spines.left" :False ,"axes.spines.bottom" :False , 18"svg.fonttype" :"none" ,"svg.hashsalt" :"q8-prefill8192" }) 19fig = plt .figure (figsize = (14 ,7.8 ),facecolor = "#f7f9fc" ) 20fig .text (.04 ,.954 ,"NATIVE STRATA 0.1.40 / Q8_0 CONFIGURATION EXPERIMENT" , 21fontsize = 10 ,fontweight = "bold" ,color = colors ["chunk8192" ]) 22fig .text (.04 ,.901 ,"6.7× faster Q8 prefill" ,fontsize = 31 ,fontweight = "bold" ) 23fig .text (.04 ,.862 ,"1,024 → 8,192-token chunks · Same model and expert cache · FP16 KV · MTP T4" , 24fontsize = 13 ,color = muted ) 25fig .legend (handles = [Patch (color = colors ["chunk1024" ],label = "Chunk 1,024" ), 26Patch (color = colors ["chunk8192" ],label = "Chunk 8,192" )], 27loc = "upper right" ,bbox_to_anchor = (.97 ,.96 ),frameon = False ,ncol = 2 ) 28gs = fig .add_gridspec (1 ,2 ,left = .15 ,right = .962 ,top = .69 ,bottom = .25 ,wspace = .35 ) 29for col , (metric ,title )in enumerate ([("prefill_seconds" ,"Prefill time" ), 30 ("total_seconds" ,"Whole request, including prefill" )]): 31ax = fig .add_subplot (gs [0 ,col ],facecolor = "white" ) 32ax .set_title (title + " · lower is faster" ,loc = "left" ,fontsize = 13 ,fontweight = "bold" ,pad = 20 ) 33for i ,tokens in enumerate ([32768 ,131072 ]): 34for variant ,offset in [("chunk1024" ,- .20 ), ("chunk8192" ,.20 )]: 35match = [r for r in rows if int (r ["input_tokens" ])== tokens and r ["variant" ]== variant ] 36assert len (match )== 1 37value = float (match [0 ][metric ]) 38ax .barh (i + offset ,value ,height = .32 ,color = colors [variant ],zorder = 3 ) 39ax .text (value + 4 ,i + offset ,f" { value :.2f } s" ,va = "center" ,fontsize = 11 ) 40ax .set_yticks ([0 ,1 ], ["32K input" ,"128K input" ]) 41ax .set_ylim (1.6 ,- .6 ) 42ax .set_xlim (0 ,275 ) 43ax .tick_params (axis = "both" ,length = 0 ,pad = 10 ) 44ax .set_axisbelow (True ) 45ax .grid (axis = "x" ,color = grid ,linewidth = .8 ) 46ax .set_xlabel ("Seconds / request" ,labelpad = 10 ) 47fig .text (.04 ,.158 ,"RTX PRO 6000 Blackwell Workstation 96 GB / 400 W · Ryzen 9 7950X · 128 GB RAM" , 48fontsize = 10 ,fontweight = "bold" ) 49fig .text (.04 ,.113 ,"1,024 output tokens per request. Decode remained 143–147 tok/s with the larger chunk. Model loading excluded." , 50fontsize = 10 ,color = muted ) 51fig .text (.04 ,.073 ,"Unmodified engine and weights; prefill borrowing disabled. Single observations; output-token differences are recorded." , 52fontsize = 9.5 ,color = muted ) 53fig .text (.04 ,.035 ,"Measured 2026-10-06. The faster configuration's hardware profile is in progress." ,fontsize = 9.5 ,color = muted ) 54for ext in ["png" ,"svg" ]: 55fig .savefig (ROOT / f"overview. { ext } " ,dpi = 180 ,facecolor = fig .get_facecolor (), 56metadata = {"Date" :None }if ext == "svg" else None ) 57svg = ROOT / "overview.svg" 58svg .write_text ("\n" .join (line .rstrip ()for line in svg .read_text ().splitlines ())+ "\n" )