Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/benchmarks-mv/blob/main/native/queueflow/evidence/wolfram/f4.call.wl # benchmarks-mv Measurement harnesses and evidence bundles for AIEN on the NVIDIA DGX Spark GB10. Speed is reported against the machine's physical limit and my own previous run. Attachment of AienOS. Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `main` Branches Tags History `benchmarks-mv / native / queueflow / evidence / wolfram / f4.call.wl` 80 lines ยท 5200 bytes Raw Blame History 1 qfLines[rows_, d0_] := Module[ 2 {n = Length[rows], a, s, e, l, c, v, o, held, el, sv, ac, d, an = 0, f, rc, nr = 0, p, ar, gp, g, sq, 3 svc, drop, acc, fcfs, elig, arms, names = {"A", "B", "Cr", "Ch", "C"}, cfg, line, met, K, 4 kl, cmp, ovl, mq, w, nm}, 5 a = rows[[All, 1]]; s = rows[[All, 2]]; e = rows[[All, 3]]; l = rows[[All, 4]]; 6 c = rows[[All, 7]]; v = rows[[All, 8]]; o = rows[[All, 9]]; 7 held = Map[# > 0 &, s]; 8 el = ConstantArray[0, n]; sv = ConstantArray[0, n]; ac = ConstantArray[0, n]; 9 ar = ConstantArray[0, n]; gp = ConstantArray[0, n]; sq = ConstantArray[0, n]; 10 d = d0; 11 Do[g = a[[i]] - d; ar[[i]] = a[[i]]; 12 If[d > 0 && 0 <= g <= 3, gp[[i]] = g; 13 If[i > 1, ar[[i]] = ar[[i - 1]]; If[o[[i]] == o[[i - 1]], sq[[i]] = 1]]]; 14 f = Max[a[[i]], d]; 15 If[held[[i]], 16 If[s[[i]] < f, an++]; el[[i]] = If[s[[i]] > f, s[[i]], ar[[i]]]; 17 sv[[i]] = e[[i]] - s[[i]]; If[e[[i]] < s[[i]], an++]; 18 ac[[i]] = Boole[c[[i]] == 0 && v[[i]] != 1]; d = e[[i]], 19 el[[i]] = ar[[i]]; sv[[i]] = 0; ac[[i]] = 0; If[e[[i]] > f, d = e[[i]]]], {i, n}]; 20 rc = ConstantArray[0, n]; 21 Do[p = SelectFirst[Range[i - 1, 1, -1], o[[#]] == o[[i]] &, 0]; 22 If[p > 0 && ac[[p]] == 0 && 0 <= a[[i]] - e[[p]] <= 3600, rc[[i]] = rc[[p]] + 1; nr++], 23 {i, n}]; 24 svc[i_, cap_] := If[cap == 1 && l[[i]] > 0 && sv[[i]] > l[[i]], l[[i]], sv[[i]]]; 25 drop[i_, r_] := r == 1 && rc[[i]] > 1; 26 acc[i_, cap_, r_] := Boole[ac[[i]] == 1 && ! drop[i, r] && ! (cap == 1 && l[[i]] > 0 && sv[[i]] > l[[i]])]; 27 fcfs[cap_, r_] := Module[{dd = d0, h = 0, xs = ConstantArray[0, n], xd = ConstantArray[0, n], 28 xv = ConstantArray[0, n], xa = ConstantArray[0, n], ff, st, t}, 29 Do[If[drop[i, r], xd[[i]] = a[[i]], 30 ff = Max[ar[[i]], dd + gp[[i]]]; 31 If[held[[i]], 32 st = Max[ff, el[[i]]]; h += st - ff; t = st + svc[i, cap]; 33 xs[[i]] = st; xd[[i]] = t; xv[[i]] = 1; xa[[i]] = acc[i, cap, r]; dd = t, 34 If[e[[i]] > ff, h += e[[i]] - ff; dd = e[[i]]]; xd[[i]] = e[[i]]]], {i, n}]; 35 {xs, xd, xv, xa, h}]; 36 elig[cap_, r_] := Module[{t = d0, xs = ConstantArray[0, n], xd = ConstantArray[0, n], 37 xv = ConstantArray[0, n], xa = ConstantArray[0, n], pend, ct, b}, 38 Do[Which[drop[i, r], xd[[i]] = a[[i]], held[[i]], xv[[i]] = -1, True, xd[[i]] = e[[i]]], {i, n}]; 39 While[(pend = Flatten[Position[xv, -1]]) =!= {}, 40 ct = Map[Function[j, If[sq[[j]] == 1, 41 If[xv[[j - 1]] == -1, Infinity, Max[t, ar[[j]], el[[j]], xd[[j - 1]] + gp[[j]]]], 42 Max[t, ar[[j]], el[[j]]]]], pend]; 43 b = pend[[First[Flatten[Position[ct, Min[ct]]]]]]; 44 xs[[b]] = Min[ct]; xd[[b]] = xs[[b]] + svc[b, cap]; xv[[b]] = 1; xa[[b]] = acc[b, cap, r]; 45 t = xd[[b]]]; 46 {xs, xd, xv, xa, 0}]; 47 cfg = {{0, 0, False}, {1, 0, False}, {1, 1, False}, {1, 0, True}, {1, 1, True}}; 48 arms = Map[If[#[[3]], elig[#[[1]], #[[2]]], fcfs[#[[1]], #[[2]]]] &, cfg]; 49 ovl[x_] := Module[{srv = Flatten[Position[x[[3]], 1]]}, 50 Count[Subsets[srv, {2}], {i_, j_} /; x[[1, i]] < x[[2, j]] && x[[1, j]] < x[[2, i]]]]; 51 mq[x_] := Max[Table[Count[Range[n], j_ /; ar[[j]] <= ar[[i]] && ar[[i]] < x[[2, j]]], {i, n}]]; 52 met[m_] := Module[{x = arms[[m]], r = cfg[[m, 2]], srv}, 53 srv = Flatten[Position[x[[3]], 1]]; 54 StringJoin["QF arm=", names[[m]], 55 " served=", ToString[Length[srv]], 56 " acc=", ToString[Total[x[[4]]]], 57 " dropped=", ToString[Count[Range[n], i_ /; drop[i, r]]], 58 " lostacc=", ToString[Count[Range[n], i_ /; ac[[i]] == 1 && x[[4, i]] == 0]], 59 " busy=", ToString[Total[x[[2, srv]] - x[[1, srv]]]], 60 " useful=", ToString[Total[Map[If[x[[4, #]] == 1, x[[2, #]] - x[[1, #]], 0] &, Range[n]]]], 61 " hol=", ToString[x[[5]]], 62 " mina=", ToString[Min[a]], 63 " maxdep=", ToString[Max[x[[2]]]], 64 " soj=", ToString[Total[x[[2]] - ar]], 65 " viol=", ToString[Count[x[[2]] - ar, _?Negative]], 66 " overlap=", ToString[ovl[x]], 67 " maxq=", ToString[mq[x]], 68 " replayerr=", ToString[If[m == 1, Count[Range[n], i_ /; held[[i]] && x[[1, i]] != s[[i]]], 0]]]]; 69 K = Select[Range[n], Function[i, AllTrue[arms, #[[4, i]] == 1 &]]]; 70 kl[m_] := Module[{ww = Sort[arms[[m, 1, K]] - a[[K]]], k = Length[K]}, 71 StringJoin["QF K arm=", names[[m]], " n=", ToString[k], " sumw=", ToString[Total[ww]], 72 If[k > 0, StringJoin[" p95=", ToString[Quantile[ww, 95/100]], " maxw=", ToString[Max[ww]]], ""]]]; 73 cmp[x_, y_] := Module[{dx = arms[[x, 1, K]] - arms[[y, 1, K]]}, 74 StringJoin["QF cmp x=", names[[x]], " y=", names[[y]], 75 " worse60=", ToString[Count[dx, _?(# > 60 &)]], " better60=", ToString[Count[dx, _?(# < -60 &)]]]]; 76 nm = Count[held, True]; 77 Join[{StringJoin["QF trace rows=", ToString[n], " held=", ToString[nm], " anomalies=", ToString[an], 78 " retries=", ToString[nr], " d0=", ToString[d0]]}, 79 Map[met, Range[5]], Map[kl, Range[5]], {cmp[5, 2], cmp[4, 2], cmp[2, 1]}]] 80 StringRiffle[Join[qfLines[{{1000,1000,1100,40,0,0,0,0,1,0,0},{1010,1100,1150,600,0,0,0,0,2,0,0},{1020,1300,1400,600,0,0,0,0,3,0,0},{1030,1400,1420,600,0,0,0,0,4,0,0},{1500,1500,1600,600,0,0,2,1,5,0,0},{1610,1610,1700,600,0,0,3,2,5,0,0},{1710,1710,1750,600,0,0,0,0,5,0,0},{1800,0,1900,600,0,0,1,2,6,0,0},{1850,1900,1950,600,0,0,0,0,7,0,0}}, 0]], "\n"]