<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/libc/benchmarks/gpu/timing/amdgpu, 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][gpu] Disable loop unrolling in the throughput benchmark loop (#153971)</title>
<updated>2025-08-16T20:14:26+00:00</updated>
<author>
<name>Leandro Lacerda</name>
<email>leandrolcampos@yahoo.com.br</email>
</author>
<published>2025-08-16T20:14:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=75bf7392089d027bb6fa78ded21acaa97b16a412'/>
<id>75bf7392089d027bb6fa78ded21acaa97b16a412</id>
<content type='text'>
This patch makes GPU throughput benchmark results more comparable across
targets by disabling loop unrolling in the benchmark loop.

Motivation:
* PTX (post-LTO) evidence on NVPTX: for libc `sin`, the generated PTX
shows the `throughput` loop unrolled 8x at `N=128` (one iteration
advances the input pointer by 64 bytes = 8 doubles), interleaving eight
independent chains before the back-edge. This hides latency and
significantly reduces cycles/call as the batch size `N` grows.
* Observed scaling (NVPTX measurements): with unrolling enabled, `sin`
dropped from ~3,100 cycles/call at `N=1` to ~360 at `N=128`. After
enforcing `#pragma clang loop unroll(disable)`, results stabilized
(e.g., from ~3100 cycles/call at `N=1` to ~2700 at `N=128`).
* libdevice contrast: the libdevice `sin` path did not exhibit a similar
drop in our measurements, and the PTX appears as compact internal calls
rather than a long FMA chain, leaving less ILP for the outer loop to
extract.

What this change does:
* Applies `#pragma clang loop unroll(disable)` to the GPU `throughput()`
loop in both NVPTX and AMDGPU backends.

Leaving unrolling entirely to the optimizer makes apples-to-apples
comparisons uneven (e.g., libc vs. vendor). Disabling unrolling yields
fairer, more consistent numbers.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch makes GPU throughput benchmark results more comparable across
targets by disabling loop unrolling in the benchmark loop.

Motivation:
* PTX (post-LTO) evidence on NVPTX: for libc `sin`, the generated PTX
shows the `throughput` loop unrolled 8x at `N=128` (one iteration
advances the input pointer by 64 bytes = 8 doubles), interleaving eight
independent chains before the back-edge. This hides latency and
significantly reduces cycles/call as the batch size `N` grows.
* Observed scaling (NVPTX measurements): with unrolling enabled, `sin`
dropped from ~3,100 cycles/call at `N=1` to ~360 at `N=128`. After
enforcing `#pragma clang loop unroll(disable)`, results stabilized
(e.g., from ~3100 cycles/call at `N=1` to ~2700 at `N=128`).
* libdevice contrast: the libdevice `sin` path did not exhibit a similar
drop in our measurements, and the PTX appears as compact internal calls
rather than a long FMA chain, leaving less ILP for the outer loop to
extract.

What this change does:
* Applies `#pragma clang loop unroll(disable)` to the GPU `throughput()`
loop in both NVPTX and AMDGPU backends.

Leaving unrolling entirely to the optimizer makes apples-to-apples
comparisons uneven (e.g., libc vs. vendor). Disabling unrolling yields
fairer, more consistent numbers.</pre>
</div>
</content>
</entry>
<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][NFC] Add stdint.h proxy header to fix dependency issue with &lt;stdint.h&gt; includes. (#150303)</title>
<updated>2025-07-24T00:19:52+00:00</updated>
<author>
<name>lntue</name>
<email>lntue@google.com</email>
</author>
<published>2025-07-24T00:19:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=66603dd1f10e0f6c0510273378334971159f6b69'/>
<id>66603dd1f10e0f6c0510273378334971159f6b69</id>
<content type='text'>
https://github.com/llvm/llvm-project/issues/149993</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/llvm/llvm-project/issues/149993</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] Add Generic, NvSin, and OcmlSinf64 Throughput Benchmark (#101917)</title>
<updated>2024-08-08T20:05:34+00:00</updated>
<author>
<name>jameshu15869</name>
<email>55058507+jameshu15869@users.noreply.github.com</email>
</author>
<published>2024-08-08T20:05:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=9a070d6d0f0c111c2269a912f98908c821993e37'/>
<id>9a070d6d0f0c111c2269a912f98908c821993e37</id>
<content type='text'>
This PR implements
https://github.com/lntue/llvm-project/commit/2a158426d4b90ffaa3eaecc9bc10e5aed11f1bcf
to provide better throughput benchmarking for libc `sin()` and
`__nv_sin()`.

These changes have not been tested on AMDGPU yet, only compiled.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This PR implements
https://github.com/lntue/llvm-project/commit/2a158426d4b90ffaa3eaecc9bc10e5aed11f1bcf
to provide better throughput benchmarking for libc `sin()` and
`__nv_sin()`.

These changes have not been tested on AMDGPU yet, only compiled.</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] Migrate to using LIBC_NAMESPACE_DECL for namespace declaration (#98597)</title>
<updated>2024-07-12T16:28:41+00:00</updated>
<author>
<name>Petr Hosek</name>
<email>phosek@google.com</email>
</author>
<published>2024-07-12T16:28:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=5ff3ff33ff930e4ec49da7910612d8a41eb068cb'/>
<id>5ff3ff33ff930e4ec49da7910612d8a41eb068cb</id>
<content type='text'>
This is a part of #97655.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is a part of #97655.</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "[libc] Migrate to using LIBC_NAMESPACE_DECL for namespace declaration" (#98593)</title>
<updated>2024-07-12T07:12:13+00:00</updated>
<author>
<name>Mehdi Amini</name>
<email>joker.eph@gmail.com</email>
</author>
<published>2024-07-12T07:12:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=ce9035f5bd3aa09cbd899489cdbc7f6c18acf1e3'/>
<id>ce9035f5bd3aa09cbd899489cdbc7f6c18acf1e3</id>
<content type='text'>
Reverts llvm/llvm-project#98075

bots are broken</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Reverts llvm/llvm-project#98075

bots are broken</pre>
</div>
</content>
</entry>
</feed>
