okami.mom/strata
git clone https://git.nkp.pet/okami.mom/strata
fcb0c2d0e
main
1# DFlash2 experiment runner on strix. One engine process at a time; reads ids from C:\strata-test\dflash2\p\<name>.*.ids 2# usage: run_one.ps1 -Mode gen|genf|genfm|tap|tcycle -Name <prompt> [-MaxNew N] [-Cycle 1,2,...] 3param ([string ]$Mode , [string ]$Name , [int ]$MaxNew =900 , [string ]$Cycle ="" , [string ]$Exe ="strata-hook.exe" , [string ]$Tag ="" , [string ]$Extra ="" ) 4$ErrorActionPreference ="Continue" 5$W ="C:\strata-test\dflash2" 6$D ="C:\Users\Administrator\Documents\Strata" 7$OWN ="C:\Users\Administrator\AppData\Local\Strata\terminal\0.1.46.1" 8$env:LOCALAPPDATA ="C:\strata-test\la" 9$env:APPDATA ="C:\strata-test\la" 10New-Item -ItemType Directory -Force -Path$env:LOCALAPPDATA |Out-Null 11New-Item -ItemType Directory -Force -Path" $W \out" |Out-Null 12$env:STRATA_ARENA_PIN_GIB ="none" 13$env:PATH =" $W \eng\rocm\bin;" + $env:PATH 14$mtp =$D + "\mtp\rt" 15$base = @("--pack" ," $D \packs\iq3_s" , 16"--native" ," $D \models\IQ3_S\Qwen3.8-Flash-Next-GSQ-RCO-IQ3_S-00001-of-00002.gguf" , 17"--ple-gguf" ," $D \models\IQ3_S\Qwen3.8-Flash-Next-GSQ-RCO-IQ3_S-00002-of-00002.gguf" , 18"--expert-profile" ," $OWN \data\expert-profile.bin" , 19"--expert-cache" ,"auto" ,"--prefill" ,"auto" ,"--max-context" ,"4096" ,"--kv" ,"int8" ,"--vram-reserve-mib" ,"700" ,"--greedy" ) 20$exe =" $W \eng\ $Exe " 21$out =" $W \out\ ${Mode} _ ${Name}${Tag} .txt" 22$err =" $W \out\ ${Mode} _ ${Name}${Tag} .err" 23Remove-Item $out ,$err -ErrorAction SilentlyContinue 24if ($Mode -eq "gen" ) { 25$ids = (Get-Content " $W \p\ $Name .prompt.ids" -Raw).Trim () 26$a =$base + @("--spec" ,"4" ,"--spec-min-p" ,"0.5" ,"--mtp" ,$mtp ,"--max-new" ," $MaxNew " ,"--stop-eos" ,"--tokens" ,$ids ) 27}elseif ($Mode -eq "genf" -or $Mode -eq "genfm" ) { 28# the production flags on a fixed text: the drafts are judged against the continuation in <name>.out.ids 29$ids = (Get-Content " $W \p\ $Name .prompt.ids" -Raw).Trim () 30$n = (Get-Content " $W \p\ $Name .out.ids" -Raw).Split ("," ).Count 31$a =$base + @("--spec" ,"4" ,"--spec-min-p" ,"0.5" ,"--mtp" ,$mtp ,"--spec-follow" ," $W \p\ $Name .out.ids" ,"--max-new" ," $n " ,"--tokens" ,$ids ) 32if ($Mode -eq "genfm" ) {$a += @("--suffix-draft" ,"0" ) } 33}elseif ($Mode -eq "tap" ) { 34$env:STRATA_TAP_FILE =" $W \out\tap_ $Name .bin" 35Remove-Item $env:STRATA_TAP_FILE -ErrorAction SilentlyContinue 36$first = (Get-Content " $W \p\ $Name .first.ids" -Raw).Trim () 37$n = (Get-Content " $W \p\ $Name .rest.ids" -Raw).Split ("," ).Count 38$a =$base + @("--spec" ,"8" ,"--spec-oracle" ," $W \p\ $Name .rest.ids" ,"--spec-follow" ," $W \p\ $Name .rest.ids" ,"--max-new" ," $n " ,"--tokens" ,$first ) 39}elseif ($Mode -eq "tcycle" ) { 40$env:STRATA_SPEC_T_CYCLE =$Cycle 41$first = (Get-Content " $W \p\ $Name .first.ids" -Raw).Trim () 42$a =$base + @("--spec" ,"8" ,"--spec-oracle" ," $W \p\ $Name .rest.ids" ,"--spec-follow" ," $W \p\ $Name .rest.ids" ,"--max-new" ," $MaxNew " ,"--tokens" ,$first ) 43}else {"bad mode" ;exit 2 } 44if ($Extra -ne "" ) {$a +=$Extra .Split ("_" ) } 45Set-Location $OWN 46$t0 =Get-Date 47$p =Start-Process -FilePath$exe -ArgumentList$a -RedirectStandardOutput$out -RedirectStandardError$err -NoNewWindow -PassThru 48$p .WaitForExit () 49"EXIT " + $p .ExitCode + " after " + [int ]((Get-Date )- $t0 ).TotalSeconds + " s" 50Get-Content $out |Select-String -Pattern"^decode|^speculation|^window|^accepted|^mtp|^suffix|^verify window" | ForEach-Object {$_ .Line .Substring (0 , [Math ]::Min (300 ,$_ .Line .Length )) }