Skip to content

feat(strata): build and run edge0-145b on AMD HIP (Windows, gfx1100) - #196

Open
ppkrol wants to merge 1 commit into
Edge0-AI:mainfrom
ppkrol:feat/strata-hip-windows
Open

ppkrol wants to merge 1 commit into
Edge0-AI:mainfrom
ppkrol:feat/strata-hip-windows

Conversation

@ppkrol

@ppkrol ppkrol commented Nov 12, 2026

Copy link
Copy Markdown

What & why

edge0-145b is documented as NVIDIA-only. edge0-strata still carries upstream Strata's HIP backend, but the
latent-MoE additions did not build or run with it. With the changes below Edge0-145B-q3k loads, reads prompts and
decodes on a Radeon RX 7900 XTX (gfx1100, 24 GB) under Windows 11.

Build (HIP only):

  • CMakeLists.txt: the HIP MMQ branch now compiles lat_q3k_*.cu and moe_fused_q3k.cu (their entry points are
    already stubs under __HIPCC__), and strata_engine gets latent_dense.cpp and latent_moe.cpp on HIP too; they
    were only added inside if(STRATA_ENABLE_CUDA).
  • moe_fused.cu, moe_fused_q3k.cu: the latent_kernel / latent_kernel_q3k launches were outside the
    !__HIPCC__ guard that holds the kernels. They are not reached on HIP (lat_dev().ok is false).
  • verify.cpp, prefill.cpp: two debug dumps use cudaGraph* / cudaPointer* names the HIP shim does not map.

Run (HIP only):

  • verify.cpp: the D stage's two D2H cudaMemcpyAsync calls and the "verify top3" dump (a synchronous
    cudaMemcpy) ran inside the verify window's graph capture. HIP then fails every request with
    verify: end capture: operation failed due to a previous error during capture. On HIP the two copies go through
    copy_bytes_from_mapped and the dump is skipped.

Every code change is inside #if defined(STRATA_USE_HIP) / __HIPCC__ or in the HIP branch of the CMake file, so
the CUDA build's sources are unchanged after preprocessing.

Docs: EDGE0.md gets a "Build (Windows, AMD, experimental)" section.

Limits:

  • The fused latent kernels stay CUDA-only. On HIP the model runs with STRATA_LATENT_FUSED=0,
    STRATA_LATENT_FUSED_DU=0, STRATA_LAT_FUSED_Q3K=0, so the prompt speed is far below the NVIDIA figures.
  • edge0-infer does not start this build; the server is started by hand with a configuration file.
  • labels.bin is located by the last / of STRATA_LATENT_A, so a path with only \ fails. Not changed here;
    the documentation says to write the path with /.

Area

  • Engine, CLI or server (edge0-infer/)
  • Model asset tools (edge0-infer/tools/assets/)
  • Chat app examples (edge0-infer/examples/)
  • Model docs (docs/)
  • Other (edge0-strata/)

How was it tested?

Environment: Windows 11 (10.0.26300), Ryzen 7 5800X3D, 64 GB RAM, Radeon RX 7900 XTX 24 GB, driver
32.0.31041.1004, ROCm 10.2.0a20260930 (TheRock wheels), Visual Studio Build Tools, base commit b7900cb.

Passed:

  • HIP build: set STRATA_HIP_ARCHS=gfx1100, set STRATA_NO_VISION=1, tools\hip\build_windows.bat (targets
    strata, strata-device, packaged zip).

  • Run: serve\server.py --engine strata --config <file> with Edge0-145B-q3k, D/U Q8, --vram-reserve-mib 3072
    (about 4100 experts resident). Chat requests through the web page and /v1/chat/completions return answers.

  • tools\strata_bench.py (medians):

    A stage of the prompt Chat decode tok/s 4K prompt tok/s 16K prompt tok/s Agent decode tok/s
    default (native_expert_grouped) 37.9 243.6 241.3 43.6
    STRATA_LATENT_MMQ=1 40.4 335.0 319.3 47.2
    STRATA_LATENT_MMQ=1, STRATA_ROUTE_TAIL_SKIP=7, STRATA_ROUTE_PRIOR=1.5 53.7 337.3 319.5 57.4

Not run:

  • The CUDA build (no NVIDIA card here).
  • The HIP unit tests (build_windows.bat tests) and the latent_*_verify tools.
  • Linux, other Radeon cards, Edge0 120B, the NVFP4 folders.
  • Any quality evaluation beyond reading the answers.

Before the changes: the HIP build stopped at verify.cpp, moe_fused.cu, moe_fused_q3k.cu and prefill.cpp;
once it built, every request failed with the capture error above.

Checklist

  • ctest --preset cpu -L "L0|L1" passes locally in edge0-infer/ (engine changes) - not applicable, no change in edge0-infer/
  • Ran the higher test levels this change affects (see edge0-infer/docs/testing.md) - not run, see above
  • Added/updated tests for new behavior - none added
  • Updated relevant docs / READMEs (incl. translations if user-facing) - edge0-strata/EDGE0.md (English only)

Co-Authored-By: Claude Fable 5.2

edge0-strata keeps upstream Strata's HIP backend, but the latent-MoE
additions did not build or run with it.

Build (HIP only):
- CMakeLists.txt: compile lat_q3k_*.cu and moe_fused_q3k.cu in the HIP MMQ
  branch (their entry points are stubs there) and add latent_dense.cpp and
  latent_moe.cpp to strata_engine for HIP
- moe_fused.cu, moe_fused_q3k.cu: the latent kernel launches were outside
  the !__HIPCC__ guard that holds the kernels
- verify.cpp, prefill.cpp: two debug dumps use cudaGraph* / cudaPointer*
  names the HIP shim does not map

Run (HIP only):
- verify.cpp: the D stage's two D2H cudaMemcpyAsync calls and the
  "verify top3" dump (a synchronous cudaMemcpy) ran inside the verify
  window's graph capture, which HIP rejects ("end capture: operation
  failed due to a previous error during capture"); on HIP the copies go
  through copy_bytes_from_mapped and the dump is skipped

Docs: EDGE0.md describes the build and the configuration.

The fused latent kernels stay CUDA-only; on HIP the model runs with
STRATA_LATENT_FUSED=0, STRATA_LATENT_FUSED_DU=0, STRATA_LAT_FUSED_Q3K=0.
Tested on one RX 7900 XTX under Windows 11. The CUDA build was not rebuilt.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VmeXwKqR7k1jsojD2bUxve
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant