Repository navigation
Conversation
sakuumomo
marked this pull request as ready for review
October 21, 2026 07:24
bsorensen110
added a commit
to bsorensen110/Strata
that referenced
this pull request
Oct 22, 2026
…en the slot pool is VRAM-capped, Niko1221#3441) — integ batch 19 [extern-C hybrid decls beside integ's NVML block]
sakuumomo
force-pushed
the
pr/engine-hybrid-cuda-hip
branch
2 times, most recently
from
October 25, 2026 19:08
a1656ff to
ca4e5a9
Compare
Owner
|
Thank you for the careful work on a combined CUDA and HIP build. It is planned for a later release, with no date yet, and this will stay open until then. |
sakuumomo
force-pushed
the
pr/engine-hybrid-cuda-hip
branch
3 times, most recently
from
October 28, 2026 18:05
559b6d9 to
fc10791
Compare
STRATA_HYBRID stays off. Turning it on keeps the CUDA host path and compiles the shared kernels again for HIP. Ordinals past the CUDA devices are HIP. The build is Linux x86-64 only. CUDA-only and HIP-only builds leave this path out. A HIP device is named by its architecture, with compute capability left at 0. Helpers are every other visible GPU. The HIP copies get the same hipBLASLt and rocBLAS switches as a pure HIP build when those libraries are present, and the HIP prompt kernels use their own device table. When the current device is AMD, startup matches a pure HIP build: the probe accepts a non-gfx11 host, mapped expert fills go through one pinned buffer, the helper busy-waits for its stream, --vram-elastic stays off, and the tail skip, PCIe share, architecture defaults, gfx12 chunk, and pipeline windows follow that card. A HIP primary does not probe the canonical PCIe pack or say that share will change.
… PLE flag and side-thread launch rule, the queue priming, and the integrated-GPU cache reserve
…he dflash2 stream priority and fork defaults, the Strix Halo window cap and the 12 GB card line
rebase-nixos globs every .cu into the hybrid HIP build, and upstream 0.2.3.x added dsv41 (drafter, vision, exl3 vendor) files that use four APIs the shim never had to name before: cudaMemcpy2D (ds4_model), cudaDataType and CUBLAS_GEMM_DEFAULT_TENSOR_OP (the vision and drafter cublasGemmEx calls), and cudaOccupancyMaxActiveBlocksPerMultiprocessor (exl3). Map each in both library branches: rocBLAS lets its own kernel selection use the tensor-op algo, hipBLAS has no algo selection and takes the plain default. Signed-off-by: Sakurai Momoka <sakumomo@proton.me>
moe_win.cu (vendor, new in 0.2.3.x) passes a small struct by value with CUDA's read-only marker; HIP passes by-value parameters grid-constant already, so the attribute only has to disappear. Signed-off-by: Sakurai Momoka <sakumomo@proton.me>
src/dsv41 (strata-dsv41, STRATA_BUILD_DSV41 OFF by default) is its own executable: the CUDA lane never compiles it into strata, and its host-side helpers (ds4_gguf_cpu.cpp, exl3_cpu.cpp, ds4_iq_cpu.cpp) are only linked into that executable. The hybrid glob compiled every src/*.cu into strata_hip_objs and whole-archived them into strata, so the HIP copy of ds4_model reached for those helpers and the link failed. Skip the subtree while the option is off. Signed-off-by: Sakurai Momoka <sakumomo@proton.me>
…1#3752 (GP100 weight-stationary experts) landed with the 0.2.7 rebase, after this file was written. The kernels are pure PTX (prmt/mad.wide/f16x2 asm): on the CUDA side they are strata_mmq sources only under STRATA_EXPERIMENTAL_SM60, gated at run time to machines whose every GPU is cc 6.0. A hip-src copy of them fails on 'invalid output constraint =f' / 'invalid instruction' in the gfx1150 pass, and could never dispatch on an AMD device - so they belong beside the gdn_chunk/mmq_nvfp4/mmq_kq_lib exclusions. moko flavor build was the witness: moe_ws_down/gu_iq2/gu_iq3 were the only FAILED targets.
sakuumomo
force-pushed
the
pr/engine-hybrid-cuda-hip
branch
from
October 30, 2026 21:09
6424f01 to
5fa2854
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem and result: One process could not use an NVIDIA GPU and an AMD GPU together.
STRATA_HYBRIDstays off. Turning it on keeps the CUDA host path and compiles the shared kernels again for HIP. Ordinals past the CUDA devices are HIP. The build is Linux x86-64 only. A CUDA-only build and a HIP-only build leave this path out.A HIP device is named by its architecture, with compute capability left at 0 so it is not read as an NVIDIA architecture. Helpers are every other visible GPU. When hipBLASLt or rocBLAS is present, the HIP copies get the same switches as a pure HIP build, and the HIP prompt kernels use their own device table. When the current device is AMD, startup matches a pure HIP build: the probe accepts a non-gfx11 host, mapped expert fills go through one pinned buffer, the helper busy-waits for its stream,
--vram-elasticstays off, and the tail skip, PCIe share, architecture defaults, gfx12 chunk, and pipeline windows follow that card. A HIP primary does not probe the canonical PCIe pack or say that the share will change.Related discussion: no earlier issue agrees this scope.
Approach: The new files compile only with
STRATA_HYBRID. Default builds keep their previous sources and flags. gfx906 is refused at configure. If CMake leaves a configuration's HIP flags empty, the init flags are written back. TwoSHELL:-includegenerator expressions force-include the HIP headers, so CMake does not drop a repeated-include.Validation:
Passed: four compiles of
10fdcb31on Linux x86-64.STRATA_BUILD_TESTS=OFFandSTRATA_PORTABLE=ONon the Nix builds.HIP,
STRATA_HYBRIDoff:STRATA_ENABLE_HIP=ON,STRATA_ENABLE_CUDA=OFF,CMAKE_HIP_ARCHITECTURES=gfx1030,STRATA_PREFILL_MMQ=ON, HIP 7.2.3. CMake reported "Strata: HIP enabled, arch gfx1030" and did not report a hybrid build. Output/nix/store/087zqcrh6grkxlkqlmk5hfjm62flfaz5-strata-hip-0.2.1(strataandstrata-device). The compiler printed warnings while compiling for gfx1030. The link finished.CUDA,
STRATA_HYBRIDoff:STRATA_ENABLE_CUDA=ON,STRATA_ENABLE_HIP=OFF,CMAKE_CUDA_ARCHITECTURES=89-real,STRATA_PREFILL_MMQ=OFF, CUDA 12.9.86, gcc 14.4.0. CMake reported "Strata: CUDA enabled, arch 89-real" and did not report a hybrid build. Output/nix/store/3y0dc0nzihb4plvl8iaj087vw2b4clxm-strata-cuda-0.2.1(strataandstrata-device).STRATA_HYBRID=ON: the same CUDA flags, plus HIP gfx1150. CMake reported CUDA arch 89-real and "Strata hybrid: gfx1150". The log shows CUDA objects and HIP objects (strata_hip_objs, compiled for gfx1150) in one build. Output/nix/store/h0v2fqhpi910zfx8c148gl828aw12y81-strata-hybrid-0.2.1(strataandstrata-device). The compiler printed warnings while compiling for gfx1150. The link finished.SYCL: the
strata-sycl-devimage fromsycl/tools/Dockerfile(oneAPI 2026.1.0, no AOT device).sycl/tools/build.sh strataprintedBUILD EXIT 0anderrors: 0. Binary/tmp/strata-wt-hybrid/build-sycl/strata.The author ran it on two Linux machines and reports that both function as intended. The laptop has an RTX 4060 and a Radeon 890M and serves with
STRATA_HYBRID. The desktop has an RX 6800 and an RX 6900 XT and serves with the HIP build, soSTRATA_HYBRIDstays off there. No command log or timing was attached to that report.Failed: none observed.
Not run: a SYCL process on a device. A saved log of the laptop startup.
Limits: Linux x86-64 only. A HIP primary refuses
--vram-elastic.prime_hw_queuesstays on theSTRATA_USE_HIPpath. Data-type enums are not remapped between the two runtimes. The first host call on an AMD-only process can still enter the CUDA copy before a trampoline is installed. Compute capability 0 sends host code that branches on compute capability down the portable path while a HIP device is current.Changes since the last update (2026-10-27)
main(0.2.6,4b9e05a2); content re-landed verbatim. New tipb32dee9c— seven commits: the opt-in hybrid build, its 0.2.2/0.2.3 HIP-rule extensions, thehip_compatfixes main's drafter required, and the dsv41 glob guard. The commit hashes in the Validation section belong to the pre-rebase lineage.nixos, pin3032afd8) has served daily on both machines since the rebase: the laptop as the CUDA+HIP hybrid build (RTX 4060 + Radeon 890M), the desktop as a HIP-only build whereSTRATA_HYBRIDstays off (RX 6800 + RX 6900 XT).Changes since the last update (2026-10-30)
v0.2.8(870aedd9); content re-landed as before. The single conflict - the expert-cache auto message against upstream [Engine] v0.2.7.1 / engine 0.1.53: Excessive memory usage causes VRAM exhaustion and frequent request overflows #4474's late-priced note - resolved in the rebase. New tip5fa28548, eight commits: the seven above plus themoe_wsglob exclusion (upstream [Engine] GP100 prompt path: a fully resident layer's experts weight-stationary, one launch per product (STRATA_MMQ_WS=1, opt-in) #3752's GP100 weight-stationary expert kernels are pure PTX: the HIP lane can neither compile nor dispatch them, and the hybrid glob previously force-compiled them for gfx1150).nixos: every open PR branch of this stack re-merged in order onto870aedd9) passes every owner gate: HIP-only (gfx1030) and CUDA+HIP hybrid (gfx1150) flavor builds green with installCheck, and the session-file CPU and ThreadSanitizer suites green on the rebuilt lineage.Branch commits were re-signed (GPG ed25519) on 2026-10-30; trees are unchanged from the validated work.
Dependencies: none — #3553 stacks on this branch.