Skip to content

Add batch memcpy benchmark - #52

Open
szymon-zadworny wants to merge 3 commits into
oneapi-src:mainfrom
szymon-zadworny:memcpy_benchmark
Open

szymon-zadworny wants to merge 3 commits into
oneapi-src:mainfrom
szymon-zadworny:memcpy_benchmark

Conversation

@szymon-zadworny

Copy link
Copy Markdown
Contributor

This PR adds:

  • criterion-based benchmarking infrastructure
  • a batch memcpy benchmark

The benchmark allocates a gigabyte of space divided evenly into pairs of host/device buffers. Each iteration measures 100 copies from host buffers to device buffers. The number of pairs quadruples after each iteration.

You can run the benchmark with cargo bench.

Note

Criterion also generates a report along with graphs for each iteration inside the /target/criterion directory.

Results:

memcpy_test/h2d copy/2 copies of size 268435456
                        time:   [76.590 ms 76.590 ms 76.591 ms]
Found 3 outliers among 100 measurements (3.00%)
  2 (2.00%) high mild
  1 (1.00%) high severe
memcpy_test/h2d copy/8 copies of size 67108864
                        time:   [134.09 ms 134.10 ms 134.10 ms]
Found 13 outliers among 100 measurements (13.00%)
  13 (13.00%) low severe
memcpy_test/h2d copy/32 copies of size 16777216
                        time:   [148.44 ms 148.44 ms 148.44 ms]
Found 2 outliers among 100 measurements (2.00%)
  1 (1.00%) low mild
  1 (1.00%) high mild
memcpy_test/h2d copy/128 copies of size 4194304
                        time:   [152.40 ms 152.40 ms 152.40 ms]
Found 4 outliers among 100 measurements (4.00%)
  1 (1.00%) low mild
  3 (3.00%) high mild
memcpy_test/h2d copy/512 copies of size 1048576
                        time:   [154.35 ms 154.35 ms 154.35 ms]
memcpy_test/h2d copy/2048 copies of size 262144
                        time:   [159.43 ms 159.43 ms 159.44 ms]
Found 3 outliers among 100 measurements (3.00%)
  1 (1.00%) high mild
  2 (2.00%) high severe
memcpy_test/h2d copy/8192 copies of size 65536
                        time:   [178.28 ms 178.28 ms 178.29 ms]
memcpy_test/h2d copy/32768 copies of size 16384
                        time:   [248.40 ms 248.41 ms 248.41 ms]
Found 1 outliers among 100 measurements (1.00%)
  1 (1.00%) high severe
Benchmarking memcpy_test/h2d copy/131072 copies of size 4096: Warming up for 3.0000 s
Warning: Unable to complete 100 samples in 30.0s. You may wish to increase target time to 35.0s, or reduce sample count to 80.
memcpy_test/h2d copy/131072 copies of size 4096
                        time:   [312.97 ms 313.12 ms 313.27 ms]
Found 1 outliers among 100 measurements (1.00%)
  1 (1.00%) high mild

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant