Spaces:
Running
Running
spec bench: warmup + short prompt + 192-tok decode-dominated (fix prefill confound)
Browse files- index.html +6 -2
index.html
CHANGED
|
@@ -144,11 +144,15 @@ const eqArr = (a, b) => a.length === b.length && a.every((x, i) => x === b[i]);
|
|
| 144 |
async function runSpecBench() {
|
| 145 |
log.innerHTML = ""; input.disabled = send.disabled = true;
|
| 146 |
if (!engine.specAvailable) { st.textContent = "spec-decode unavailable for this model"; bubble("a", "This model can't use the batched-verify head (specAvailable=false)."); return; }
|
| 147 |
-
const N =
|
| 148 |
let prev = { windows: 0, drafted: 0, accepted: 0 };
|
|
|
|
|
|
|
|
|
|
|
|
|
| 149 |
for (const b of SPEC_BENCH) {
|
| 150 |
st.textContent = `bench: ${b.tag}…`;
|
| 151 |
-
const ids = engine.tokenize(
|
| 152 |
globalThis.__spec = false; engine.reset();
|
| 153 |
const t0 = performance.now(); const r0 = await engine.generate(ids.slice(), { maxNew: N, repPenalty: rep }); const w0 = performance.now() - t0;
|
| 154 |
globalThis.__spec = true; engine.reset();
|
|
|
|
| 144 |
async function runSpecBench() {
|
| 145 |
log.innerHTML = ""; input.disabled = send.disabled = true;
|
| 146 |
if (!engine.specAvailable) { st.textContent = "spec-decode unavailable for this model"; bubble("a", "This model can't use the batched-verify head (specAvailable=false)."); return; }
|
| 147 |
+
const N = 192, rep = m.rep ?? 1.3, rows = []; // long gen so DECODE dominates (prefill was the old confound)
|
| 148 |
let prev = { windows: 0, drafted: 0, accepted: 0 };
|
| 149 |
+
// warm up to boost the GPU clock (cold vs boosted differs ~2.4×) — measure only when warm
|
| 150 |
+
st.textContent = "warming up (boosting GPU clock)…";
|
| 151 |
+
globalThis.__spec = false; engine.reset();
|
| 152 |
+
await engine.generate(engine.tokenize(engine.frameTurn("Write one sentence about the sea.", false)), { maxNew: 48, repPenalty: rep });
|
| 153 |
for (const b of SPEC_BENCH) {
|
| 154 |
st.textContent = `bench: ${b.tag}…`;
|
| 155 |
+
const ids = engine.tokenize(engine.frameTurn(b.text, false)); // NO long system prompt — keep prefill small
|
| 156 |
globalThis.__spec = false; engine.reset();
|
| 157 |
const t0 = performance.now(); const r0 = await engine.generate(ids.slice(), { maxNew: N, repPenalty: rep }); const w0 = performance.now() - t0;
|
| 158 |
globalThis.__spec = true; engine.reset();
|