Skip to content

Add separate rate limit for graph launches (default 20/s) - #22

Merged
gnurizen merged 1 commit into
mainfrom
graph-rate-limit
Jun 30, 2026
Merged

Add separate rate limit for graph launches (default 20/s)#22
gnurizen merged 1 commit into
mainfrom
graph-rate-limit

Conversation

@gnurizen

Copy link
Copy Markdown
Contributor

Graph launches previously bypassed the callback rate limiter entirely. On graph-heavy workloads (e.g. TRT-LLM decode) a high graph-replay rate floods the cupti_events ringbuf: each graph launch fans out to many kernel activity records, and graphs dominate GPU event volume. Observed ~330 graph launches/s aggregate (peaks 737/s) on a 4×B200 node, with ringbuf drops tracking the bursts.

Give graph launches their own thread-local token bucket (default 20/s, PARCAGPU_GRAPH_RATE_LIMIT) instead of the bypass. A rate-limited graph launch is never inserted into the graph correlation map, so its kernel activities are filtered before reaching the ringbuf — throttling the dominant traffic at the source. Separate budgets preserve the original intent: eager bursts can't starve graph sampling.

Also fixes rate-limit application across threads: env-configured rates now live in process-global atomics that each thread copies into its thread_local bucket on first use. Previously init_debug called setRate on the thread_local bucket directly, so PARCAGPU_RATE_LIMIT (and the new graph knob) only affected the single thread that ran init_debug.

Graph launches previously bypassed the callback rate limiter entirely, so a
high graph-replay rate could flood the cupti_events ringbuf: each graph launch
fans out to many kernel activity records, and graphs dominate GPU event volume
on graph-heavy workloads (e.g. TRT-LLM decode).

Give graph launches their own token bucket (default 20/sec,
PARCAGPU_GRAPH_RATE_LIMIT) instead of the bypass. This preserves the original
intent -- eager bursts can't starve graph sampling, since the budgets are now
separate -- while bounding graph bursts. A rate-limited graph launch is never
inserted into the graph correlation map, so its kernel activities are filtered
before they reach the ringbuf, throttling the dominant traffic at the source.

Apply both configured rates (eager and graph) from process-global atomics that
each thread copies into its thread_local bucket on first use. Previously
init_debug called setRate on the thread_local bucket directly, which only
affected the single thread that ran init_debug -- so PARCAGPU_RATE_LIMIT (and
the new graph knob) silently had no effect on other launching threads.
@gnurizen
gnurizen merged commit caad3a3 into main Jun 30, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants