[GH-ISSUE #4266] [Engine] TQ MMQ overlay fails to build against current upstream GGML (loader x_gate parameter) #1876

Closed
opened 2026-11-04 01:54:57 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @Tsury on GitHub (Oct 26, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/4266

Follow-up to #3217. With a current upstream GGML through STRATA_GGML_DIR, the trellis MMQ overlay passes its configure-time anchor checks but the CUDA build fails. The overlay's TQ loader no longer matches upstream's loader type.

Environment: Strata v0.2.6 4b9e05a2 (engine 0.1.51), upstream llama.cpp b11910 63b4b303, Linux, CUDA 13.4, SM120. This is an override-compatibility report; the pinned 3cf03257 default is not affected. No weights are needed to reach the error.

Cause

llama.cpp c49edf096 ("CUDA: fuse FFN gate/up matmuls and GLU in MMQ with interleaved gate/up rows", ggml-org/llama.cpp#29948) added a gate pointer to the loader type in ggml/src/ggml-cuda/mmq.cuh:

typedef void (*ggml_cuda_mmq_load_tiles_t)(const char * __restrict__ x, const char * __restrict__ x_gate, int * x_tile,
    const int kbx0, const int i_max, const int stride);

Every upstream loader now takes x_gate (for example ggml_cuda_mmq_load_tiles_iq2_xs ignores it with GGML_UNUSED(x_gate)). Strata's ggml_cuda_mmq_load_tiles_tq in third_party/ggml-tq/tq-mmq-tiles.cuh still has the old five-parameter form, so the two TQ cases that cmake/strata_ggml_tq_overlay.cmake inserts into ggml_cuda_mmq_get_util_funcs cannot build a ggml_cuda_mmq_util_funcs.

Error

The first target that instantiates the overlay is src/prefill/mmq_nvfp4_w4a8.cu (64 errors of one kind):

build/ggml-tq-overlay/mmq.cuh(685): error: no instance of constructor "ggml_cuda_mmq_util_funcs::ggml_cuda_mmq_util_funcs" matches the argument list
            argument types are: (int, <unknown-type>, <unknown-type>, <unknown-type>)
  ... argument #2 does not match parameter

Lines 685 and 863 of the generated mmq.cuh are the inserted GGML_TYPE_TQ2_T/TQK6/TQK7 cases (DP4A and MMA layouts).

Suggested fix

Give the TQ loader the gate parameter when the tree's loader type has it, and ignore it as upstream does. The overlay script already detects the precision signature (_sig_new/_sig_old); the same check on const char * __restrict__ x_gate in the ggml_cuda_mmq_load_tiles_t typedef could select the signature. Alternatively, the anchor check could include the loader typedef so that an unknown tree turns the overlay off with its normal message instead of failing the build.

Workaround

-DSTRATA_MMQ_TQ_OVERLAY=OFF builds and runs normally for non-trellis models (verified here with Qwen3.8 Flash-Next IQ3_S; trellis prompts then use the FP16 path, as the option describes).

Originally created by @Tsury on GitHub (Oct 26, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/4266 Follow-up to #3217. With a current upstream GGML through `STRATA_GGML_DIR`, the trellis MMQ overlay passes its configure-time anchor checks but the CUDA build fails. The overlay's TQ loader no longer matches upstream's loader type. Environment: Strata v0.2.6 `4b9e05a2` (engine 0.1.51), upstream llama.cpp b11910 `63b4b303`, Linux, CUDA 13.4, SM120. This is an override-compatibility report; the pinned `3cf03257` default is not affected. No weights are needed to reach the error. ## Cause llama.cpp c49edf096 ("CUDA: fuse FFN gate/up matmuls and GLU in MMQ with interleaved gate/up rows", ggml-org/llama.cpp#29948) added a gate pointer to the loader type in `ggml/src/ggml-cuda/mmq.cuh`: ```cpp typedef void (*ggml_cuda_mmq_load_tiles_t)(const char * __restrict__ x, const char * __restrict__ x_gate, int * x_tile, const int kbx0, const int i_max, const int stride); ``` Every upstream loader now takes `x_gate` (for example `ggml_cuda_mmq_load_tiles_iq2_xs` ignores it with `GGML_UNUSED(x_gate)`). Strata's `ggml_cuda_mmq_load_tiles_tq` in `third_party/ggml-tq/tq-mmq-tiles.cuh` still has the old five-parameter form, so the two TQ cases that `cmake/strata_ggml_tq_overlay.cmake` inserts into `ggml_cuda_mmq_get_util_funcs` cannot build a `ggml_cuda_mmq_util_funcs`. ## Error The first target that instantiates the overlay is `src/prefill/mmq_nvfp4_w4a8.cu` (64 errors of one kind): ```text build/ggml-tq-overlay/mmq.cuh(685): error: no instance of constructor "ggml_cuda_mmq_util_funcs::ggml_cuda_mmq_util_funcs" matches the argument list argument types are: (int, <unknown-type>, <unknown-type>, <unknown-type>) ... argument #2 does not match parameter ``` Lines 685 and 863 of the generated `mmq.cuh` are the inserted `GGML_TYPE_TQ2_T/TQK6/TQK7` cases (DP4A and MMA layouts). ## Suggested fix Give the TQ loader the gate parameter when the tree's loader type has it, and ignore it as upstream does. The overlay script already detects the precision signature (`_sig_new`/`_sig_old`); the same check on `const char * __restrict__ x_gate` in the `ggml_cuda_mmq_load_tiles_t` typedef could select the signature. Alternatively, the anchor check could include the loader typedef so that an unknown tree turns the overlay off with its normal message instead of failing the build. ## Workaround `-DSTRATA_MMQ_TQ_OVERLAY=OFF` builds and runs normally for non-trellis models (verified here with Qwen3.8 Flash-Next IQ3_S; trellis prompts then use the FP16 path, as the option describes).
Author
Owner

@Niko1221 commented on GitHub (Nov 5, 2026):

Thanks for taking the time to report this.

Strata has changed a lot since this was opened, and 0.2.11 is out now, so many older reports no longer apply. We're closing issues older than a week that have had no new reports in the last week. Closed here does not mean rejected.

To reopen it takes about two minutes:

  1. Re-test on 0.2.11. It may already be fixed. Write down what you see.
  2. Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other].
  3. Fill in the parts of the issue form: what happened, the Strata version, your graphics card, memory and system.
  4. Comment /reopen. A check runs and either reopens the issue or lists what is still missing.

The rules are in CONTRIBUTING.md.

<!-- gh-comment-id:6660179584 --> @Niko1221 commented on GitHub (Nov 5, 2026): Thanks for taking the time to report this. Strata has changed a lot since this was opened, and 0.2.11 is out now, so many older reports no longer apply. We're closing issues older than a week that have had no new reports in the last week. Closed here does not mean rejected. To reopen it takes about two minutes: 1. Re-test on 0.2.11. It may already be fixed. Write down what you see. 2. Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other]. 3. Fill in the parts of the issue form: what happened, the Strata version, your graphics card, memory and system. 4. Comment `/reopen`. A check runs and either reopens the issue or lists what is still missing. The rules are in [CONTRIBUTING.md](https://github.com/Niko1221/Strata/blob/main/CONTRIBUTING.md).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#1876
No description provided.