feat: GPU ternary decode + wire GPU into --student infer#70
Merged
Conversation
New: forward_decode_gpu() — GPU-accelerated decode with KV cache. - Q/K/V/O projections via gpu_ternary_matmul WGSL kernel - MoE expert gate/up/down via GPU ternary matmul - Router, attention scores, PLE, KV cache stay on CPU - LM head stays on CPU (too large for iGPU buffers) Wire GPU into cmd_infer --student path: - Initialize GpuMatmulAccelerator in student inference path - Create DispatchPlan from device profile - generate_student now accepts GPU + dispatch params - Decode uses forward_decode_gpu when GPU available, CPU fallback - Prefill stays on CPU (must populate KV cache for decode) This gives GPU-accelerated decode on capable hardware while maintaining full CPU fallback for RPi and other edge devices.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GPU-accelerated student inference
New:
forward_decode_gpu()Single-token decode using GPU ternary matmul with CPU KV cache:
gpu_ternary_matmulWGSL kernelWire GPU into
cmd_infer --studentGpuMatmulAcceleratorin student inference pathDispatchPlanfrom device profilegenerate_student()accepts GPU + dispatch paramsforward_decode_gpuwhen GPU availableRemaining GPU work