Skip to content

cuda: guard PDL can-use check on pre-Hopper devices (fix sm_86 crash)#32

Closed
ddvnguyen wants to merge 1 commit into
hydra-forkfrom
claude/ggml-cuda-pdl-rebase-vuj4ib
Closed

cuda: guard PDL can-use check on pre-Hopper devices (fix sm_86 crash)#32
ddvnguyen wants to merge 1 commit into
hydra-forkfrom
claude/ggml-cuda-pdl-rebase-vuj4ib

Conversation

@ddvnguyen

Copy link
Copy Markdown
Owner

Overview

ggml_cuda_kernel_can_use_pdl() (ggml/src/ggml-cuda/common.cuh) called cudaFuncGetAttributes() on every device before checking attr.ptxVersion >= 90. On sm_86 (RTX 3060) + CUDA 13.2 that query faults for the PDL-carrying flash-attn kernels, and CUDA_CHECK escalates the error into a GGML_ABORT — crashing rpc-server on the 3060 peer.

This is the GGML_CUDA_PDL crash tracked in PR #31's live-hardware notes ("rpc-server crashes on 3060 with PDL check"), and it is the blocker that forces COMBINE onto the --rpc-engine add-backend-after-load path (→ the 35-split perf gap) instead of the clean native --rpc register-before-load path.

Fix

Gate on device compute capability before the cudaFuncGetAttributes query and cache a permanent false for cc < GGML_CUDA_CC_HOPPER. Pre-Hopper GPUs never emit PDL device-side primitives (ggml_cuda_pdl_sync/_lc are compiled out for arch < Hopper), so the query is pointless there anyway. Hopper/Blackwell (including sm_120 / the 5060 Ti) are unaffected — they still run the full PTX-version check.

Additional information

  • Root cause and hardware repro documented in ddvnguyen/llama.cpp#31 (comments of 2026-07-06).
  • Unblocks the native --rpc register-before-load architecture that PR fork: resolve #376 — make COMBINE mode RPC work (gate-then-degrade) #31 needs to collapse the 35+ graph-split regression.
  • ⚠️ Not compiled in the authoring environment (no CUDA / sm_86 host). Needs a hardware build to confirm the crash is gone: cmake --build build_sm86_sm120 --target llama-engine, then run rpc-server on the 3060 and exercise a flash-attn graph.

Requirements

  • I have read and agree with the contributing guidelines
  • AI usage disclosure: YES — change drafted by an AI agent (Claude Code) from the PR fork: resolve #376 — make COMBINE mode RPC work (gate-then-degrade) #31 crash analysis; author is responsible for reviewing, building, and hardware-verifying before merge. This project restricts AI-generated content — see AGENTS.md and CONTRIBUTING.md.

Generated by Claude Code

ggml_cuda_kernel_can_use_pdl() called cudaFuncGetAttributes() on every
device. On sm_86 (RTX 3060) + CUDA 13.2 that query faults for PDL-carrying
flash-attn kernels, and CUDA_CHECK escalates it to GGML_ABORT — crashing
rpc-server and blocking the native --rpc COMBINE path.

Pre-Hopper GPUs never emit PDL device-side primitives (ggml_cuda_pdl_sync/_lc
are compiled out for arch < Hopper), so the query is pointless there. Gate on
device compute capability before the query and cache a permanent false for
cc < Hopper. Hopper/Blackwell (incl. sm_120) are unaffected.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012d7PtURptwKpgMcFZ2MvYn

Copy link
Copy Markdown
Owner Author

Closing — this guard rests on a misdiagnosis.

Spike hydra_vortex#381 ran the --rpc + --tensor-split path with rpc-server on the 3060 (sm_86), -fa 1, on fork 8d18d1b12 — which already contained the full PDL subsystem (git show 8d18d1b:ggml/src/ggml-cuda/common.cuh has the identical PDL block). Flash-attn ran on ~5 attention layers on the 3060 and it worked (620 prefill / 20.3 decode, no crash). Since the main flash-attn kernel launches through ggml_cuda_kernel_launchggml_cuda_kernel_can_use_pdlcudaFuncGetAttributes (fattn-common.cuh:1207), spike ggml-org#381 is empirical proof that cudaFuncGetAttributes on sm_86 does not fault.

So there is no PDL crash to fix here. And pre-Hopper already returns false via the existing attr.ptxVersion >= 90 check, making this guard behaviorally inert. PR #31's "rpc-server crashes on 3060 with PDL check" is a misdiagnosis — the real COMBINE blocker is -ot/expert-split recurrent-layer state corruption plus add-RPC-after-load graph splits, both addressed by the layer-split path (ggml-org#383). Superseded by that work.


Generated by Claude Code

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.

2 participants