Skip to content

Fix build errors on NVCC and under -Werror, add fork CI - #3

Merged
Pascal-SAPUI5 merged 4 commits into
masterfrom
feat/turboquant-head-dim-multiples-of-128
Aug 10, 2026
Merged

Pascal-SAPUI5 merged 4 commits into
masterfrom
feat/turboquant-head-dim-multiples-of-128

Conversation

@Pascal-SAPUI5

Copy link
Copy Markdown
Owner

Follow-up to #2. Two of these are real build fixes that now affect master; the other two are CI configuration.

Build fixes

Missing <type_traits> — fattn-tile.cuh uses std::conditional and std::is_same five times, but neither it nor common.cuh includes the header (common.cuh only pulls in <cstdint>). HIP/clang provides it transitively, NVCC does not. The code as merged in #2 does not compile against CUDA.

Division by zero — flash_attn_tile_load_tile_turbo_k computes idx / JP and idx % JP. The trailing block instantiates it with J = 0, so JP = 0. The loop never runs, but the compiler evaluates the divisions at compile time and rejects them under -Werror. The static_assert guarded the condition; the code did not.

Incomplete switch — ggml_compute_forward_clamp switches over ggml_type without a default, so adding TURBO3_0/TURBO4_0 to the enum made it incomplete (-Wswitch), which is fatal under -Werror.

All three were invisible locally: the development build uses HIP with gfx1201 and no -Werror. They were found by this fork's HIP quality check, which uses -Werror and gfx908. Verified by replicating that job locally — clean.

CI

The upstream workflows assume infrastructure a fork does not have (self-hosted runners for ggml-ci, signing secrets, Apple/Windows matrices), so they fail for reasons unrelated to the code and bury real failures in noise. Disabled the ones that cannot work here; kept CI, HIP quality check, sanitize, server and the python linters.

Added turboquant-ci.yml with two jobs: a CPU build running test-turboquant and test-backend-ops, and a CUDA compile check of the ggml-cuda target. The CUDA job is compile-only — the runners have no GPU — but that is the job that matters here, since it covers exactly the NVCC gap that the <type_traits> bug fell through.

Status: the CPU job passes; the CUDA job needed two corrections to its toolkit installation and its third run is pending. ubuntu-22-hip (the full HIP build) passes.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Q5jMcvdevae8j4T36C9h2z

Pascal-SAPUI5 and others added 4 commits August 10, 2026 20:57
Two things the fork's CI surfaced.

fattn-tile.cuh uses std::conditional and std::is_same five times, but neither it
nor common.cuh includes <type_traits> — common.cuh only pulls in <cstdint>.
HIP/clang provides it transitively, which is why the local build is green; NVCC
is stricter. Exactly the class of error that only shows up on hardware I do not
have.

The upstream workflows assume infrastructure a fork does not have: self-hosted
runners for ggml-ci, signing secrets, Apple and Windows matrices. They fail for
reasons unrelated to the code, which buries real failures in noise. Disabled the
ones that cannot work here (self-hosted, android/apple/cann/riscv/vulkan,
release, publishing, AI review) and added turboquant-ci.yml, which checks what
matters for this fork:

  - CPU build plus test-turboquant and test-backend-ops
  - a CUDA compile check of the ggml-cuda target

The CUDA job is compile-only since the runners have no GPU. That is still the
most valuable one here: TurboQuant is developed against HIP, and HIP/clang pulls
in headers NVCC does not — the type_traits omission above would have been caught
by it.

Kept active: CI (which carries the ubuntu-cpu and cuda jobs), HIP quality check,
sanitize, server and the python linters.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Both found by the fork's HIP quality check, which builds with -Werror and
GPU_TARGETS=gfx908 — neither of which my local build uses.

fattn-tile.cuh: flash_attn_tile_load_tile_turbo_k computes idx / JP and idx % JP.
The trailing block instantiates it with J = 0, so JP = 0. The loop never runs, but
the compiler evaluates the divisions at compile time and rejects them. The
static_assert guarded the condition; the code did not. Now returns early for
JP == 0.

ops.cpp: ggml_compute_forward_clamp switches over ggml_type without a default,
so adding TURBO3_0 and TURBO4_0 to the enum made it incomplete (-Wswitch). Added
both to the unsupported branch.

Verified by replicating the CI job locally: -Werror, gfx908, ggml-hip target —
clean. Neither error was visible in the normal build, which uses gfx1201 and no
-Werror.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The job configured with only nvcc and cudart-dev, so CMake failed at
target_link_libraries: ggml-cuda links CUDA::cublas, which was not installed.

Configure-time failure, so it never reached the compile step this job exists for.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Two attempts at a minimal sub-package list failed: first CMake could not find
CUDA::cublas, then apt rejected the package names I added for it. A full install
takes longer but does not depend on names I cannot verify without running the job.

The CPU job of this workflow passes.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@Pascal-SAPUI5
Pascal-SAPUI5 merged commit 787132b into master Aug 10, 2026
27 of 44 checks passed
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