Skip to content

build(rocm): declare hipCUB and rocPRIM headers#540

Merged
davide221 merged 1 commit into
mainfrom
codex/rocm-hipcub-deps
Jul 18, 2026
Merged

build(rocm): declare hipCUB and rocPRIM headers#540
davide221 merged 1 commit into
mainfrom
codex/rocm-hipcub-deps

Conversation

@davide221

@davide221 davide221 commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Prerequisite packaging for #504.\n\n- Install hipcub-dev and rocprim-dev in the ROCm Docker builder.\n- Document the same packages for native Ubuntu/ROCm builds.\n\nValidated on Lucebox6 with ROCm 7.2.4: a fresh #496 + #504 gfx1151 build compiled all 346 targets and linked dflash_server using only system headers (no temporary include path).

Review in cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 2 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="Dockerfile.rocm">

<violation number="1" location="Dockerfile.rocm:46">
P3: This new comment describes hipCUB/rocPRIM as already used by ggml's ROCm argsort/top-k path, but in the current vendored ggml source `GGML_CUDA_USE_CUB` is gated on `!defined(GGML_USE_HIP)`, so the HIP backend never takes the CUB-based sort path today (falls back to bitonic sort). Since the PR description frames this as prerequisite packaging for #504, consider rephrasing the comment to make clear the headers aren't exercised yet (e.g. 'in preparation for #504' / 'once GGML_CUDA_USE_CUB is enabled for HIP') so it doesn't read as describing current behavior.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread Dockerfile.rocm
# driver (/dev/kfd, /dev/dri) is wired in at run time via --device.
# hipblas/rocblas: ggml's HIP backend hard-requires them
# hipblas/rocblas: ggml's HIP backend hard-requires them.
# hipCUB/rocPRIM: ggml's ROCm argsort/top-k kernels use their headers for the

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3: This new comment describes hipCUB/rocPRIM as already used by ggml's ROCm argsort/top-k path, but in the current vendored ggml source GGML_CUDA_USE_CUB is gated on !defined(GGML_USE_HIP), so the HIP backend never takes the CUB-based sort path today (falls back to bitonic sort). Since the PR description frames this as prerequisite packaging for #504, consider rephrasing the comment to make clear the headers aren't exercised yet (e.g. 'in preparation for #504' / 'once GGML_CUDA_USE_CUB is enabled for HIP') so it doesn't read as describing current behavior.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At Dockerfile.rocm, line 46:

<comment>This new comment describes hipCUB/rocPRIM as already used by ggml's ROCm argsort/top-k path, but in the current vendored ggml source `GGML_CUDA_USE_CUB` is gated on `!defined(GGML_USE_HIP)`, so the HIP backend never takes the CUB-based sort path today (falls back to bitonic sort). Since the PR description frames this as prerequisite packaging for #504, consider rephrasing the comment to make clear the headers aren't exercised yet (e.g. 'in preparation for #504' / 'once GGML_CUDA_USE_CUB is enabled for HIP') so it doesn't read as describing current behavior.</comment>

<file context>
@@ -42,7 +42,10 @@ ENV PATH=/opt/rocm/bin:/opt/rocm/lib/llvm/bin:${PATH}
 # driver (/dev/kfd, /dev/dri) is wired in at run time via --device.
-# hipblas/rocblas: ggml's HIP backend hard-requires them
+# hipblas/rocblas: ggml's HIP backend hard-requires them.
+# hipCUB/rocPRIM: ggml's ROCm argsort/top-k kernels use their headers for the
+# large-N device-sort path; the ROCm apt repository ships them separately from
+# the base HIP toolchain.
</file context>

@davide221
davide221 merged commit 90ec556 into main Jul 18, 2026
8 checks passed
@davide221
davide221 deleted the codex/rocm-hipcub-deps branch July 18, 2026 19:15
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