okami.mom/strata
git clone https://git.nkp.pet/okami.mom/strata
1fb3e9a32
main
1#!/bin/bash 2# co_bt.sh ROOT OUT [N] - batch_test arms, dumps compared: A/A2 layer-major alone (noise), B layer-major co-read, C the usual chunk-major read 3R =$ 1 ;O =$ 2 ;N =${ 3 :-4} ;mkdir -p $ O 4PY =/data/external/niko/t027/venv/bin/python 5export STRATA_ROUTE_TAIL_SKIP =0STRATA_PREFILL_CPU_SHARE =0STRATA_CRASH_BT =$ O /crash.txt 6CFG =$ R /res/co/cog_on-cfg.json 7for arm in A A2 B C;do 8EXTRA ="" ; [$ arm = B ]&& EXTRA ="--co" 9if [$ arm = C ];then unset STRATA_PREFILL_LM_FORCE ;else export STRATA_PREFILL_LM_FORCE =1;fi 10STRATA_DUMP_FIRST_LOGITS =$ O /lg-$ arm BATCH_TEST_LOG =$ O /engine-$ arm.log $ PY $ R /h/tools/batch_test.py--exe $ R /h/b86/strata--config $ CFG --batch $ N --n $ N --max-new 96--pad 900--skip-solo --dump $ O /dump-$ arm.json$ EXTRA > $ O /bt-$ arm.out2 >&1 11echo "== $ arm rc= $ ?" ;grep -E "batch: [0-9]+ slots|co-read:" $ O /bt-$ arm.out$ O /engine-$ arm.log| cut -c1-240 | head -4 12done 13$ PY - <<PY 14import json 15d={a:json.load(open(" $ O /dump-%s.json"%a))["batch"] for a in ("A","A2","B","C")} 16def cmp(x,y): 17r=[] 18for p,q in zip(d[x],d[y]): 19r.append("same" if p==q else "DIFF@%d"%next(k for k in range(min(len(p),len(q))) if p[k]!=q[k])) 20return r 21for x,y in (("A","A2"),("A","B"),("A","C"),("B","C")): 22print(x,"vs",y,cmp(x,y)) 23PY 24 25$ PY $ R /h/tools/par/kl_logits.py$ O lg C A A2 B2 >&1| head -8 26$ PY $ R /h/tools/par/kl_logits.py$ O lg A A2 B2 >&1| head -8