<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/libc/benchmarks/gpu/LibcGpuBenchmark.cpp, branch main</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/'/>
<entry>
<title>[libc] Polish GPU benchmarking (#153900)</title>
<updated>2025-08-16T00:51:52+00:00</updated>
<author>
<name>Leandro Lacerda</name>
<email>leandrolcampos@yahoo.com.br</email>
</author>
<published>2025-08-16T00:51:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=cf5f311b26d4db7296b28d52742c87f6a2836120'/>
<id>cf5f311b26d4db7296b28d52742c87f6a2836120</id>
<content type='text'>
This patch provides cleanups and improvements for the GPU benchmarking
infrastructure. The key changes are:

- Fix benchmark convergence bug: Round up the scaled iteration count
(ceil) to ensure it grows properly. The previous truncation logic causes
the iteration count to get stuck.
- Resolve remaining compiler warning.
- Remove unused `BenchmarkLogger` files: This is dead code that added
maintenance and cognitive overhead without providing functionality.
- Improve build hygiene: Clean up headers and CMake dependencies to
strictly follow the 'include what you use' (IWYU) principle.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch provides cleanups and improvements for the GPU benchmarking
infrastructure. The key changes are:

- Fix benchmark convergence bug: Round up the scaled iteration count
(ceil) to ensure it grows properly. The previous truncation logic causes
the iteration count to get stuck.
- Resolve remaining compiler warning.
- Remove unused `BenchmarkLogger` files: This is dead code that added
maintenance and cognitive overhead without providing functionality.
- Improve build hygiene: Clean up headers and CMake dependencies to
strictly follow the 'include what you use' (IWYU) principle.</pre>
</div>
</content>
</entry>
<entry>
<title>[libc] Improve GPU benchmarking (#153512)</title>
<updated>2025-08-15T16:00:17+00:00</updated>
<author>
<name>Leandro Lacerda</name>
<email>leandrolcampos@yahoo.com.br</email>
</author>
<published>2025-08-15T16:00:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=08ff017fb0c9c7c3c91858023ea45149449fbbfc'/>
<id>08ff017fb0c9c7c3c91858023ea45149449fbbfc</id>
<content type='text'>
This patch improves the GPU benchmarking in this way:

* Replace `rand`/`srand` with a deterministic per-thread RNG seeded by
`call_index`: reproducible, apples-to-apples libc vs vendor comparisons.
* Fix input generation: sample the unbiased exponent uniformly in
`[min_exp, max_exp]`, clamp bounds, and skip `Inf`, `NaN`, `-0.0`, and
`+0.0`.
* Fix standard deviation: use an explicit estimator from sums and
sums-of-squares (`sqrt(E[x^2] − E[x]^2)`) across samples.
* Fix throughput overhead: subtract a loop-only baseline inside
NVPTX/AMDGPU timing backends so `benchmark()` gets cycles-per-call
already corrected (no `overhead()` call).
* Adapt existing math benchmarks to the new RNG/timing plumbing (plumb
`call_index`, drop `rand/srand`, clean includes).
* Correct inter-thread aggregation: use iteration-weighted pooling to
compute the global mean/variance, ensuring statistically sound `Cycles
(Mean)` and `Stddev`.
* Remove `Time / Iteration` column from the results table: it reported
per-thread convergence time (not per-call latency) and was
redundant/misleading next to `Cycles (Mean)`.
* Remove unused `BenchmarkLogger` files: dead code that added
maintenance and cognitive overhead without providing functionality.

---

## TODO (before merge)

* [ ] Investigate compiler warnings and address their root causes.
* [x] Review how per-thread results are aggregated into the overall
result.

## Follow-ups (future PRs)

* Add support to run throughput benchmarks with uniform (linear) input
distributions, alongside the current log2-uniform scheme.
* Review/adjust the configuration and coverage of existing math
benchmarks.
* Add more math benchmarks (e.g., `exp`/`expf`, others).</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch improves the GPU benchmarking in this way:

* Replace `rand`/`srand` with a deterministic per-thread RNG seeded by
`call_index`: reproducible, apples-to-apples libc vs vendor comparisons.
* Fix input generation: sample the unbiased exponent uniformly in
`[min_exp, max_exp]`, clamp bounds, and skip `Inf`, `NaN`, `-0.0`, and
`+0.0`.
* Fix standard deviation: use an explicit estimator from sums and
sums-of-squares (`sqrt(E[x^2] − E[x]^2)`) across samples.
* Fix throughput overhead: subtract a loop-only baseline inside
NVPTX/AMDGPU timing backends so `benchmark()` gets cycles-per-call
already corrected (no `overhead()` call).
* Adapt existing math benchmarks to the new RNG/timing plumbing (plumb
`call_index`, drop `rand/srand`, clean includes).
* Correct inter-thread aggregation: use iteration-weighted pooling to
compute the global mean/variance, ensuring statistically sound `Cycles
(Mean)` and `Stddev`.
* Remove `Time / Iteration` column from the results table: it reported
per-thread convergence time (not per-call latency) and was
redundant/misleading next to `Cycles (Mean)`.
* Remove unused `BenchmarkLogger` files: dead code that added
maintenance and cognitive overhead without providing functionality.

---

## TODO (before merge)

* [ ] Investigate compiler warnings and address their root causes.
* [x] Review how per-thread results are aggregated into the overall
result.

## Follow-ups (future PRs)

* Add support to run throughput benchmarks with uniform (linear) input
distributions, alongside the current log2-uniform scheme.
* Review/adjust the configuration and coverage of existing math
benchmarks.
* Add more math benchmarks (e.g., `exp`/`expf`, others).</pre>
</div>
</content>
</entry>
<entry>
<title>[libc] Fix GPU benchmarking</title>
<updated>2025-07-18T19:36:23+00:00</updated>
<author>
<name>Joseph Huber</name>
<email>huberjn@outlook.com</email>
</author>
<published>2025-07-18T19:36:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=de59e7b86cd349f9f74b7561594aeae410477326'/>
<id>de59e7b86cd349f9f74b7561594aeae410477326</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[libc][gpu] Add Atan2 Benchmarks (#104708)</title>
<updated>2024-08-18T17:50:30+00:00</updated>
<author>
<name>jameshu15869</name>
<email>55058507+jameshu15869@users.noreply.github.com</email>
</author>
<published>2024-08-18T17:50:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=deb6b45c32687275a6d4e24326ffc9700f8ae52c'/>
<id>deb6b45c32687275a6d4e24326ffc9700f8ae52c</id>
<content type='text'>
This PR adds benchmarking for `atan2()`, `__nv_atan2()`, and
`__ocml_atan2_f64()` using the same setup as `sin()`. This PR also adds
support for throughout bencmarking for functions with 2 inputs.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This PR adds benchmarking for `atan2()`, `__nv_atan2()`, and
`__ocml_atan2_f64()` using the same setup as `sin()`. This PR also adds
support for throughout bencmarking for functions with 2 inputs.</pre>
</div>
</content>
</entry>
<entry>
<title>[libc] [gpu] Fix Minor Benchmark UI Issues (#102529)</title>
<updated>2024-08-08T20:32:20+00:00</updated>
<author>
<name>jameshu15869</name>
<email>55058507+jameshu15869@users.noreply.github.com</email>
</author>
<published>2024-08-08T20:32:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=1248698e9bb2a0232eee53a72679ed5077190a90'/>
<id>1248698e9bb2a0232eee53a72679ed5077190a90</id>
<content type='text'>
Previously, `AmdgpuSinTwoPow_128` and others were too large for their
table cells. This PR shortens the name to `AmdSin...`

There were also some `-` missing in the separator. This PR instead
creates the separator string using the length of the headers.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previously, `AmdgpuSinTwoPow_128` and others were too large for their
table cells. This PR shortens the name to `AmdSin...`

There were also some `-` missing in the separator. This PR instead
creates the separator string using the length of the headers.</pre>
</div>
</content>
</entry>
<entry>
<title>[libc] [gpu] Change Time To Be Per Iteration (#101919)</title>
<updated>2024-08-05T13:27:31+00:00</updated>
<author>
<name>jameshu15869</name>
<email>55058507+jameshu15869@users.noreply.github.com</email>
</author>
<published>2024-08-05T13:27:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=39826b10306ea05fe79d7af3420ffd4a93718ec4'/>
<id>39826b10306ea05fe79d7af3420ffd4a93718ec4</id>
<content type='text'>
Previously, the time field was the total time take to run all iterations
of the benchmark. This PR changes the value displayed to be the average
time take by each iteration.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previously, the time field was the total time take to run all iterations
of the benchmark. This PR changes the value displayed to be the average
time take by each iteration.</pre>
</div>
</content>
</entry>
<entry>
<title>[libc] Add Generic and NVPTX Sin Benchmark (#99795)</title>
<updated>2024-07-30T03:09:11+00:00</updated>
<author>
<name>jameshu15869</name>
<email>55058507+jameshu15869@users.noreply.github.com</email>
</author>
<published>2024-07-30T03:09:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=677796cab327409012bab0e374e743602435edaf'/>
<id>677796cab327409012bab0e374e743602435edaf</id>
<content type='text'>
This PR adds sin benchmarking for a range of values and on a
pregenerated random distribution.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This PR adds sin benchmarking for a range of values and on a
pregenerated random distribution.</pre>
</div>
</content>
</entry>
<entry>
<title>[libc] Add Minimum Time and Iterations, Reduce Epsilon (#100838)</title>
<updated>2024-07-27T01:30:19+00:00</updated>
<author>
<name>jameshu15869</name>
<email>55058507+jameshu15869@users.noreply.github.com</email>
</author>
<published>2024-07-27T01:30:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=a09c0f676d3c61ba8f74a24172543c1e44d70628'/>
<id>a09c0f676d3c61ba8f74a24172543c1e44d70628</id>
<content type='text'>
This PR adds minimums (50 iterations, 500 us, and epsilon of 0.0001) to
ensure that all benchmarks run at least a set number of times before
outputting a final measurement.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This PR adds minimums (50 iterations, 500 us, and epsilon of 0.0001) to
ensure that all benchmarks run at least a set number of times before
outputting a final measurement.</pre>
</div>
</content>
</entry>
<entry>
<title>[libc] Fix invalid format specifier in benchmark</title>
<updated>2024-07-22T16:21:22+00:00</updated>
<author>
<name>Joseph Huber</name>
<email>huberjn@outlook.com</email>
</author>
<published>2024-07-22T16:18:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=6911f823ad0e1471f523205daf976c3cf6f96bfd'/>
<id>6911f823ad0e1471f523205daf976c3cf6f96bfd</id>
<content type='text'>
Summary:
This value is a uint32_t but is printed as a uint64_t, leading to
invalid offsets when done on AMDGPU due to its packed format extending
past the buffer.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Summary:
This value is a uint32_t but is printed as a uint64_t, leading to
invalid offsets when done on AMDGPU due to its packed format extending
past the buffer.
</pre>
</div>
</content>
</entry>
<entry>
<title>[libc] Add N Threads Benchmark Helper (#99834)</title>
<updated>2024-07-22T02:56:40+00:00</updated>
<author>
<name>jameshu15869</name>
<email>55058507+jameshu15869@users.noreply.github.com</email>
</author>
<published>2024-07-22T02:56:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=197b14223238716a84b423315242f8b10d8922dd'/>
<id>197b14223238716a84b423315242f8b10d8922dd</id>
<content type='text'>
This PR adds a `BENCHMARK_N_THREADS()` helper to register benchmarks
with a specific number of threads. This PR replaces the flags used
originally to allow any amount of threads.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This PR adds a `BENCHMARK_N_THREADS()` helper to register benchmarks
with a specific number of threads. This PR replaces the flags used
originally to allow any amount of threads.</pre>
</div>
</content>
</entry>
</feed>
