mirror of
https://github.com/mw00/project-maya.git
synced 2026-12-03 21:08:26 +07:00
[PR #237] glm prefill: STRATA_GLM_PREFILL_STAGES (on; =0 silences) prints where a prompt chunk's wall went #415
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
mw00/project-maya#415
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Original Pull Request: https://github.com/mw00/project-maya/pull/237
State: closed
Merged: No
What this changes
STRATA_GLM_PREFILL_STAGES(on by default;=0silences) prints where a prompt chunk's wall went. A chunk is one long copy lane (the staged experts) beside the compute stream, and nothing said where its wall goes: the profiling prints only at exit, and the trace is a debug knob.One line a part a chunk says: the copy lane's span split into the copies (with the PCIe GB/s over the copy time), the ring waits (a group's staging slot still being read), the gaps inside a layer's groups, and the windows between two layers' groups (the mixer and the host's plan - where a lane that is going to idle, idles); the lane's lead and tail beside it (lead + lane + tail = wall); the bytes and experts each lane moved (RAM, disk, VRAM staged, resident, prestaged, CPU); the host's plan time, disk waits and the hop in; and the layer lane's max/min. One line a prompt then gives each part's chunk walls and what the hand-overs between them cost, ending
N chunk(s) of T tokens.The syncs it adds wait only on copies the compute stream has already waited on (the last MoE layer prestages no next one), so
STRATA_GLM_PREFILL_STAGES=0beside a--benchis the A/B that should find no cost.The branch also fixes two faults in the first version of the line: its events are destroyed with the rest of the prompt path (the pool can be rebuilt, e.g. by the vision lend, so leaked events would accumulate), and the line reads only the events its chunk recorded - the head part has no hop in, and
cudaEventElapsedTimeon an event with nothing recorded returns "invalid resource handle" and leaves it set, which made every prompt that reached the line die. A query that fails now clears its own error and reads -1. The per-prompt summary also says448 tokens, not1 chunk of 448.What it leaves alone
The compute path is unchanged and
=0restores silence. The row is indocs/SETTINGS.mdas on by default, as the checkout commits it.Measurements
Verified on a fresh 421-token prompt after a restart: four part lines, walls 1,735 / 1,187 / 1,473 / 989 ms, lead + lane + tail = wall on every one, copies 6.4 GB/s on the two 5060s and 9.0 GB/s on the two 3060s, ring wait 0, mixer windows 146 / 200 / 269 / 187 ms; the summary read
glm prefill: 421 tokens in 5549.2 ms (13.18 ms/token, 76 tok/s), 1 chunk of 448 tokens; the answer decoded at 82.3 ms/token. No cost is claimed for the line itself; the=0A/B is the check.Checks
src/core/glm_prefill.cucompiles clean with the build's own flags (nvcc 13.2, compute_86 + compute_120).python3 tools/check_hip_compat.pypasses.🤖 Generated with Claude Code