Skip to content

nvcc throws a lot of warnings during build #1585

Closed as not planned
Closed as not planned

Description

@fukc-gihtub

It's probably worth fixing.

Some of them:

/llm/Strata/src/kernels/cuda/iq_kernels.cu(3229): warning #128-D: loop is not reachable
              for (int j = 0; j < cn; ++j) {
              ^
          detected during instantiation of "void strata::kernels::native_gu_lds_kernel<TG,SG,TI>(const unsigned long long *, const int32_t *, const int32_t *, const int32_t *, const block_q8_1 *, strata::kernels::NativeExpertLayout, float *, float *) [with TG=23, SG=1, TI=true]" at line 3528

/llm/Strata/src/kernels/cuda/iq_kernels.cu(3229): warning #128-D: loop is not reachable
              for (int j = 0; j < cn; ++j) {
              ^
          detected during instantiation of "void strata::kernels::native_gu_lds_kernel<TG,SG,TI>(const unsigned long long *, const int32_t *, const int32_t *, const int32_t *, const block_q8_1 *, strata::kernels::NativeExpertLayout, float *, float *) [with TG=22, SG=1, TI=true]" at line 3529

/llm/Strata/src/kernels/cuda/iq_kernels.cu(2844): warning #20058-D: the #pragma unroll must precede a loop
  #pragma unroll
          ^
          detected during instantiation of "void strata::kernels::native_gu_amd_kernel<TG,MODE>(const unsigned long long *, const int32_t *, const int32_t *, const int32_t *, const block_q8_1 *, strata::kernels::NativeExpertLayout, float *, float *) [with TG=16, MODE=1]" at line 3543

/llm/Strata/src/kernels/cuda/iq_kernels.cu(596): warning #177-D: function "strata::kernels::<unnamed>::Fmt<14>::dot" was declared but never referenced
                static float dot(const void* v, const block_q8_1* y, int kbx, int iqs) { return vec_dot_q6_K_q8_1(v, y, kbx, iqs); } };
                             ^

/llm/Strata/src/kernels/cuda/iq_kernels.cu(595): warning #177-D: member "strata::kernels::<unnamed>::Fmt<14>::qk" was declared but never referenced
  template<> struct Fmt<14> { static constexpr int qk = 256, ipb = (256 / (4*2)) / VDR_Q6_K, step = VDR_Q6_K;
                                                   ^

/llm/Strata/src/kernels/cuda/iq_kernels.cu(595): warning #177-D: member "strata::kernels::<unnamed>::Fmt<14>::ipb" was declared but never referenced
  template<> struct Fmt<14> { static constexpr int qk = 256, ipb = (256 / (4*2)) / VDR_Q6_K, step = VDR_Q6_K;
                                                             ^

/llm/Strata/src/kernels/cuda/iq_kernels.cu(595): warning #177-D: member "strata::kernels::<unnamed>::Fmt<14>::step" was declared but never referenced
  template<> struct Fmt<14> { static constexpr int qk = 256, ipb = (256 / (4*2)) / VDR_Q6_K, step = VDR_Q6_K;

Activity

  1. Niko1221 commented on Oct 13, 2026

    @Niko1221
    Owner

    Thanks for the report. To keep the tracker current we are closing issues older than three days: 0.1.44 is out with a long list of fixes, and many older reports are covered by it or by 0.1.43.1.

    If this still happens on 0.1.44, please leave a comment here with your engine log (and the version line it prints), and we will reopen it. A new issue that links this one works too.

  2. ackalker commented on Nov 3, 2026

    @ackalker

    Still open on main on 2026-11-03, and two of the cases look like more than cosmetic noise, so I am putting my log in this thread rather than opening a third report.

    What I ran. ./update.sh in a source checkout at commit ffa80d73 (Strata 0.2.10, engine 0.1.56, ggml pinned at ffa80d73), CUDA build (-DSTRATA_ENABLE_CUDA=ON, CMAKE_CUDA_ARCHITECTURES=120), RTX 5080 16 GB, 64 GB RAM, Fedora 44 (Workstation), gcc 16.2.1, cmake 4.4.3, ninja 1.13.2, nvcc release 13.4 V13.4.92 (/opt/cuda). The build finished and the engine links; nothing failed.

    Counts, today's run. 245 nvcc warnings and 12 gcc warnings.

    nvcc, by code:

    • #128-D: loop is not reachable — 208. By site: src/kernels/cuda/native_mmvq.cu(1329) 147, src/kernels/cuda/native_bf16.cu(287) 32, src/kernels/cuda/fused_gr.cu(926) 16, then iq_kernels.cu at 5968 (5), 4041, 3960, 3823, 3712 and dflash2.cu(344).
    • #177-D: declared but never referenced — 22 (fused_gr.cu 650 twice, 749, 1290 dot8v, 1537 qfuse_hc_local; gdn.cu(35) softplus_f; gr.cu(112) block_sum; iq_kernels.cu(6845) w2_h2; and others).
    • #611-D: overloaded virtual function … only partially overridden — 4 (two sites, each printed twice): include/strata/core/expert_source.hpp(710) FileExpertSource, (1261) ArenaExpertSource, both about ExpertSource::prefetch.
    • #20280-D: … must have a definition in the current translation unit — 4 (s2_expert_grouped.cu 847, 911, 986, 1098).
    • #550-D: variable was set but never used — 3 (dflash2.cu(775) win, qsa_select.cu(2458) x, q36_engine.cu(1648) v).
    • #20199-D: unrecognized #pragma in device code — 2 (verify_kernels.cu(305), iq_kernels.cu(3840)).
    • #63-D: shift count is too large — 1 (qsa_select.cu(2501)).
    • #20058-D: the #pragma unroll must precede a loop — 1 (iq_kernels.cu(5583)).

    gcc: 3 × -Wmisleading-indentation ("this 'if' clause does not guard…") at src/core/layer.cpp:561:1, :1215:5, :1651:1; 9 × -Wunused-variable: n_kv src/core/layer.cpp:1144:385, hcd :1501:23, f src/core/verify.cpp:3728:20, ssq src/prefill/prefill.cpp:6701:29, multi :6622:16, lay src/program/generate.cpp:7755:21, :7781:21, :7872:29, w :14683:30.

    Two of these are not just noise. I checked them by reading the code and, for the first one, by disassembling the object this build produced; both have their own issues now:

    • [Engine] nvcc ignores #pragma clang fp contract(off), so native_moe.cu gates the shared expert with a contracted multiply #5100 — #pragma clang fp contract(off) is not understood by nvcc, so three CUDA sites that say in a comment that the product must be rounded on its own get it contracted into an FMA. In the object from this build, src/kernels/cuda/native_moe.cu.o, combine<true,true> ends the gated shared-expert loop with FFMA.FTZ R35, R4, R10, R35 — the shared-expert value multiplied by the gate and added to the accumulator in one instruction, instead of a rounded multiply and then an add. #20199-D is the warning that points straight at it.
    • [Engine] ExpertSource::prefetch has two overloads and each source overrides one, so the other call form is a silent no-op (#611-D) #5101 — the four #611-D. ExpertSource declares two prefetch overloads and each source overrides one: FileExpertSource only the batch form, ArenaExpertSource only the single-expert form. So the single-expert calls at src/program/generate.cpp:9104, :12585, :12600, :12984, :19919 do nothing when the file source is the active one (srcp = &src, generate.cpp:7203), and the batch call at src/core/expert_source.cpp:5122 does nothing when the arena source is (srcp = &arena_src, generate.cpp:7387). Static reading only — I measured no runtime cost.

    About the 208 #128-D, which is what this thread is really about. I think almost all of them are the fallback path after a constexpr branch that returns early, reported once per template instantiation. native_mmvq.cu:1309 is if constexpr (TS) { … return; } at :1326, so for the instantiations that take it, the loop at :1329 is unreachable; native_bf16.cu:274 if constexpr (BLOCK_SIZE > 32) returns at :277 and :284 before the loop at :287. That fits the counts: 147 from one site is one per instantiation. So the warning is not saying that a computation is skipped at run time — the branch was never compiled in for that instantiation. If that reading is right, the way to quiet 208 of the 245 without hiding anything real is the if constexpr tail (or #pragma nv_diag_suppress 128 around those blocks); the #63-D shift and the two #20199-D are the ones I would look at first by hand.

    I have no measurement of speed or output differences from any of this, and none of the 245 warnings was a build failure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions