Skip to content

Provide a GPU interface - #107

Open
Radonirinaunimi wants to merge 20 commits into
masterfrom
gpu-api
Open

Radonirinaunimi wants to merge 20 commits into
masterfrom
gpu-api

Conversation

@Radonirinaunimi

@Radonirinaunimi Radonirinaunimi commented Nov 2, 2026 •

Copy link
Copy Markdown
Member

The following PR addresses #102!

Benchmark snapshots taken from 21e685c.

Below are the performance benchmarks using an AMD EPYC 7K62 (96 threads) vs. an NVIDIA GeForce RTX 4090 using the NNPDF40_nnlo_as_01180 set on $N_{\rm rep} = 101$ members, 11 flavors + $\alpha_s$ evaluated per (event, member) pair. The CPU benchmark are parallelized across the entire threads using Rayon.

1. Throughput comparison

Throughput is calculated as

$$ \text{Throughput} = \frac{N_{\text{events}} \times N_{\rm rep}} {t_{\text{benchmark}}}. $$

One pair corresponds to one (event, PDF member) evaluation. Throughput is reported in millions of pairs per second (M pairs/s).

Events Pairs CPU (Rayon) GPU pipeline (host-side) GPU device (kernel)
1,000 101,000 20.08 M/s 96.10 M/s 284.47 M/s
10,000 1,010,000 36.03 M/s 132.29 M/s 579.19 M/s
100,000 10,100,000 48.61 M/s 244.62 M/s 770.11 M/s
1,000,000 101,000,000 — 265.48 M/s 918.76 M/s

2. Execution times

Execution times are reported in milliseconds (ms).

Events CPU (Rayon) GPU pipeline (host-side) GPU device (kernel)
1,000 5.031 ms 1.051 ms 0.355 ms
10,000 28.036 ms 7.635 ms 1.744 ms
100,000 207.794 ms 41.288 ms 13.115 ms
1,000,000 — 380.440 ms 109.930 ms

3. GPU speedup relative to CPU

Speedup over the CPU is calculated as the ratio between CPU and GPU execution times:

$$ S = \frac{t_{\text{CPU}}}{t_{\text{GPU}}}. $$

Events GPU pipeline (host-side) GPU device (kernel)
1,000 4.79 $\times$ 14.17 $\times$
10,000 3.67 $\times$ 16.08 $\times$
100,000 5.03 $\times$ 15.84 $\times$

4. Memory consumption

Memory measurements are reported in MiB.

  • Host memory: Process resident set size (RSS).
  • GPU memory: Device-wide used memory.
  • Output: Memory required for the output buffer.
  • Batch memory: Additional memory consumed by one batch, on top of the uploaded grid.

4.1. GPU pipeline (host-side)

Events Output Host peak (RSS) Host batch GPU peak GPU batch
1,000 9.2 200.2 9.6 740.2 10.0
10,000 92.5 317.6 93.0 858.2 128.0
100,000 924.7 1,121.8 926.5 860.2 130.0
1,000,000 9,246.8 9,463.5 9,262.6 892.2 162.0

Above one chunk, the GPU holds two 64 MiB chunk buffers instead of the whole output, so the GPU batch memory stays nearly flat with the number of events.

4.2. GPU device (kernel)

Events Output Host peak (RSS) Host batch GPU peak GPU batch
1,000 9.2 233.8 0.2 740.2 10.0
10,000 92.5 218.0 0.1 824.2 94.0
100,000 924.7 221.1 1.9 1,656.2 926.0
1,000,000 9,246.8 238.9 15.3 9,994.2 9,264.0

These GPU memory numbers are consistent with the back of the envelope calculations: output_bytes = n_events × n_members × (n_flavors + 1) × 8 (bytes).

@Radonirinaunimi Radonirinaunimi self-assigned this Nov 2, 2026
@codecov

codecov Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 108 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
neopdf/src/gridpdf.rs 0.00% 65 Missing ⚠️
neopdf/src/alphas.rs 0.00% 13 Missing ⚠️
neopdf/src/strategy.rs 0.00% 12 Missing ⚠️
neopdf/src/interleaved.rs 0.00% 10 Missing ⚠️
neopdf/src/pdf.rs 0.00% 5 Missing ⚠️
neopdf/src/gpu_export.rs 0.00% 3 Missing ⚠️

📢 Thoughts on this report? Let us know!

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request gpu milestones

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant