[GH-ISSUE #45] ptxas fails to parse generated PTX for mmq-instance-iq2_xxs.cu on CUDA 13.0 / sm_120 (non-deterministic) #23

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

Originally created by @pipeob0 on GitHub (Sep 28, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/45

ptxas fails to parse the PTX nvcc emits for mmq-instance-iq2_xxs.cu, non-deterministically

Building engine 0.1.13 from source on Windows, the new strata_mmq library fails on one instance:

ptxas C:\Users\<user>\AppData\Local\Temp\tmpxft_00001de4_00000000-7_mmq-instance-iq2_xxs.ptx,
      line 15064; fatal   : Parsing error near '%uint3iiiiiS8_S8_iiiS8_S8_iiiS8__param_4': syntax error
ptxas fatal   : Ptx assembly aborted due to errors

Environment: VS 2022 BuildTools, CUDA 13.0, -DCMAKE_CUDA_ARCHITECTURES=120, cmake --build build --target strata (Ninja, Release). All other mmq-instance-*.cu compiled; only IQ2_XS hit it.

It is not deterministic. Re-running the exact same cmake --build with nothing changed completed the file and linked strata.exe. A clean reconfigure also reproduced the failure. So a first-time source build can die on a file that builds fine on the second attempt, which reads like a broken commit rather than a toolchain issue.

The name ptxas chokes on (%uint3iiiiiS8_S8_...) is a generated kernel-parameter symbol, consistent with the __grid_constant__ gemm_param instance for IQ2_XS (dot2_args carrying int8 sub-arrays) producing malformed PTX.

Workarounds, in case it saves someone the confusion:

  • run cmake --build again (it gets past it here);
  • drop IQ2_XS from the foreach(_t ...) list in CMakeLists.txt if the pack does not need MMQ for it;
  • pin a different CUDA minor.

If you would rather not carry the risk, splitting the instantiation (two kernels per file) or replacing the __grid_constant__ parameter with a by-value struct for that type are the usual fixes. Reported mostly so the symptom is searchable: the failure mode is a parse error in generated PTX, which points at the toolchain, not at the source line it names.

Originally created by @pipeob0 on GitHub (Sep 28, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/45 `ptxas` fails to parse the PTX nvcc emits for `mmq-instance-iq2_xxs.cu`, non-deterministically Building engine 0.1.13 from source on Windows, the new `strata_mmq` library fails on one instance: ``` ptxas C:\Users\<user>\AppData\Local\Temp\tmpxft_00001de4_00000000-7_mmq-instance-iq2_xxs.ptx, line 15064; fatal : Parsing error near '%uint3iiiiiS8_S8_iiiS8_S8_iiiS8__param_4': syntax error ptxas fatal : Ptx assembly aborted due to errors ``` Environment: VS 2022 BuildTools, CUDA **13.0**, `-DCMAKE_CUDA_ARCHITECTURES=120`, `cmake --build build --target strata` (Ninja, Release). All other `mmq-instance-*.cu` compiled; only IQ2_XS hit it. **It is not deterministic.** Re-running the exact same `cmake --build` with nothing changed completed the file and linked `strata.exe`. A clean reconfigure also reproduced the failure. So a first-time source build can die on a file that builds fine on the second attempt, which reads like a broken commit rather than a toolchain issue. The name ptxas chokes on (`%uint3iiiiiS8_S8_...`) is a generated kernel-parameter symbol, consistent with the `__grid_constant__ gemm_param` instance for IQ2_XS (`dot2_args` carrying `int8` sub-arrays) producing malformed PTX. Workarounds, in case it saves someone the confusion: - run `cmake --build` again (it gets past it here); - drop IQ2_XS from the `foreach(_t ...)` list in `CMakeLists.txt` if the pack does not need MMQ for it; - pin a different CUDA minor. If you would rather not carry the risk, splitting the instantiation (two kernels per file) or replacing the `__grid_constant__` parameter with a by-value struct for that type are the usual fixes. Reported mostly so the symptom is searchable: the failure mode is a *parse* error in generated PTX, which points at the toolchain, not at the source line it names.
Author
Owner

@Niko1221 commented on GitHub (Sep 28, 2026):

Thanks for making it searchable. The MMQ instances are llama.cpp's own files compiled unchanged, and a rerun gets past it, so this is CUDA 13.0's ptxas (or something touching the temp file mid-build - antivirus scanners do that on Windows). 0.1.14's setup tries a failed build once more automatically; with a manual build, run cmake --build again. If the retry does not get past it for you, please reopen.

<!-- gh-comment-id:5867762860 --> @Niko1221 commented on GitHub (Sep 28, 2026): Thanks for making it searchable. The MMQ instances are llama.cpp's own files compiled unchanged, and a rerun gets past it, so this is CUDA 13.0's ptxas (or something touching the temp file mid-build - antivirus scanners do that on Windows). 0.1.14's setup tries a failed build once more automatically; with a manual build, run `cmake --build` again. If the retry does not get past it for you, please reopen.
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#23
No description provided.