[PR #377] [CLOSED] HIP: time the PCIe probe on the host on Windows #2604

Closed
opened 2026-11-04 02:01:42 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/377
Author: @BlueKingMuch
Created: 10/1/2026
Status: ❌ Closed

Base: main ← Head: win-probe


📝 Commits (1)

  • eabe323 HIP: time the PCIe probe on the host on Windows

📊 Changes

1 file changed (+12 additions, -0 deletions)

View changed files

📝 src/program/generate.cpp (+12 -0)

📄 Description

The PCIe probe sets the share of the missed experts the GPU reads over the link (--pcie-frac): the native default 0.55 from 20 GB/s up, less on a slower link (#44). On Windows HIP it timed its copies with events that do not bracket them there, so it read impossible speeds and every link kept the x16 share.

What changes

  • On Windows HIP builds, probe_pcie_h2d_gbps times the same 4 x 256 MiB copies on the host clock, between two cudaDeviceSynchronize calls; the warm-up copy is synchronized before the clock starts. The 1 GiB takes about 40 ms on this card, so the synchronize around it hardly matters.
  • CUDA and Linux HIP builds keep the events (#if defined(STRATA_USE_HIP) && defined(_WIN32)).
  • The layer split's per-GPU probe calls the same function, so it gets the same timing.

Measured

RX 6800 on PCIe 4.0 x16, Windows 11, HIP SDK 7.2:

events (before) host clock (this PR)
probe reading 3,348 to 25,999 GB/s over 24 engine starts (median about 19,000) 27.2 GB/s in all 4 starts
resulting pcie_frac 0.55 0.55

A standalone copy of the probe on that card shows why: its events measure 0.13 ms for the 1 GiB, the host clock 43 ms (25.1 GB/s). The same test reads 27.2 GB/s for a copy from registered memory and 27.0 GB/s for a kernel reading mapped pinned memory, so 27.2 GB/s is what this link carries. In one engine start with GPU_FLUSH_ON_EXECUTION=1 (the runtime submits every command right away) the events read 26.9 GB/s.

On this card the share is 0.55 either way, so nothing changes in speed here. On a slower link the share now shrinks as #44 intended, e.g. to 0.28 at 13 GB/s (about what PCIe 3.0 x16 carries); not tested on such a link.

🤖 Generated with Claude Code

https://claude.ai/code/session_015Ld5YDzuKW1hgMVwwgRZDP


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Niko1221/Strata/pull/377 **Author:** [@BlueKingMuch](https://github.com/BlueKingMuch) **Created:** 10/1/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `win-probe` --- ### 📝 Commits (1) - [`eabe323`](https://github.com/Niko1221/Strata/commit/eabe323d50c97f03fcd532a246833200a3689b36) HIP: time the PCIe probe on the host on Windows ### 📊 Changes **1 file changed** (+12 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `src/program/generate.cpp` (+12 -0) </details> ### 📄 Description The PCIe probe sets the share of the missed experts the GPU reads over the link (`--pcie-frac`): the native default 0.55 from 20 GB/s up, less on a slower link (#44). On Windows HIP it timed its copies with events that do not bracket them there, so it read impossible speeds and every link kept the x16 share. ## What changes - On Windows HIP builds, `probe_pcie_h2d_gbps` times the same 4 x 256 MiB copies on the host clock, between two `cudaDeviceSynchronize` calls; the warm-up copy is synchronized before the clock starts. The 1 GiB takes about 40 ms on this card, so the synchronize around it hardly matters. - CUDA and Linux HIP builds keep the events (`#if defined(STRATA_USE_HIP) && defined(_WIN32)`). - The layer split's per-GPU probe calls the same function, so it gets the same timing. ## Measured RX 6800 on PCIe 4.0 x16, Windows 11, HIP SDK 7.2: | | events (before) | host clock (this PR) | |---|---|---| | probe reading | 3,348 to 25,999 GB/s over 24 engine starts (median about 19,000) | 27.2 GB/s in all 4 starts | | resulting `pcie_frac` | 0.55 | 0.55 | A standalone copy of the probe on that card shows why: its events measure 0.13 ms for the 1 GiB, the host clock 43 ms (25.1 GB/s). The same test reads 27.2 GB/s for a copy from registered memory and 27.0 GB/s for a kernel reading mapped pinned memory, so 27.2 GB/s is what this link carries. In one engine start with `GPU_FLUSH_ON_EXECUTION=1` (the runtime submits every command right away) the events read 26.9 GB/s. On this card the share is 0.55 either way, so nothing changes in speed here. On a slower link the share now shrinks as #44 intended, e.g. to 0.28 at 13 GB/s (about what PCIe 3.0 x16 carries); not tested on such a link. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_015Ld5YDzuKW1hgMVwwgRZDP --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-04 02:01:42 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#2604
No description provided.