Repository navigation
Fix build errors on NVCC and under -Werror, add fork CI - #3
Merged
Merged
Conversation
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>
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.
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.cuhusesstd::conditionalandstd::is_samefive times, but neither it norcommon.cuhincludes the header (common.cuhonly 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_kcomputesidx / JPandidx % JP. The trailing block instantiates it withJ = 0, soJP = 0. The loop never runs, but the compiler evaluates the divisions at compile time and rejects them under-Werror. Thestatic_assertguarded the condition; the code did not.Incomplete switch —
ggml_compute_forward_clampswitches overggml_typewithout adefault, so addingTURBO3_0/TURBO4_0to the enum made it incomplete (-Wswitch), which is fatal under-Werror.All three were invisible locally: the development build uses HIP with
gfx1201and no-Werror. They were found by this fork'sHIP quality check, which uses-Werrorandgfx908. 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; keptCI,HIP quality check, sanitize, server and the python linters.Added
turboquant-ci.ymlwith two jobs: a CPU build runningtest-turboquantandtest-backend-ops, and a CUDA compile check of theggml-cudatarget. 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