[PR #4691] [Engine] fix Windows HIP long-path loading #5138

Open
opened 2026-11-07 16:33:00 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Niko1221/Strata/pull/4691
Author: @tobitege
Created: 10/30/2026
Status: 🔄 Open

Base: main ← Head: codex/fix-windows-hip-long-paths


📝 Commits (1)

  • bf3ef25 [Engine] fix Windows HIP long-path loading

📊 Changes

3 files changed (+16 additions, -0 deletions)

View changed files

📝 cmake/hip_backend.cmake (+11 -0)
📝 cmake/strata-utf8.manifest (+1 -0)
📝 src/kernels/hc_persist_parity.cpp (+4 -0)

📄 Description

Problem and result

On Windows, a HIP engine installed under a long directory can fail to load hipBLASLt's Tensile kernel files and crash in getAlgosFromIndex. This was reproduced on Radeon 8065S / gfx1151 with ROCm 10.2.0a20260930, hipBLASLt 1.5.0 and the packaged gfx1151 tuning table. Windows long paths were already enabled.

The original test executable passed from a short directory but failed when the Tensile file path reached 273 characters, using the same ROCm DLLs and tuning table. With this patch, the native test passed at the same long installed path: all four numerical checks passed, with four tuned launches and zero fallbacks.

None. Open and closed issues and PRs were searched for longPathAware and "long path" HIP; no matching discussion was found.

Approach

The Windows HIP build uses clang's GNU-style driver, so the existing MSVC-only manifest handling does not apply. Embed the Windows manifest through a HIP interface target and add longPathAware alongside the existing UTF-8 setting. Track the manifest as a link dependency so changes trigger relinking.

The regular Windows HIP test build also exposed POSIX-only setenv/unsetenv calls in hc_persist_parity. Use _putenv_s on Windows so that test compiles. No kernel algorithm or tuning-table entries change.

Validation

Local results were produced on Windows with Radeon 8065S / gfx1151, Adrenalin 26.10.1 and ROCm 10.2.0a20260930. The tested patch on base 870aedd9 is committed as bf3ef258. The following CI runs use that exact commit.

Passed:

  • tools\hip\build_windows.bat tests, with STRATA_HIP_ARCHS=gfx1151: engine, native test executables, CPU/HIP vision readers and package built successfully.
  • hip_prefill_hipblaslt_gemm.exe at the original long installed path with the gfx1151 table enabled: four cases passed, launches=4 fallbacks=0. Before the patch, the same installed-path replay reported Failed to open file and exited with 0xC0000005 inside the bundled Tensile/hipBLASLt libraries.
  • The focused CTests hip_prefill_gemm, hip_prefill_wmma_gemm_parity, hip_prefill_hipblaslt_gemm, hc_persist_parity and hc_persist_default_off: all five passed.
  • Portable monitor CI: Windows and Linux, Python 3.10 and 3.11, including the packaged interactive smoke checks.
  • Minimal serving runtime CI: runtime-only smoke check and full server unittest suite.
  • Metal build CI: engine compiled and linked.
  • Host npm run typecheck passed. All 29 tests in tests/terminal/test_hipblaslt_tuning.py passed as part of the full Python run below.

Failed:

  • ctest --test-dir build-hip-win --output-on-failure --timeout 120 --output-junit <report>: 158 passed, eight failed, eight skipped. Failures: vmm_test, hip_handoff, native_grouped_parity, ple_parity, conversation_copy_streams_test, hip_prefill_mmq_parity, expert_parity and pool_test. Some require unavailable model fixtures; hip_prefill_mmq_parity crashed. These native failures have not been compared with an unmodified upstream build, so their regression status remains unverified.
  • python -m pytest tests/terminal tests/tuning -ra --junitxml=<report>: 2,222 passed, 18 failed, 70 skipped. Two failing cases passed after correcting the test environment. A subsequent comparison of the 18 original cases with the same Python environment produced 16 failures on unmodified upstream/main (870aedd9) and 15 on this patch. Every failure in the patched comparison also failed upstream; one additional upstream failure did not reproduce in the patched focused run. This is a focused comparison, not a second full-suite pass.
  • Host npm test: 1,120 passed, 25 failed, 102 skipped. Hanging test workers were stopped after recording their state. No full upstream comparison was completed for these host failures.
  • Running each tools/test_setup_*.py script separately left four failing suites after an environment correction: test_setup_download.py, test_setup_dsv41.py, test_setup_golden.py and test_setup_unsloth.py. All four also failed in the unmodified upstream checkout. Their causes are not resolved here.

Not run:

  • CUDA and SYCL builds of the shared Windows manifest/test changes: the required toolchains are unavailable locally. Please help validate these backends; this PR remains a draft under the contribution rules.
  • GPU execution on other architectures and operating systems. The Metal CI result establishes compilation and linking, not GPU correctness.

Limits

The installed-path check covers four cases using two of the tuning table's 32 rows. It does not validate every solution ID. The broader local suite is not green, and the CI workflows do not cover all host or native HIP tests.

This PR contains only the three code files for the Windows HIP fix. The benchmark report, measurements and unrelated test repairs are excluded. No performance claim is made.


🔄 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/4691 **Author:** [@tobitege](https://github.com/tobitege) **Created:** 10/30/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `codex/fix-windows-hip-long-paths` --- ### 📝 Commits (1) - [`bf3ef25`](https://github.com/Niko1221/Strata/commit/bf3ef25841d19c6984cc7b540fe293cd87c81d33) [Engine] fix Windows HIP long-path loading ### 📊 Changes **3 files changed** (+16 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `cmake/hip_backend.cmake` (+11 -0) 📝 `cmake/strata-utf8.manifest` (+1 -0) 📝 `src/kernels/hc_persist_parity.cpp` (+4 -0) </details> ### 📄 Description ## Problem and result On Windows, a HIP engine installed under a long directory can fail to load hipBLASLt's Tensile kernel files and crash in `getAlgosFromIndex`. This was reproduced on Radeon 8065S / gfx1151 with ROCm 10.2.0a20260930, hipBLASLt 1.5.0 and the packaged gfx1151 tuning table. Windows long paths were already enabled. The original test executable passed from a short directory but failed when the Tensile file path reached 273 characters, using the same ROCm DLLs and tuning table. With this patch, the native test passed at the same long installed path: all four numerical checks passed, with four tuned launches and zero fallbacks. ## Related discussion None. Open and closed issues and PRs were searched for `longPathAware` and `"long path" HIP`; no matching discussion was found. ## Approach The Windows HIP build uses clang's GNU-style driver, so the existing MSVC-only manifest handling does not apply. Embed the Windows manifest through a HIP interface target and add `longPathAware` alongside the existing UTF-8 setting. Track the manifest as a link dependency so changes trigger relinking. The regular Windows HIP test build also exposed POSIX-only `setenv`/`unsetenv` calls in `hc_persist_parity`. Use `_putenv_s` on Windows so that test compiles. No kernel algorithm or tuning-table entries change. ## Validation Local results were produced on Windows with Radeon 8065S / gfx1151, Adrenalin 26.10.1 and ROCm 10.2.0a20260930. The tested patch on base `870aedd9` is committed as `bf3ef258`. The following CI runs use that exact commit. **Passed:** - `tools\hip\build_windows.bat tests`, with `STRATA_HIP_ARCHS=gfx1151`: engine, native test executables, CPU/HIP vision readers and package built successfully. - `hip_prefill_hipblaslt_gemm.exe` at the original long installed path with the gfx1151 table enabled: four cases passed, `launches=4 fallbacks=0`. Before the patch, the same installed-path replay reported `Failed to open file` and exited with `0xC0000005` inside the bundled Tensile/hipBLASLt libraries. - The focused CTests `hip_prefill_gemm`, `hip_prefill_wmma_gemm_parity`, `hip_prefill_hipblaslt_gemm`, `hc_persist_parity` and `hc_persist_default_off`: all five passed. - [Portable monitor CI](https://github.com/tobitege/Strata/actions/runs/41030810511): Windows and Linux, Python 3.10 and 3.11, including the packaged interactive smoke checks. - [Minimal serving runtime CI](https://github.com/tobitege/Strata/actions/runs/41030853891): runtime-only smoke check and full server unittest suite. - [Metal build CI](https://github.com/tobitege/Strata/actions/runs/41030857775): engine compiled and linked. - Host `npm run typecheck` passed. All 29 tests in `tests/terminal/test_hipblaslt_tuning.py` passed as part of the full Python run below. **Failed:** - `ctest --test-dir build-hip-win --output-on-failure --timeout 120 --output-junit <report>`: 158 passed, eight failed, eight skipped. Failures: `vmm_test`, `hip_handoff`, `native_grouped_parity`, `ple_parity`, `conversation_copy_streams_test`, `hip_prefill_mmq_parity`, `expert_parity` and `pool_test`. Some require unavailable model fixtures; `hip_prefill_mmq_parity` crashed. These native failures have not been compared with an unmodified upstream build, so their regression status remains unverified. - `python -m pytest tests/terminal tests/tuning -ra --junitxml=<report>`: 2,222 passed, 18 failed, 70 skipped. Two failing cases passed after correcting the test environment. A subsequent comparison of the 18 original cases with the same Python environment produced 16 failures on unmodified `upstream/main` (`870aedd9`) and 15 on this patch. Every failure in the patched comparison also failed upstream; one additional upstream failure did not reproduce in the patched focused run. This is a focused comparison, not a second full-suite pass. - Host `npm test`: 1,120 passed, 25 failed, 102 skipped. Hanging test workers were stopped after recording their state. No full upstream comparison was completed for these host failures. - Running each `tools/test_setup_*.py` script separately left four failing suites after an environment correction: `test_setup_download.py`, `test_setup_dsv41.py`, `test_setup_golden.py` and `test_setup_unsloth.py`. All four also failed in the unmodified upstream checkout. Their causes are not resolved here. **Not run:** - CUDA and SYCL builds of the shared Windows manifest/test changes: the required toolchains are unavailable locally. Please help validate these backends; this PR remains a draft under the contribution rules. - GPU execution on other architectures and operating systems. The Metal CI result establishes compilation and linking, not GPU correctness. ## Limits The installed-path check covers four cases using two of the tuning table's 32 rows. It does not validate every solution ID. The broader local suite is not green, and the CI workflows do not cover all host or native HIP tests. This PR contains only the three code files for the Windows HIP fix. The benchmark report, measurements and unrelated test repairs are excluded. No performance claim is made. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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#5138
No description provided.