Benchmarking an RTX 3060
and a Snapdragon NPU
Time per operation, gains from compilation, and GPU energy use
I wanted to see how the same neural-network operations behave on my laptop's RTX 3060 and a Snapdragon 8 Gen 3 through Qualcomm AI Hub. I tested matrix multiplication, convolution + ReLU, and RMSNorm, then inspected how compilation changed the work.
- Execution time: GPU replay was fastest across all 12 matched shapes. The largest matrix multiplication took 177 µs on the GPU versus 742 µs on the NPU.
- Compilation: FP16 RMSNorm at 32×1024 dropped from 13.18 to 1.31 µs per operation on the GPU: a 10.05× speedup.
- GPU energy: that workload used 89% less energy per operation when compiled in this run, despite higher average power during sustained replay.
The setup
| RTX 3060 Laptop | Snapdragon 8 Gen 3 | |
|---|---|---|
| Device | 6 GiB GPU · WSL2 | Galaxy S24 · Hexagon v75 NPU |
| Software | PyTorch 2.11 · CUDA 12.8 | QNN · QAIRT 2.50 |
| Precision | FP16 and FP32 | FP16 requested; FP32 input/output |
| Timing | Recorded replay and Python calls | Calls through Qualcomm's QNN runtime |
The cross-device cases share logical inputs and weights. Outputs are checked against a CPU FP64 reference; remote profiles are checked for NPU placement. The main GPU sweep passed all 56 configurations; the NPU studies passed 108 jobs. Transfers and compilation are outside these timings.
Matmul: K = N = 1024. Convolution: batch 1, 32→64 channels, 3×3 + ReLU. RMSNorm: width 1024. GPU: 25 timing blocks per configuration in one AC session; clocks unlocked, TF32 and cuDNN autotuning off. NPU: three jobs per setting, with cloud device assignment uncontrolled.
1GPU vs. NPU: time per operation
The RTX 3060 with replay has the lowest measured time at all 12 tested shapes. The vertical axis is microseconds (µs) per completed operation: lower is faster. For matrix multiplication, each operation multiplies an M×1024 matrix by a 1024×1024 matrix; the horizontal axis changes M, the number of input rows.
GPU replay repeats a recorded sequence of calls, reducing the CPU's work to launch them. GPU via Python includes Python issuing calls and waiting for completion. NPU via QNN times calls through Qualcomm's runtime. The GPU uses compiled FP16; the NPU requests FP16 with FP32 inputs and outputs.
Matrix multiplication: at 1,024 rows, the GPU takes 177 µs with replay or 216 µs through Python, versus 742 µs on the NPU. The GPU is clearly faster for this case in both execution modes. At one row, Python and QNN are close, 97 versus 101 µs, while GPU replay takes 10.3 µs. For small repeated matrix jobs, reducing the cost of launching work is worth testing.
Convolution and RMSNorm: GPU replay is also fastest at every size. Including Python can reverse a comparison: the 16×16 convolution takes 160.5 µs through Python versus 79.0 µs through QNN, but only 8.31 µs in GPU replay. The winner depends on the execution mode; these paths include different work.
2Where compilation helps
This compares time per operation on the RTX 3060, using ordinary PyTorch
(uncompiled) or torch.compile with Inductor. Both use recorded replay at
the same precision. Speedup is uncompiled time ÷ compiled time:
2× means half the time; below 1× means the uncompiled version wins.
Compilation wins most clearly for RMSNorm, which rescales each row. At 32×1024 in FP16, time falls from 13.18 to 1.31 µs (10.05×). The profiler shows nine GPU kernels, or pieces of GPU work, combined into one. This is where combining small steps pays off. Including Python calls reduces the speedup to 1.94× (153.25 to 78.95 µs).
For convolution, compiled wins in FP16; uncompiled wins in FP32. FP16 takes 21–25% less time after compilation. FP32 at 16×16 takes 16.51 µs compiled versus 10.27 µs uncompiled. Matrix multiplication stays near 1×, with no clear benefit.
Why did FP32 slow down? Changing memory layout can add data-reordering work. In my 16×16 follow-up, disabling layout optimization reduced time from 16.50 to 10.22 µs and removed those conversions. Kernel choice changed too, so I cannot attribute the entire gain to reordering. TF32 was off in both versions. The useful next check is the work the compiler added.
3GPU power and energy
This compares GPU energy per completed operation, in millijoules (mJ); lower is better. Each FP16 implementation ran for at least five seconds. I estimated energy from GPU power readings (NVML) over that interval, then divided by completed operations. This was separate from the timing measurements.
Compiled beats uncompiled on energy for RMSNorm and convolution at every tested size. Matrix multiplication has no consistent winner. At 32×1024 RMSNorm, the custom kernel uses the least energy in this run:
| Implementation | Average GPU power (W) | Energy (mJ/op) |
|---|---|---|
| Uncompiled | 59.49 | 0.7564 |
| Compiled | 64.05 | 0.0833 |
| Custom kernel | 61.12 | 0.0761 |
Higher power can still mean less energy per job. Compiled RMSNorm draws 64.05 W versus 59.49 W, yet uses 89% less energy per operation. Finishing sooner more than offsets the higher power. That is why energy per completed operation matters when choosing an implementation.
GPU readings include baseline and background activity; no idle subtraction. One session with unlocked clocks needs independent repeats before treating the percentages as stable.
NPU energy was unavailable. There is no GPU/NPU efficiency ranking here; latency alone cannot supply one.
4NPU convolution: does layout help?
Channels-last wins at 64×64: 142 versus 207 µs per operation, or 31% less time. This changes how data is arranged, keeping the NPU, logical inputs, weights and requested precision fixed.
Layout and preparation results
Channels-first (NCHW) groups values by channel; channels-last (NHWC) puts a pixel's channels together. The first panel measures time per operation; lower is faster. The second counts data-reordering steps in a separate NPU profile.
Choosing the input/output layout can save work without changing the math. At 64×64, the profile's transpose count drops from 18 to zero; other format operations remain. At 32×32, overlapping timing ranges leave no clear winner. The benefit assumes the surrounding pipeline already uses the chosen layout.
An audit also caught preparation options sent only at conversion in the original sweep. The corrected experiment sets them during device preparation: O1 produces fewer recorded operations than O3, 24 versus 47, yet takes 91 versus 80 µs. O3 wins on time in this case; a smaller operation count does not guarantee faster execution.
GPU layout measurements · Preparation audit · Corrected preparation results
A MobileNetV2 follow-up on one image preserved the reference's top prediction, but all 12 jobs failed the fixed per-score numerical tolerance. A CPU FP16 diagnostic also failed it. Those runs support no validated model speedup. The next step is to set an accuracy requirement on a representative dataset and repeat whole measurement sessions.
Data and reproduction
The figures use saved measurements; no new device runs were made for this article. The article figure script rebuilds all four charts. The companion notebook contains the layout example and full model checks.