Research paper
Where Deterministic cuDNN Loses Time on an 8×8 Board
A Bit-Reproducible 1.5× Training Speed-Up for a Compact Recurrent Chess Network on One Pascal GPU
Théo CHARLET (RDTvlokip) · 4 November 2026
- deterministic training
- reproducibility
- cuDNN
- convolution algorithms
- Winograd
- kernel fusion
- GPU profiling
- chess networks
In brief
Reproducible training usually means running cuDNN in deterministic mode and accepting whatever algorithms its heuristics select. For a compact recurrent chess network (11.05 million parameters) on one GTX 1080 Ti, deterministic cuDNN computed the 128-channel 3×3 forward convolutions with an FFT algorithm 2.4 times slower than its own input-gradient kernel for the same sum. Four speed-only options cut the time per step by 1.56× (1.52× in the real training command), two identical runs still produced bit-identical checkpoints, and each option stayed within 0.003 nat of its control in prespecified 45-minute fine-tuning runs. All measurements come from one GPU model, one cuDNN version and one seed per control run: an engineering case study, not a general claim.
Read and cite
- PDF and record on Zenodo
- DOI of this version: 10.5281/zenodo.23954463
- Cite all versions: 10.5281/zenodo.23954462
Abstract
Reproducible training of neural networks usually means running cuDNN in deterministic mode, accepting whatever algorithms its heuristics select. This report examines what that choice costs, and how much of the cost can be recovered without giving up bit-level reproducibility, for one concrete workload: a compact recurrent residual chess network (128 channels, 8 residual blocks applied twice, squeeze-and-excitation and a recurrence gate; 11.05 million parameters) trained by supervised imitation on 8×8 board encodings with batch size 512 on a single GTX 1080 Ti.
A kernel-level profile and per-convolution microbenchmarks showed that, in deterministic mode without benchmarking, cuDNN computed the forward pass of the 128-channel 3×3 convolutions with an FFT algorithm taking 1.83–1.92 ms per call, whereas its input-gradient (dX) kernel computed the same sum in 0.75–0.77 ms. Four speed-only options were introduced, each measured alone and then in combination: (i) computing the forward convolution through the dX kernel, using the exact identity between a convolution and a transposed convolution with a channel-swapped, rotated kernel; (ii) fusing the squeeze-and-excitation tail and the recurrence gate with TorchScript; (iii) a hand-written CUDA kernel for the squeeze-and-excitation tail with a fixed-order warp reduction; and (iv) imposing, through a small C++ extension calling cuDNN directly, the fused Winograd dX algorithm, which is deterministic, 20% faster than the algorithm PyTorch selected (0.600 versus 0.754 ms) and closer to a float64 reference.
On the full training step the four options reduced the time per step from 173.5 to 111.2 ms (1.56×, product of within-session ratios). In the real training entry point, the time per step fell from 163.6 ms without options to 107.6 ms with all four (1.52×), and two identical runs with all four options produced bit-identical checkpoints. Each option passed a prespecified control rule: in 45-minute fine-tuning runs from the same checkpoint and the same batches, the validation policy cross-entropy at equal step count stayed within 0.003 nat of the control at every checkpoint from 4,000 steps on (worst deviations 0.0019, 0.0018, 0.0023 and 0.0029). Negative results are reported as well: the mirror option previously adopted for a 96-channel network slowed the 128-channel network by 20%, and non-deterministic weight-gradient kernels brought no gain at 128 channels. All measurements come from one GPU model, one cuDNN version and one seed per control run; the results are an engineering case study, not a general claim about deterministic training.
Keywords: deterministic training; reproducibility; cuDNN; convolution algorithms; Winograd; kernel fusion; GPU profiling; chess networks.
1. Introduction
Small board-game networks are an unusual load for convolution libraries. The spatial size is tiny (8×8 for chess), the channel count moderate (64–256), and the batch large; the libraries were tuned mostly for images. When training must also be reproducible run to run, the usual recipe in PyTorch is to set cudnn.deterministic=True and cudnn.benchmark=False [1]. cuDNN then chooses among its deterministic algorithms by heuristic, without timing them, and the choice is rarely inspected.
RDTChess is a from-scratch chess network trained on human games; its training runs are kept bit-reproducible by project policy, because conclusions about architecture and objectives are drawn from paired comparisons between runs. The 128-channel model trains for about 8.7 hours per pass over 101.5 million positions on the only GPU available to the project (a GTX 1080 Ti, Pascal architecture, 2017). Training time therefore directly limits how many controlled experiments can be run. This report asks a narrow question: under the constraint that training stays bit-reproducible, how much of the step time can be removed without changing the function being learned, and where does deterministic cuDNN lose that time?
1.1 Contributions
A kernel-level diagnosis showing that deterministic cuDNN 8.9.7 selects an FFT forward algorithm for the 128-channel 3×3 convolutions on 8×8 inputs, 2.4 times slower than its own dX kernel for the same sum, and that the selection reverses at 96 channels.
Four speed-only training options, each with tests, a step-time benchmark and a prespecified 45-minute control run, together giving 1.52× end-to-end and 1.56× on the training step.
A small C++ extension that imposes a specific deterministic cuDNN algorithm, recovering a faster and more accurate kernel without resorting to
cudnn.benchmark, whose timed selection can differ between runs.End-to-end verification through the real training entry point that the accelerated recipe remains bit-reproducible.
A record of predictions written before each measurement, including those that failed, and of the negative results.
None of the individual techniques is new: algorithm selection, the convolution/transposed-convolution identity, operator fusion and custom kernels are standard. The contribution is a measured diagnosis of a specific deterministic-mode cost on board-game shapes and a reproducibility-preserving way to remove it.
2. Related work
cuDNN provides several algorithms for each convolution direction, including GEMM-based, FFT-based and Winograd-based ones [3]. FFT convolution for network training was studied by Mathieu et al. [4] and Vasilache et al. [5]; it pays off for large kernels and feature maps, not obviously for 3×3 kernels on 8×8 maps. Lavin and Gray introduced minimal-filtering Winograd algorithms for small convolution kernels [6]; Barabasz et al. analysed their floating-point error, which grows with the tile size, and showed how the choice of interpolation points affects accuracy [7]. PyTorch documents that deterministic mode may be slower and that cudnn.benchmark can select different algorithms in different runs [1], [2]. The squeeze-and-excitation block [8] is used here in the scale-and-bias form popularised by Leela Chess Zero [9]; AlphaZero-style chess networks [10] share the 8×8 geometry that makes these shapes unusual. The present work does not propose a new algorithm; it measures which existing ones a deterministic configuration actually uses on such a network, and how to select better ones without losing reproducibility.
3. System and methods
3.1 Model, training step and environment
The network encodes a position as 19 binary planes of 8×8. A 3×3 stem convolution feeds a tower of 8 residual blocks with 128 channels. The tower is applied twice (recurrence R=2) with shared convolution weights, a learned per-pass depth embedding and pass-specific BatchNorm layers; after each pass a gate (a 1×1 convolution on the concatenation of the new and previous states, followed by a sigmoid) mixes the two states. Each block contains two 3×3 convolutions without bias, BatchNorm, ReLU and a squeeze-and-excitation (SE) module producing a per-channel scale and bias, so that the block output is
y=ReLU(o⊙σ(s)+b+x),where x is the block input, o the output of the second BatchNorm, and (s,b) the SE outputs. A training step therefore applies 32 tower convolutions (8 blocks × 2 convolutions × 2 passes). Policy and value heads follow the trunk. The model has 11,053,665 parameters.
One training step is the loop of the project's supervised pre-training: forward pass, masked legal-move cross-entropy plus 0.5 times the value mean-squared error, backward pass, gradient-norm clipping at 1.0, and a fused AdamW update (learning rate 10−3, weight decay 10−4), batch size 512, float32, no mixed precision. cuDNN ran in deterministic mode with benchmarking disabled throughout.
Hardware and software: NVIDIA GeForce GTX 1080 Ti (compute capability 6.1, driver 581.29), Windows 10, Python 3.12, PyTorch 2.3.1+cu121, CUDA 12.1, cuDNN 8.9.7 (8907), MSVC 14.44 for the extensions, Nsight Systems 2023.1.2 for profiling.
3.2 Instruments
Kernel profile. Nsight Systems traced 50 or 200 steps between
cudaProfilerStart/Stop. Under tracing the GPU clock dropped (for example from 1,936 to 1,569 MHz), so only the proportions of kernel time are used, never absolute durations. Kernels were grouped into categories by a written rule (scriptnsys_postes.py), unrecognised kernels being listed separately.Per-call microbenchmarks. One 3×3 convolution at the real shape (512×128×8×8, weights 128×128×3×3), CUDA events, warm-up then 200 calls, three alternating rounds; accuracy as relative norm error against a float64 reference; determinism as bit equality of two calls.
Step benchmark. The full training step on real validation batches, 200 steps after 50 warm-up steps, two alternating passes per variant in one session. Because the baseline varied between sessions (163.8 versus 173.5 ms for the same configuration), only within-session ratios are combined.
End-to-end benchmark. The real training command (
main.py pretrain) from random initialisation, 2.4 million positions, every log line time-stamped on reception; throughput measured between the 0.8M and 2.4M position lines (3,125 steps, including periodic held-out evaluation and a checkpoint write). Variants in ABBA order.Control runs (“grafts”). Fine-tuning for 2,700 s of training time from an existing 128-channel checkpoint, on the same pre-encoded batches in the same order, with the optimizer state restored; validation policy cross-entropy (CE) on 20,000 held-out positions every 2,000 steps. Each option was added on top of the previous recipe, one at a time, against the previous run as control.
3.3 Prespecified control rule
Before each control run, the following rule and a prediction were committed to the project notebook: the option does not harm training if, at equal step count, |CEoption−CEcontrol|≤0.003 nat at every common checkpoint from 4,000 steps on. The threshold comes from an earlier measurement of paired run-to-run noise in this project. A step-0 CE identical to the control's verifies that both runs start from the same state. Options that change only the floating-point summation order cannot be expected to give identical trajectories: training amplifies rounding differences, and in an earlier pure-rounding control two runs differing only by summation order ended ±2 points apart on a puzzle accuracy whose bootstrap interval excluded zero. The rule therefore bounds the deviation instead of requiring equality.
4. Diagnosis
4.1 Profile of the baseline step
Without any option, the 128-channel step spent 36.4% of its kernel time in FFT kernels (32 per step), 21.2% in element-wise kernels, 14.1% in Winograd kernels (including the 33 weight-gradient calls per step), 9.4% in BatchNorm, 17.8% in dense heads and 1×1 convolutions, and 1.1% in the optimizer. The 32 FFT calls per step matched the 32 tower forward convolutions.
4.2 Deterministic algorithm selection depends on the channel count
Table 1 shows one convolution at three widths. At 96 channels the forward kernel was fast and the dX kernel slow; at 112 and 128 channels the forward kernel was slow (the FFT path) while the dX kernel remained fast at 128.
Table 1. One 3×3 convolution, batch 512, 8×8, deterministic cuDNN, ms per call (50 repetitions).
| 96 ch. | 112 ch. | 128 ch. | |
|---|---|---|---|
| Forward convolution (default path) | 0.56–0.65 | 1.67 | 1.85–1.92 |
| dX through the dedicated backward kernel | 1.37 | – | 0.76 |
| Forward computed through the dX kernel | 1.26 | 1.63 | 0.77 |
| Relative difference between the two forward paths | 2.2×10−6 | 0 | 2.5×10−6 |
This explained a negative result. An earlier option for the 96-channel network computed dX through the forward kernel and gave +13% steps per second there; at 128 channels the same option made the step 20% slower (204.6–206.4 versus 170.7–171.5 ms), because it routed dX through the slow FFT forward path.
4.3 Direct enumeration of cuDNN algorithms
A C++ extension called cudnnFind*AlgorithmEx and then ran each available algorithm explicitly at the real shape (Table 2). The algorithm used by PyTorch was identified by bit equality of outputs.
Table 2. cuDNN 8.9.7 algorithms at 512×128×8×8, best of three rounds of 200 calls. “Det.”: deterministic according to cuDNN / two calls bit-identical. “= PyTorch”: bit-identical to the algorithm PyTorch selected in deterministic mode.
| Direction | Algorithm | ms | Det. | Error vs float64 | = PyTorch |
|---|---|---|---|---|---|
| Forward | FFT | 1.836 | yes / yes | 1.9×10−7 | yes |
| Forward | WINOGRAD_NONFUSED | 0.773 | yes / yes | 2.1×10−6 | no |
| Forward | IMPLICIT_PRECOMP_GEMM | 1.126 | yes / yes | 4.1×10−7 | no |
| Forward | WINOGRAD (fused) | 1.201 | yes / yes | 3.3×10−7 | no |
| dX | WINOGRAD (fused) | 0.600 | yes / yes | 3.7×10−7 | no |
| dX | WINOGRAD_NONFUSED | 0.754 | yes / yes | 2.5×10−6 | yes |
| dX | ALGO_1 / FFT | 1.521 / 1.825 | yes / yes | – | no |
| dW | WINOGRAD_NONFUSED | 0.691 | yes / yes | 8.0×10−6 | yes |
| dW | ALGO_1 / FFT | 1.267 / 1.888 | yes / yes | – | no |
| dW | ALGO_3 (non-det.) | 1.272 | no / yes | 8.0×10−7 | no |
For dX, a fused Winograd algorithm existed that was deterministic, 20% faster and seven times closer to float64 than the one PyTorch selected. For dW, no algorithm was faster than the selected one; in particular, the non-deterministic mode gave the same time (0.697 versus 0.702 ms in a separate benchmark), unlike at 96 channels where it had been 2.5 times faster. GEMM-based deterministic alternatives for dW were much slower (6.0–7.5 ms).
5. Interventions
5.1 (i) Forward pass through the dX kernel (--fwd-as-dgrad)
For stride 1 and padding 1, a convolution equals a transposed convolution with the kernel's input and output channels swapped and its spatial axes rotated by 180 degrees:
conv2d(x,w)=conv_transpose2d(x,flip2,3(w⊤01)).Both sides compute the same sum; only the summation order, hence rounding, differs. A custom autograd function computes the forward pass this way (cuDNN then uses its dX kernel) and keeps the default kernels for the backward pass.
5.2 (ii) TorchScript fusion (--jit-fuse)
The SE tail ReLU(o⊙σ(s)+b+x) and the gate mix σ(ℓ)⊙c+(1−σ(ℓ))⊙x were written as scripted functions so that TorchScript fuses their element-wise operations. On the SE tail alone (forward and backward, real shape), the time fell from 1.535 to 1.122 ms; gradients were bit-identical and outputs differed by rounding only.
5.3 (iii) Hand-written CUDA kernel for the SE tail (--cuda-se-tail)
A forward kernel computes the tail with one thread per element, using round-to-nearest multiply and add intrinsics in PyTorch's order, so that its output is bit-identical to PyTorch's. The backward kernel assigns one warp to each (n,c) plane of 64 squares, computes ∂o and ∂x, and reduces ∂s and ∂b with __shfl_down_sync in a fixed order, which keeps it deterministic. On the real shape it took 0.70–0.71 ms against 1.04–1.06 ms for TorchScript and 1.43 ms for PyTorch; the scale and bias gradients agreed with PyTorch to 8×10−8. The compiled module is loaded from disk after checking the SHA-256 of its source, so ordinary runs need no compiler.
5.4 (iv) Imposed fused Winograd dX algorithm (--cudnn-winograd)
A 60-line C++ extension calls cudnnConvolutionBackwardData with CUDNN_CONVOLUTION_BWD_DATA_ALGO_WINOGRAD, taking its workspace from PyTorch's caching allocator. On top of option (i) it computes both the forward pass (through the identity above) and dX of every tower convolution; dW keeps PyTorch's kernel. Fixing the algorithm in code, rather than enabling cudnn.benchmark, keeps the same kernel in every run.
5.5 Tests
Each option is off by default, is not stored in checkpoints, and has unit tests comparing outputs and gradients with the default path to a relative tolerance of 10−5 on a small looped network (CPU and CUDA where applicable); option (iv) is additionally tested at the real shape, including bit equality of two calls. The project test suite (91 tests) passed after the last option.
6. Results
6.1 Training step
Table 3. Full training step, 128 channels, ms per step (two alternating passes; each row compares variants measured in the same session).
| Session | Comparison | Before | After | Time ratio |
|---|---|---|---|---|
| 1 | default → (i) | 173.72; 173.39 | 137.34; 137.46 | 0.792 |
| 2 | (i) → (i)+(ii) | 131.78; 134.53 | 123.19; 123.93 | 0.928 |
| 3 | (i)+(ii) → (i)+(ii)+(iii) | 127.47; 128.35 | 122.86; 123.45 | 0.963 |
| 4 | (i)–(iii) → (i)–(iv) | 122.40; 123.05 | 110.74; 111.51 | 0.906 |
| product | 0.641 (1.56×) |
The product of within-session ratios corresponds to 173.5 → 111.2 ms. In the same session as row 1, the 96-channel option that routes dX through the forward kernel gave 209.15 and 208.92 ms at 128 channels, confirming the slowdown of Section 4.2.
6.2 End-to-end throughput and reproducibility
Table 4. Real training command, 128 channels, from random initialisation; time between the 0.8M and 2.4M position log lines (3,125 steps, held-out evaluation and checkpoint write included).
| Run | Options | Seconds | Positions/s | ms per step |
|---|---|---|---|---|
| 1 | none | 512.10 | 3,124 | 163.87 |
| 2 | (i)–(iii) | 366.86 | 4,361 | 117.40 |
| 3 | (i)–(iii) | 366.65 | 4,364 | 117.33 |
| 4 | none | 510.63 | 3,133 | 163.40 |
| 5 | (i)–(iv) | 337.32 | 4,743 | 107.94 |
| 6 | (i)–(iv) | 335.29 | 4,772 | 107.29 |
Runs 1–4 were measured in ABBA order in one session: (i)–(iii) gave 1.39× (163.6 → 117.4 ms). Runs 5–6, in a later session, gave 107.6 ms with all four options: 1.52× relative to runs 1 and 4, a cross-session comparison. The real loop was slightly faster than the step benchmark, so the host side added no idle time on the GPU; the data reader alone produced 23,569 positions per second, 5.7 times what the accelerated step consumes.
Runs 1 and 4 produced bit-identical checkpoints, runs 2 and 3 likewise, and runs 5 and 6 likewise (all 235 tensors equal). The accelerated recipe is therefore reproducible bit for bit through the real entry point, not only in microbenchmarks.
At the measured ratio, the reference 128-channel pass over 101.5 million positions (8 h 43 min without options) would take about 5 h 44 min (derived, not measured).
6.3 Control runs
Table 5. Control runs (2,700 s fine-tuning from the same checkpoint, same batches). Worst deviation of validation CE at equal step count over checkpoints from 4,000 steps on; rule: ≤0.003.
| Run | Options vs control | Worst |ΔCE| | Steps | Steps/s | Verdict |
|---|---|---|---|---|---|
| A128 | none (control) | – | 16,750 | 6.20 | – |
| F128 | (i) vs A128 | 0.0019 | 18,450 | 6.82∗ | does not harm |
| J128 | (i)+(ii) vs F128 | 0.0018 | 21,600 | 7.99 | does not harm |
| C128 | (i)–(iii) vs J128 | 0.0023 | 23,100 | 8.54 | does not harm |
| W128 | (i)–(iv) vs C128 | 0.0029 | 26,100 | 9.65 | does not harm |
∗Video playback on the same GPU during F128; its speed is not interpretable, only its CE curve.
All four options passed the rule; the step-0 CE was identical to the control in every pair. Deviations changed sign across checkpoints in every pair (for W128: five positive and four negative from 4,000 to 20,000 steps), with no visible drift. The last margin was small (0.0029 against 0.003). In fine-tuning throughput the recipe reached 9.65 against 6.20 steps per second, 1.56×. The W128 run was interrupted twice by mains power cuts and restarted from scratch; its CE at 4,000 steps was identical (1.5288) in the interrupted and completed runs.
6.4 Where the time goes now
With all four options, the profile proportions were: tower convolutions 58.2%, BatchNorm 13.0%, element-wise kernels 11.2%, 1×1 convolutions and heads 6.9%, the custom SE kernel 5.4%, reductions 2.1%, optimizer and clipping 1.6%, TorchScript fusions 1.0%, concatenations 0.5%; 1,113 kernel launches per step instead of 1,225. About half of the convolution time was spent in the data and output transforms of non-fused Winograd kernels rather than in matrix products.
Figure 1. Cumulative step time. Intermediate values chain the within-session ratios of Table 3 from the 173.5 ms baseline; they are derived, not single measurements.
6.5 Predictions
Predictions were committed before each measurement. Held: the gain of (i) (predicted about 25%, measured 26.3%); the end-to-end gain of (i)–(iii) (30–42% predicted, 39.4% measured); the gain of (iv) (about 10 ms predicted, 11.6 ms measured); the control verdicts; bit-identical reproduction. Failed: absolute end-to-end times (predicted 170–178 and 126–132 ms, measured 163.6 and 117.4); the worst control deviations (predicted ≤0.002 for (iii) and (iv), measured 0.0023 and 0.0029); the speed of the single-GEMM dW alternative (predicted 1.5–2.5 ms, measured 6.04); a faster fused Winograd for the direct forward pass (it was slower, 1.20 ms; the gain came only through dX).
7. Interpretation
The largest cost of deterministic training in this setting was not an intrinsic cost of determinism. Deterministic algorithms existed that were faster than the default ones, for every direction except dW; the cost came from the heuristic choice among them, which depended on the channel count in opposite directions for the forward and dX kernels. An option that helps at one width can hurt at another, and a fix measured at one width must be remeasured at the next. The most effective changes were also the cheapest: one alternative PyTorch call for (i), and a 60-line extension that only passes an algorithm identifier to cuDNN for (iv). Hand-written kernels brought smaller gains.
Imposing an algorithm differs from enabling cudnn.benchmark in one important respect: the choice is written in the code and does not depend on timings measured at run start, so every run uses the same kernel. In this study the imposed algorithm was also more accurate than the default one.
The remaining time is dominated by the tower convolutions (58%), about half of it in Winograd transforms. A natural next step, not attempted here, is a convolution specialised to the 8×8 board, for example a single-tile Winograd F(8×8,3×3) covering the padded 10×10 board, possibly fused with BatchNorm and ReLU. Its feasibility depends on floating-point error, which grows quickly with tile size [7], and can be assessed numerically before any kernel is written.
8. Limitations
One GPU model (Pascal, GTX 1080 Ti), one driver and one cuDNN version (8.9.7). Algorithm heuristics and kernel speeds differ on other architectures; no claim is made beyond this configuration.
One seed per control run, and control runs are 45-minute fine-tuning runs from a trained checkpoint, not full training runs. The deviation rule bounds harm in that regime; effects over a full run are not measured.
The 1.52× end-to-end figure compares runs from two sessions; the 1.39× figure for options (i)–(iii) is a within-session ABBA comparison. The full-run time saving is derived from these ratios.
Step-benchmark baselines varied between sessions by up to 6% (163.8 versus 173.5 ms for the same configuration); only within-session ratios are combined.
Some measurements were taken with other applications open on the same GPU (idle utilisation 12–16% from display output); the ABBA order protects ratios, not absolute values. One control run (F128) overlapped video playback and its speed is not interpreted.
Profiles under Nsight Systems lowered the GPU clock; only proportions are used.
Bit reproducibility was verified on one machine, between runs of the same software build; it is not claimed across GPUs, drivers or library versions.
The experimental records are in a private repository; readers cannot retrieve them, and the prespecification of rules can only be evidenced by commit timestamps.
9. Conclusion
On a compact recurrent chess network, deterministic cuDNN selected a slow FFT forward algorithm at 128 channels and a slower-than-necessary Winograd dX algorithm. Routing the forward pass through the dX kernel, fusing the element-wise tails, writing one deterministic CUDA kernel and imposing cuDNN's fused Winograd dX algorithm reduced the step time by 1.56× on the step benchmark and 1.52× in the real training command, with bit-identical checkpoints across repeated runs and four prespecified control runs within 0.003 nat of their controls. For small-board networks trained under a reproducibility constraint, the practical lesson is to profile per shape and to select algorithms explicitly rather than accept the deterministic defaults.
Appendix A. Full experimental record
A.1 Validation CE differences at equal step count
Table 6. Validation policy CE, option minus control, at each common checkpoint (nat). Step 0 was identical in every pair.
| Step | F128 − A128 | J128 − F128 | C128 − J128 | W128 − C128 |
|---|---|---|---|---|
| 2,000 | −0.0010 | +0.0028 | −0.0022 | +0.0017 |
| 4,000 | +0.0005 | +0.0004 | −0.0012 | +0.0007 |
| 6,000 | −0.0000 | −0.0002 | −0.0023 | +0.0029 |
| 8,000 | −0.0011 | +0.0007 | −0.0018 | +0.0009 |
| 10,000 | +0.0015 | +0.0003 | −0.0005 | −0.0010 |
| 12,000 | −0.0002 | +0.0007 | −0.0010 | +0.0018 |
| 14,000 | +0.0008 | +0.0007 | −0.0010 | −0.0001 |
| 16,000 | +0.0019 | −0.0018 | −0.0014 | +0.0024 |
| 18,000 | – | −0.0010 | +0.0013 | −0.0009 |
| 20,000 | – | – | +0.0003 | −0.0006 |
| 22,000 | – | – | – | −0.0017 |
At equal training time (2,700 s), the final CE values were 1.5266 (A128), 1.5283 (F128), 1.5251 (J128), 1.5197 (C128) and 1.5231 (W128); these differences are of the order of the trajectory noise and are reported descriptively.
A.2 Accuracy of option (i) at the real sizes
On a real batch with a perturbed seed-123 network, outputs through option (i) differed from the default path by 4.1×10−7 (policy) and 5.6×10−7 (value) in relative norm. Against a float64 reference, the median relative gradient error was 5.6×10−5 for the default path and 3.6×10−4 with option (i); the worst errors (about 1.5–1.8×10−3) were on BatchNorm biases with very small gradient norms in both paths. Option (i) is thus slightly less accurate than the default path, which motivated the control runs; option (iv) is more accurate than the default dX kernel (Table 2).
A.3 Weight-gradient (dW) alternatives
At 96 channels the deterministic dW kernel took 1.24 ms and the non-deterministic one 0.49 ms. At 128 channels: deterministic 0.702 ms, non-deterministic 0.697 ms, deterministic with benchmarking 0.697 ms (same kernel), forward convolution with swapped batch and channel axes 3.81 ms, nine shifted matrix products 7.54 ms, im2col with a single matrix product 6.04 ms. No dW alternative met the prespecified criterion (25% faster than the default and at least 5 ms per step).
A.4 Build and environment notes
The two extensions were compiled once with torch.utils.cpp_extension.load in the Visual Studio environment (vcvars64.bat), with -allow-unsupported-compiler and -D_ALLOW_COMPILER_AND_STL_VERSION_MISMATCH for the CUDA kernel (CUDA 12.1 with MSVC 14.44) and cudnn.lib for the cuDNN extension; at run time the cuDNN library already loaded by PyTorch (same version) is used. Two practical pitfalls on this machine: a non-ASCII character in the user path broke include paths and profiler arguments (resolved by the 8.3 short path), and calling vcvars64.bat with output redirection from Git Bash silently failed to set the environment.
A.5 Notebook sections and commits
All results are recorded in the project notebook (sections 52, 54 and 56) on a private branch (rdtchess3), pushed to a private remote repository on 4 November 2026. Each control run records in its log header the commit of the code it ran and whether the working tree was clean.
Table 7. Commits. “Code”: commit recorded in the run header; “Record”: notebook commit with the result.
| Item | Commit |
|---|---|
| Diagnosis, option (i): implementation and step benchmark | aa0607dbd25be9b3e5bac48c71df954dc8b37e36 |
| F128 (option (i)), code | c9007c754b485835b4ba457fa27e57a20cc120c1 |
| F128, record | 4a2f0895695ee30b189567dd41b350cffaed6309 |
| Option (ii) implementation and step benchmark | c5eaba930881c2ca928269dc374369e5f055340a |
| J128 (options (i)+(ii)), code | 8779759c621ab6ecb88ff640b869706ee177fa62 |
| J128, record | 5335fa1e3aafded9c1c394a0eff43e0fc1695e95 |
| Option (iii) implementation and step benchmark | 48b07b279a6e3d2f5449b60ff0b23752fc8f4b3a |
| C128 (options (i)–(iii)), code | 1bf715dcff2f510a649f6ab80e056df0fa050606 |
| C128, record | 3922fced16099340cb8c789b987714c7fcdc8fe4 |
| End-to-end ABBA, options (i)–(iii) | 0b7c8820de11ef0ee2ac7262e97bdc302c5fba1c |
| dW benchmark at 128 channels | d0fb7782e58889ec401e302641a65d5ab604f958 |
| Profile of options (i)–(iii) | 4a2aa8c72152bef0b8840cf26ea4de7e04f1a76a |
| cuDNN algorithm enumeration | b1c129b7889eb7a0333234bf49e411e2b0b130d7 |
| Option (iv) implementation and step benchmark | 037b3241895edce222c69d02d569ce1380ee54bb |
| W128 (options (i)–(iv)), code | 26d994fd2624584de35cb893f02a938fd9c59d11 |
| W128, record | b4e18c4df3b9cc03cba96862d47c571828a858dd |
| End-to-end, options (i)–(iv), reproducibility | b6cf269772367ba0844fe41cc53796b18606fdcb |
The working trees of F128, C128 and W128 were reported clean. J128 reported dirty: true; the cause was verified to be untracked files written during its cool-down (the first version of the CUDA kernel) that the run did not import; the committed training code was unchanged.
SHA-256 of the kernels, scripts and result files at the record commits (files with LF line endings, as stored in the repository).
Kernels, extensions and scripts.
chess_rl/cuda/se_tail.cu7acb8c2e944dbc2b17c2966d1c589fbe9b42eef001693d537ffc4cfcd581d2b2chess_rl/cuda/cudnn_winograd.cpp7c7a116240538a4ff008b08a61e89eb715b4168a3aafd72f0e7fd434129dfccfchess_rl/cuda_se_tail.py101389bd37ac9791b7065452e64a599d988eee991877994af5514d070d7255ffchess_rl/cuda_winograd.py2f2e695ed70afee5ff63d0afcdac414120d72e55ffbf7fe44706c2ce66a66ed9controles/bench_fwd_as_dgrad.py8ac4e69151f4ff039957becaaeb7c01bbad5c3b66cc182ddb6e4a4ebab187e20controles/bench_dw.py2240634d531c3220d92473ed8cbef80fab9cffb9087b553d64841dbf0bd0a095controles/cuda/cudnn_algos.cppf808907c6cfc1b874699eb49b7578f61c60b10f665e018d8f8c7588ab1156e7econtroles/cuda/bench_cudnn_algos.py9b9a4e0f31ede1906de87a53526e42f7b40e26c40a56e081184e12a4a6d76d90controles/profil_nsys.py7ef663ac40510edf13d22f9caccd1a7bb5e87118ba27b2ec8eae29ddc7b056a7controles/nsys_postes.pyd5c6ff5c7a4807542721e504e137069d6891c033930dd490bcd9f42e9c01948acontroles/analyse_bout_en_bout.pyf354be499139fa2ad3f04b4b2abb83f310c6016d4fc615b08977637ad9c73d14controles/bench_recette128_bout_en_bout.sh2105c795b374bb872cc77af939ae488ec2c426935f94f2de3f84b26384192865controles/bench_recette128_wino.shc398a4dc6fabbf6aa916911c98a36cbf7c5a8cebaa4d2ac75d57f708687c8622
Result files.
controles/bench_fwd_as_dgrad.jsonbec19ea92d668cfdedbce7968bbb3fb44f50e377f51f6bd931b4def10d5a99cccontroles/bench_jit_fuse.json418bf5007ab055aa47fecb5683fd014a6ec16056e3e486ebd4f015be2677a9cecontroles/bench_cuda_se_tail.json46da499b3c2869383a6a34308bef3f30fc6c5cf649be62c713cb133f4395f8bacontroles/bench_cudnn_winograd.json87916ea2d82a78c0c0906cf1a33a438e9c5f7f98bbe925ca05b92fec0cb6f18econtroles/cuda/bench_se_tail.jsonc6b60640826f74fd3a6372e3c590437643040b0f7f7fa68517bac2932f1886c1controles/cuda/bench_cudnn_algos.jsonfe54f3a927f3be644ef52aa2ca82a8fd96022b44b23be8c7534aa8d7729560cdcontroles/bench_dw_128.json07e5f9027ce25a13fb81db6d5729fc32eb77cff3cbb45196e47f99a0e7836694controles/nsys/pas200_128x8_recette_cuda_gpu_kern_sum.csvfe6509c4585ca3fa7245e426ced38f7de7352e6d25c58da685ff8c6ac4fde9a0controles/bench_recette128_m3/analyse.json67e4311eb79ac6be25f27e5cedbc5cb0966325b22f503b5547c8fe7c417e02b4controles/bench_recette128_wino_m3/analyse.json0131a40807ffd58ce66ec9c4c5ccde4bc6545ba00868bbe41f8d628a075132b1
The values in Tables 2 and 3 were re-read from these JSON files after drafting and match them. The time-stamped logs of the end-to-end runs are archived next to the two analyse.json files.
Data and code availability
The RDTChess inference project is publicly described at github.com/RDTvlokip/RDTChess. The training code, extensions, benchmark scripts, profiles and logs used here are in a private repository and are not publicly released at the time of writing.
Acknowledgements
This work was conducted as an independent research project. No external funding or institutional affiliation is asserted.
AI assistance. An AI assistant (Claude Code) was used for profiling, code development (including the CUDA and C++ extensions), benchmark scripts, analysis and the drafting of this report. The author set the goal and constraints (speed first, reproducibility kept), approved each experimental run and is responsible for the content.
Citation
If you use this work, please cite it as follows:
@misc{charlet_2026_rdtchess_deterministic_speedup,
author = {Charlet, Théo},
title = {Where Deterministic cuDNN Loses Time on an 8x8 Board:
A Bit-Reproducible 1.5x Training Speed-Up for a
Compact Recurrent Chess Network on One Pascal GPU},
month = nov,
year = 2026,
doi = {10.5281/zenodo.23954463},
url = {https://doi.org/10.5281/zenodo.23954463}
}References
PyTorch contributors. Reproducibility. PyTorch documentation, notes on randomness, accessed 4 November 2026. docs.pytorch.org/docs/main/notes/randomness.html.
A. Paszke, S. Gross, F. Massa, A. Lerer, J. Bradbury, G. Chanan, et al. PyTorch: An Imperative Style, High-Performance Deep Learning Library. In Advances in Neural Information Processing Systems 32, 2019. papers.nips.cc/paper/9015-pytorch-an-imperative-style-high-performance-deep-learning-library.
S. Chetlur, C. Woolley, P. Vandermersch, J. Cohen, J. Tran, B. Catanzaro, and E. Shelhamer. cuDNN: Efficient Primitives for Deep Learning. arXiv preprint arXiv:1410.0759, 2014. arxiv.org/abs/1410.0759.
M. Mathieu, M. Henaff, and Y. LeCun. Fast Training of Convolutional Networks through FFTs. In International Conference on Learning Representations, 2014. arxiv.org/abs/1312.5851.
N. Vasilache, J. Johnson, M. Mathieu, S. Chintala, S. Piantino, and Y. LeCun. Fast Convolutional Nets With fbfft: A GPU Performance Evaluation. In International Conference on Learning Representations, 2015. arxiv.org/abs/1412.7580.
A. Lavin and S. Gray. Fast Algorithms for Convolutional Neural Networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 4013–4021, 2016. doi.org/10.1109/CVPR.2016.435.
B. Barabasz, A. Anderson, K. M. Soodhalter, and D. Gregg. Error Analysis and Improving the Accuracy of Winograd Convolution for Deep Neural Networks. ACM Transactions on Mathematical Software, 46(4):1–33, 2020. doi.org/10.1145/3412380.
J. Hu, L. Shen, and G. Sun. Squeeze-and-Excitation Networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pp. 7132–7141, 2018. doi.org/10.1109/CVPR.2018.00745.
The Leela Chess Zero authors. Leela Chess Zero (lc0): software repository and network documentation, accessed 4 November 2026. github.com/LeelaChessZero/lc0; lczero.org/dev/backend/nn.
D. Silver, T. Hubert, J. Schrittwieser, I. Antonoglou, M. Lai, A. Guez, M. Lanctot, L. Sifre, D. Kumaran, T. Graepel, T. Lillicrap, K. Simonyan, and D. Hassabis. A general reinforcement learning algorithm that masters chess, shogi, and Go through self-play. Science, 362(6419):1140–1144, 2018. doi.org/10.1126/science.aar6404.
RDTvlokip. RDTChess: Compact residual chess network and inference code. Software repository, accessed 4 November 2026. github.com/RDTvlokip/RDTChess.
This page is written in RDTMD and rendered directly by the RDTMD engine, my open-source technical markup language.