Results (3 prompts x 41 teacher-forced rows): port vs Original agree exactly at the embedding and the first GDN half; relL2 of the residual then grows smoothly with depth (1e-3 after layer 0 FFN, ~1e-2 by layers 8-13, 5-15e-2 by layers 28-44). The Original's own GPU-expert-cache vs CPU-expert arms show the same profile and the same logprob spread (median 0.287 vs port 0.292). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
21 lines
1.1 KiB
Python
21 lines
1.1 KiB
Python
import sys, math
|
|
sys.path.insert(0, "/home/para/work/gpu-runs/numerics")
|
|
import num_lad_tools as T
|
|
N = "/home/para/work/gpu-runs/numerics"
|
|
J = "/home/para/work/gpu-runs/holder2/jobs/100-numerics-ladder.log"
|
|
frames = [int(x) for x in sys.argv[2].split(",")]
|
|
c = sys.argv[1]
|
|
truth = [int(x) for x in open(f"{N}/cases_lad/{c}.ids").read().strip().split(",")] + [int(x) for x in open(f"{N}/cases_lad/{c}.port").read().split()]
|
|
pw = T.windows_port(J, c[1:]); ow = T.windows_orig(N + "/orig_lad/serve.err", c)
|
|
pv, ov = T.valid_rows(pw, truth), T.valid_rows(ow, truth)
|
|
W = T.W
|
|
for pos in sorted(set(pv) & set(ov)):
|
|
(pwi, pk), (owi, ok) = pv[pos], ov[pos]
|
|
a = T.rd(f"{N}/resid_lad/l_win{pw[pwi][2]:05d}_pos{pw[pwi][0]}.f32"); b = T.rd(f"{N}/orig_lad/l_win{ow[owi][2]:05d}_pos{ow[owi][0]}.f32")
|
|
pT, oT = len(pw[pwi][1]), len(ow[owi][1])
|
|
out = []
|
|
for fr in frames:
|
|
x = a[(fr*pT+pk)*W:(fr*pT+pk+1)*W]; y = b[(fr*oT+ok)*W:(fr*oT+ok+1)*W]
|
|
out.append("%.1e" % math.sqrt(sum((u-v)**2 for u,v in zip(x,y))/sum(v*v for v in y)))
|
|
print(pos, "port T=%d k=%d" % (pT, pk), "orig T=%d k=%d" % (oT, ok), " ".join(out))
|