feat: implementing vulkan backend#557
Conversation
…ize, add TRANSIENT_BIT - Rotate through 4 command buffers with pool cleanup every 4 submissions (matching llama.cpp's ggml_vk_command_pool_cleanup pattern) - Cap weight descriptor buffer range to expected tensor size instead of using remaining span bytes - Add VK_COMMAND_POOL_CREATE_TRANSIENT_BIT to pool creation flags Prefill (25 tokens x 43 layers) works. Decode still crashes RADV at radv_amdgpu_cs_finalize — root cause still unknown.
Skill updated with full debugging traceUpdated the
|
Skill updatedI have updated the
Download updated skill archive Note: the prefill GPU path works end-to-end. The decode still crashes RADV. The root cause is likely a Vulkan state detail that still differs from llama.cpp — any help debugging the |
|
Latest efforts report The core problem is that ./ds4 --vulkan hangs after printing "CUDA using managed KV cache" — this is during ds4_session_create → metal_graph_alloc_raw_cap (tensor allocation) completes fine, then ds4_session_sync → metal_graph_prefill_layer_major → ds4_gpu_end_commands (submit_and_wait) hangs on GPU dispatch. Key Findings
Even the clean HEAD commit (5f285d0) — which previously produced working output at 0.42 t/s — now also hangs with the same behavior. ✅ Basic Vulkan device creation/queue/submission works (tested via standalone C program). With debug instrumentation, the hang occurs at different layers on different runs (layer 18, layer 20, layer 25, etc.) — classic sign of memory corruption / undefined behavior. Weight cache loading (80.76 GiB of tensor spans in ~25s) The final vkQueueSubmit + vkWaitForFences blocks forever Pending Work GPU MoE shaders — blocked by the GPU hang |
Trying to solve #237 and #476.
Being extremely honest, I don't have the knowledge to contribute to such a big feature, so I've invested 20 CNY and tried to make it work using cloud DeepSeek v4 flash + hermes.
542674649 tokens and some hours of inference later, I got the changes in this branch.
It's not working yet; the model is being loaded into memory, but inference is falling into a segmentation fault. ssd-streaming is also failing.
I don't know if any of what Hermes did is valuable, but I hope something is. I'll try to proceed later, studying and proceeding, trying to make it work, but right now, this is as far as I can get.
Here's also the skill Hermes generated during the process.
vulkan-compute-backend-porting.zip.
If this code is on the right path, I'd appreciate some help with it