Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions docs/conceptual/transferbench-data-validation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,9 @@ How validation is timed

The timing of validation is controlled by the ``alwaysValidate`` option. By default
(``alwaysValidate = 0``), validation runs once after all timed iterations complete,
minimizing overhead during benchmarking. When ``alwaysValidate = 1``, validation is
performed after every iteration; any detected error immediately stops the run.
minimizing overhead during benchmarking. When ``alwaysValidate > 0``, validation is
performed after every iteration; any detected error immediately stops the run. Setting
``alwaysValidate`` to a negative value disables validation entirely.

.. list-table::
:header-rows: 1
Expand All @@ -95,11 +96,15 @@ performed after every iteration; any detected error immediately stops the run.
- When
- Behavior

* - ``alwaysValidate < 0``
- Never
- Validation is disabled entirely; ``ValidateAllTransfers`` is never called.

* - ``alwaysValidate = 0`` (default)
- Once at the end of all iterations
- ``ValidateAllTransfers`` called after the iteration loop.

* - ``alwaysValidate = 1``
* - ``alwaysValidate > 0``
- After every timed iteration
- ``ValidateAllTransfers`` called inside the loop; any error stops the run.

Expand All @@ -112,8 +117,9 @@ For each transfer and each DST, the following steps are performed:

2. **Get the actual output:**

- **GPU destination** and ``validateOnDevice = 1``: Compare on the device using a validation kernel; no host copy is made.
- **CPU destination** or ``validateDirect = 1``: Point directly at the destination memory.
- **GPU destination** and ``validateDirect = 0``: Copy destination to a host ``outputBuffer``
- **GPU destination**, ``validateOnDevice = 0``, and ``validateDirect = 0``: Copy destination to a host ``outputBuffer``
via ``hipMemcpy``, then compare against ``outputBuffer``.

3. **Comparison:** Performed using ``memcmp(output, expected, numBytes)``. On mismatch, the code finds the first differing index and returns an error with the index, expected value, and actual value.
Expand All @@ -135,7 +141,7 @@ environment variables or in a configuration file.

* - ``alwaysValidate``
- ``ALWAYS_VALIDATE``
- To validate after each iteration, set to ``1``. To validate once at the end, set to ``0``.
- To validate after each iteration, set to a value greater than ``0``. To validate once at the end (default), set to ``0``. To disable validation entirely, set to a negative value.

* - ``validateDirect``
- ``VALIDATE_DIRECT``
Expand Down
31 changes: 23 additions & 8 deletions docs/conceptual/transferbench-timing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ The following table provides a quick summary of the three timing levels:
Timing methods
==============

The timing method used for each Executor and transfer depends on the Executor type and the value of
``USE_HIP_EVENTS``.
The timing method used for each Executor and transfer depends on the Executor type and the values of
``USE_HIP_EVENTS``, ``USE_SINGLE_STREAM``, and (for the DMA Executor) ``USE_HSA_DMA``.

Executor timing
---------------
Expand All @@ -61,10 +61,20 @@ Executor timing
* - CPU
- CPU wall-clock (``std::chrono::high_resolution_clock``)

* - GFX / DMA
- For ``USE_HIP_EVENTS=1`` (default): HIP events (``hipEventElapsedTime``)
* - GFX
- For ``USE_HIP_EVENTS=1`` and ``USE_SINGLE_STREAM=1`` (both defaults): HIP events (``hipEventElapsedTime``) around the single combined kernel launch.

For ``USE_HIP_EVENTS=0``: CPU wall-clock (``std::chrono::high_resolution_clock``)
Otherwise (``USE_HIP_EVENTS=0`` or ``USE_SINGLE_STREAM=0``): CPU wall-clock (``std::chrono::high_resolution_clock``), spanning from the first transfer's kernel launch to the last transfer's completion. Executor dispatch overhead (device selection, threadpool dispatch) is excluded.

.. note::

When the Executor runs only PingPongs (no copy transfers), it instead reports CPU wall-clock over the whole executor call, regardless of ``USE_HIP_EVENTS``/``USE_SINGLE_STREAM``.

* - TDM
- Same as GFX: for ``USE_HIP_EVENTS=1`` and ``USE_SINGLE_STREAM=1``, HIP events around the combined kernel launch; otherwise, CPU wall-clock over the whole executor call.

* - DMA / BMA
- Always CPU wall-clock (``std::chrono::high_resolution_clock``) over the whole executor call. ``USE_HIP_EVENTS`` doesn't affect Executor-level timing for these Executor types.

* - NIC
- CPU wall-clock (``std::chrono::high_resolution_clock``)
Expand All @@ -81,12 +91,17 @@ Transfer timing
* - CPU
- CPU wall-clock (``std::chrono::high_resolution_clock``)

* - GFX
- For ``USE_HIP_EVENTS=1`` (default): GPU wall-clock timestamp (``wall_clock64()``)
* - GFX / TDM
- For ``USE_SINGLE_STREAM=1`` (default): GPU wall-clock timestamps recorded inside the kernel (``wall_clock64()`` on AMD, the ``%globaltimer`` PTX register on NVIDIA), spanning from the earliest SubExecutor start to the latest SubExecutor stop of that transfer. Independent of ``USE_HIP_EVENTS``.

For ``USE_HIP_EVENTS=0``: CPU wall-clock (``std::chrono::high_resolution_clock``)
For ``USE_SINGLE_STREAM=0`` (each transfer on its own stream): with ``USE_HIP_EVENTS=1``, HIP events (``hipEventElapsedTime``); with ``USE_HIP_EVENTS=0``, CPU wall-clock around the launch and stream synchronize.

* - DMA
- For ``USE_HIP_EVENTS=1``, ``USE_HSA_DMA=0``, and no sub-index specified: HIP events (``hipEventElapsedTime``).

Otherwise: CPU wall-clock (``std::chrono::high_resolution_clock``).

* - BMA
- For ``USE_HIP_EVENTS=1`` (default): HIP events (``hipEventElapsedTime``)

For ``USE_HIP_EVENTS=0``: CPU wall-clock (``std::chrono::high_resolution_clock``)
Expand Down
4 changes: 2 additions & 2 deletions docs/conceptual/transferbench-workflow.rst
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,11 @@ Each iteration proceeds through the following steps:

5. **Stop CPU timing:** Stops the CPU timer.

6. **Validate (optional):** If ``ALWAYS_VALIDATE`` = 1, performs a correctness check after each iteration to verify that destination memory matches the expected reference results.
6. **Validate (optional):** Performs a correctness check to verify that destination memory matches the expected reference results. ``ALWAYS_VALIDATE`` > 0 validates after every iteration, ``= 0`` (default) validates once after all iterations, and ``< 0`` disables validation entirely.

.. note::

By default, validation runs only once after all iterations complete. Setting ``ALWAYS_VALIDATE`` = 1 validates after every iteration, which can help detect transient errors that would otherwise be masked by a passing final iteration.
By default, validation runs only once after all iterations complete. Setting ``ALWAYS_VALIDATE`` to a value greater than 0 validates after every iteration, which can help detect transient errors that would otherwise be masked by a passing final iteration. Setting it to a negative value disables validation entirely.

Finalize
--------
Expand Down
4 changes: 4 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
if not match:
raise ValueError("VERSION not found!")
version_number = match[1]
# Pad a bare major.minor version (e.g. "1.71") to major.minor.patch (e.g. "1.71.0")
# for display purposes, without touching the VERSION string in the source itself.
if version_number.count('.') == 1:
version_number += ".0"

# for PDF output on Read the Docs
project = "TransferBench Documentation"
Expand Down
4 changes: 4 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ TransferBench is a utility for benchmarking simultaneous memory transfers betwee

The source code is hosted at `<https://github.com/ROCm/TransferBench>`_.

.. note::

TransferBench is part of the `ROCmValidationSuite (RVS) <https://rocm.docs.amd.com/projects/ROCmValidationSuite/en/latest/index.html>`_ and is installed with it.

.. grid:: 2
:gutter: 3

Expand Down
62 changes: 24 additions & 38 deletions docs/install/build_from_source.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
Building TransferBench from source
===================================

.. note::

TransferBench is part of the `ROCmValidationSuite (RVS) <https://rocm.docs.amd.com/projects/ROCmValidationSuite/en/latest/index.html>`_ and is installed with it.

To build TransferBench from source, install the following required dependencies first:

Required dependencies
Expand Down Expand Up @@ -36,7 +40,7 @@ Optional dependencies

Depending on your requirement, you can install these optional dependencies:

- ``libibverbs``: Required for enabling NIC Executor for RDMA transfers.
- ``libibverbs``: Required at runtime for the NIC Executor (RDMA transfers). As of v1.70.0, it's loaded dynamically via ``dlopen``, so it isn't needed to build TransferBench, and NIC support is always compiled in.

- For Ubuntu/Debian:

Expand Down Expand Up @@ -124,7 +128,7 @@ To modify the Makefile behavior, use the following environment variables:
</colgroup>
<tbody class="makefile-env-variables">
<tr>
<td rowspan="7"><b>Paths and compilers</b> - To customize which compiler to use or the library to link against.</td>
<td rowspan="6"><b>Paths and compilers</b> - To customize which compiler to use or the library to link against.</td>
<td><code>ROCM_PATH</code></td>
<td>ROCm installation path for HIP compiler, includes, and libs.</td>
<td><code>/opt/rocm</code></td>
Expand Down Expand Up @@ -154,23 +158,8 @@ To modify the Makefile behavior, use the following environment variables:
<td>Path to <code>amdgcn</code> bitcode. Auto-detected from the ROCm layout.</td>
<td><code>(auto)</code></td>
</tr>
<tr>
<td><code>HIPCONFIG</code></td>
<td>Path to <code>hipconfig</code>, which is used to query the HIP version (for pod communication support check).</td>
<td><code>hipconfig</code></td>
</tr>
<tr>
<td rowspan="5"><b>Feature flags</b> - To control enabling features that require compile-time support. By default, these are enabled under the right conditions.</td>
<td><code>DISABLE_NIC_EXEC</code></td>
<td>Disables NIC Executor support.</td>
<td><code>0</code></td>
</tr>
<tr>
<td><code>DISABLE_DMA_BUF</code></td>
<td>Disables <code>DMA-BUF</code> for GPU Direct RDMA. Requires NIC Executor support.</td>
<td><code>1</code></td>
</tr>
<tr>
<td><code>DISABLE_MPI_COMM</code></td>
<td>Disables MPI communication backend support for multinode TransferBench.</td>
<td><code>0</code></td>
Expand All @@ -180,11 +169,21 @@ To modify the Makefile behavior, use the following environment variables:
<td>Disables AMD-SMI pod membership checks.</td>
<td><code>0</code></td>
</tr>
<tr>
<td><code>DISABLE_NVML</code></td>
<td>Disables NVML pod membership detection for CUDA builds.</td>
<td><code>0</code></td>
</tr>
<tr>
<td><code>DISABLE_POD_COMM</code></td>
<td>Disables pod communication support (UALoE / MNNVL).</td>
<td><code>0</code></td>
</tr>
<tr>
<td><code>DISABLE_CUMEM</code></td>
<td>Disables the CUDA driver API. Also disables pod communication support on CUDA.</td>
<td><code>0</code></td>
</tr>
<tr>
<td rowspan="3"><b>Build options</b></td>
<td><code>SINGLE_KERNEL</code></td>
Expand Down Expand Up @@ -272,34 +271,29 @@ To modify the CMake behavior, use the following environment variables:
<td> </td>
</tr>
<tr>
<td rowspan="6"><b>Build options (ON/OFF)</b> - Pass -DVAR=value to set</td>
<td rowspan="5"><b>Build options (ON/OFF)</b> - Pass -DVAR=value to set</td>
<td><code>BUILD_LOCAL_GPU_TARGET_ONLY</code></td>
<td>Builds only for the GPUs detected on the given machine using <code>rocm_agent_enumerator</code>.</td>
<td><code>OFF</code></td>
</tr>
<tr>
<td><code>ENABLE_NIC_EXEC</code></td>
<td>Enables RDMA NIC Executor.</td>
<td><code>BUILD_RELOCATABLE_PACKAGE</code></td>
<td>Builds with RVS-style relocatable RPATH and <code>amdrocm&lt;MAJOR&gt;-transferbench</code> package naming.</td>
<td><code>OFF</code></td>
</tr>
<tr>
<td><code>ENABLE_MPI_COMM</code></td>
<td>Enables MPI communicator as backbone for multinode TransferBench.</td>
<td><code>OFF</code></td>
</tr>
<tr>
<td><code>ENABLE_DMA_BUF</code></td>
<td>Enables DMA-BUF for GPU Direct RDMA (requires NIC).</td>
<td><code>OFF</code></td>
</tr>
<tr>
<td><code>ENABLE_AMD_SMI</code></td>
<td>Enables AMD-SMI pod membership queries.</td>
<td><code>OFF</code></td>
</tr>
<tr>
<td><code>ENABLE_POD_COMM</code></td>
<td>Enables pod communication (HIP >= 8.0).</td>
<td>Enables pod communication (HIP >= 8.0.0).</td>
<td><code>OFF</code></td>
</tr>
<tr>
Expand All @@ -314,21 +308,11 @@ To modify the CMake behavior, use the following environment variables:
<td><code>0</code></td>
</tr>
<tr>
<td rowspan="3"><b>CMake cache variables</b></td>
<td><b>CMake cache variables</b></td>
<td><code>GPU_TARGETS</code></td>
<td>Semicolon-separated GPU architectures. Overridden if <code>BUILD_LOCAL_GPU_TARGET_ONLY</code> is <code>ON</code></td>
<td><code style="word-break: break-all;">gfx906;gfx908;gfx90a;gfx942;gfx950;gfx1030;gfx1100;gfx1101;gfx1102;gfx1150;gfx1151;gfx1152;gfx1153;gfx1200;gfx1201;gfx1250;gfx1250-strict</code></td>
</tr>
<tr>
<td><code>AMD_SMI_EXECUTABLE</code></td>
<td>Path to <code>amd-smi</code> for AMD-SMI version check.</td>
<td><code>amd-smi</code></td>
</tr>
<tr>
<td><code>HIPCONFIG_EXECUTABLE</code></td>
<td>Path to <code>hipconfig</code> for HIP version or pod check.</td>
<td><code>hipconfig</code></td>
</tr>
</tbody>
</table>
</div>
Expand All @@ -344,9 +328,11 @@ To modify the CMake behavior, use the following environment variables:
git clone https://github.com/ROCm/TransferBench.git
cd TransferBench
mkdir build && cd build
cmake .. -DENABLE_NIC_EXEC=ON -DENABLE_MPI_COMM=ON
cmake .. -DENABLE_MPI_COMM=ON
make

.. _build-troubleshooting:

Troubleshooting common build errors
====================================

Expand Down
Loading
Loading