Repository navigation
Trustworthy Node timings: full-resolution timestamps, warm-up before large tests, V100 baseline - #80
Merged
Merged
Conversation
…t Dawn's rounding Dawn rounds GPU timestamps down to multiples of 65.536 us by default, on every GPU (a privacy measure). Every time in the M4 baseline, and all 115 in a new V100 run, is a multiple of 0.065536 ms. The regression runner now creates its GPU with disable-dawn-features=timestamp_quantization. timing-strategy.md gets a "Timestamp resolution" section (Node: the create() flag; Chromium: --disable-dawn-features=timestamp_quantization; otherwise use trials). The regression-plan doc blamed the 65.536 us grain on Apple Silicon; corrected. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015kfNC6id65zEHzuAAH4jtJ
GPUs lower their clocks when they look idle, and single executes separated
by CPU work look idle. On daisy's V100 the SM clock fell from 1,297 to
180 MHz ("GPU Idle" the only reason) during a sort timing run, and every
kernel slowed by up to 10x, the same factor for all of them. Before the timed
trials of each test of 1M elements or more, the runner now runs the
primitive back to back for 200 ms, doubling trials until one execute keeps
the GPU busy for 20 ms. Documented in node_webgpu_regression_plan.md, with
clock locking for runs that must be comparable.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015kfNC6id65zEHzuAAH4jtJ
…ion timestamps and warm-up Recorded at 1,530 MHz while busy (nvidia-smi). The 2M i32 key-value sort (2.91 ms against 0.54-0.63 ms for its siblings, during a clock dip) is left out so that it is recorded fresh. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015kfNC6id65zEHzuAAH4jtJ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two changes so the Node regression runner's timings can be trusted.
1. Full-resolution timestamps
Dawn rounds GPU timestamps down to multiples of 65.536 µs (2^16 ns) by default, on every GPU, to limit timing side channels. All 115 timings in a V100 baseline run were multiples of 0.065536 ms, and so is every time in the existing M4 baseline. Most single executes in the suite take less than that.
examples/regression_node.mjs: creates its GPU withdisable-dawn-features=timestamp_quantization.docs/timing-strategy.md: a new "Timestamp resolution" section covering:create()flag;--disable-dawn-features=timestamp_quantization;trials.docs/node_webgpu_regression_plan.md: it blamed the 65.536 µs grain on Apple Silicon. It's Dawn, on any GPU; corrected.2. Warm-up before timing large tests
GPUs lower their clocks when they look idle, and single executes separated by CPU work look idle. On daisy's V100 (GPU 0, the one driving the display),
nvidia-smishowed the SM clock falling from 1,297 to 180 MHz during a sort timing run. The only throttle reason was "GPU Idle" (0x1). Every kernel slowed by up to 10×, even the one-workgrouponesweep_scan.That made sort look broken: 2^24 keys took 33.9 ms (0.5 G keys/s). At full clock, the same sort takes 2.9 ms (5.7 G keys/s).
trialsuntil one execute keeps the GPU busy for 20 ms.nvidia-smi --lock-gpu-clocks) for runs that must be comparable.Checked:
At 2^24 elements on the V100, before (idle clocks) and now:
3. V100 baseline
perf_baseline.jsongains the V100 run. One entry is left out: the 2M i32 key-value sort took 2.91 ms against 0.54–0.63 ms for its siblings, apparently during a clock dip, so it will be recorded fresh next time.After this merges, the M4 baseline should be re-recorded (
UPDATE_BASELINE=true). It was recorded with rounded timestamps and no warm-up.https://claude.ai/code/session_015kfNC6id65zEHzuAAH4jtJ
Generated by Claude Code