Skip to content

Commit fb66367

Browse files
borisbatclaude
andcommitted
decode_prof: --trace saves a jobque lane trace of the window (archived-tool parity)
Lifted from history/dasLLAMA/benchmarks/decode_prof.das (the archived predecessor — which this file should have credited instead of assuming deletion). First use settled the lane question: at -t N all N lanes (N-1 workers + the computing caller) run 95-97% busy in the decode window; t7 and t8 do equal wall work, so the t7==t8 pace plateau is shared-resource saturation, not a parked or half-productive lane. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
1 parent a0e9480 commit fb66367

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

modules/dasLLAMA/benchmarks/decode_prof.das

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ struct Args {
4747
@clarg_doc = "Disable the fused decode chains (set_fused_decode(false)) — the chain-vs-per-op A/B lever"
4848
no_fused : bool
4949

50+
@clarg_doc = "Save a jobque lane trace of the measurement window to this path (perfetto JSON; adds ring overhead — don't trust the pace of a traced run)"
51+
trace : string
52+
5053
@clarg_short = "?"
5154
@clarg_doc = "Show this help and exit"
5255
help : bool
@@ -112,12 +115,21 @@ def main() {
112115
forward_prefill(t, s, prompt, depth, 0l)
113116
}
114117
forward(t, s, synth_id(0l, 999l), depth) // warmup token — untimed, outside the window
118+
if (!empty(cfg.trace)) {
119+
jobque_trace_start(1 << 21) // decode makes ~30k chunk events/token — size for a ~32-token window
120+
set_trace_tags(true)
121+
}
115122
forward_profile_reset()
116123
let t0 = ref_time_ticks()
117124
for (i in range64(ngen)) {
118125
forward(t, s, synth_id(i, 1l), depth + 1l + i)
119126
}
120127
let us = get_time_usec(t0)
128+
if (!empty(cfg.trace)) {
129+
set_trace_tags(false)
130+
jobque_trace_stop()
131+
print(jobque_trace_save(cfg.trace) ? "jobque trace saved: {cfg.trace}\n" : "jobque trace: nothing recorded\n")
132+
}
121133
forward_profile_report()
122134
let pace = double(ngen) * 1.0e6lf / double(us)
123135
print("WINDOW depth={depth + 1l} n={ngen} wall_us={us} us_per_token={int64(us) / ngen} pace={pace:.2f} tok/s\n")

0 commit comments

Comments
 (0)