Repository navigation
Conversation
… skip the device's frontier check
|
Thanks for the bisection and the careful measurements in #1854. I'm closing this for now, because we don't yet know whether it fixes the source of the slowdown. #1854 shows that the entry check costs time, but not why, and this PR removes the check only where the host can stand in for it. The first round after each sync recovers the time. Every round chained after it still pays the check, so bangs that run more than one round keep the slowdown. That fits your training loop, which is made of one-round bangs, while the 17 benches stay flat. The PR also adds a fourth kernel argument that Metal ignores, and uses For the record, I ran the cluster gates on this branch (the minis use the Metal path): test 1707/1707, ping 80/80, and safe 1720 files with 0 false rejects, timeouts or infrastructure errors. Repo is 53/54 (the cap). Perf against its base, 3 alternated runs each, gives a geomean of 0.995x on the Metal GPU cells and 1.00x elsewhere. Its one failing cell, bfs on the GPU, fails on We'd like to find the cause first. I've asked in #1854 for a reproduction we can run. If you want to dig further meanwhile, here are three cheap experiments, any of which might give a one- or two-line fix that helps every round:
If one of these recovers the 3%, a PR with that change would be very welcome. |
Fixes #1854
Since 2.0.38 a GPU training loop of mine is about 3% slower on CUDA, and the cost is #1447's entry check in
bend_dev(#1854 has the bisection and the variants that isolate it). This keeps #1447's device-chained rounds and takes the check off the round the host can pick itself.Change
bend2/comp.tsonly.turn_groups(f, at), the same rule the device applies), and those launches skip the check.chk, and checks only when it is set.gpu_run(f)takes the frontier the host read, or 0 for "launch all five, checked".gpu_kerneltakes the unusedchk, and its one call isgpu_run(0)), so it launches the same dispatches as before. The host CPU path doesn't change.Measurements
The training loop from #1854, current code, main (295e996) against this branch, 5 alternated rounds on an idle machine, the same output bits:
The 17 runtime benches in PAR-GPU mode (
+RTS --gpu <the gate's MEMORY size>), built by each compiler withCUDA_HOMEset, 5 alternated rounds on an idle machine, medians in ms, every output identical between the two:Geometric mean 1.00x: the benches neither gain nor lose.
Tests
The 42 tests that call a bang, built for CUDA by main and by this branch and run on the GPU: the 40 that are programs print their
#|lines on both; the two intests/printer/aren't runnable programs and fail to build the same way on both.Gates
bun gates/repo.tsfails only on the cap:comp.tsis 66,096 ttok, 96 over 66,000 (main is under it). I didn't trim anything to fit.Not tested
gates/test.ts,gates/perf.tsandgates/safe.tsneed the cluster.