What problem does it solve?
Optimizing LLM inference on RISC-V CPUs requires navigating layered implementations (generic CPU, standard RVV, vendor ISA like SpacemiT IME2), low-bit quantized GEMM/GEMV kernels, and remote board validation, where mistakes in pack layout, signedness, or threading silently break correctness or waste performance.
Core Features & Use Cases
- Layered kernel design workflow: Separates generic CPU, standard RVV, and vendor-specific targets so vendor instructions, TCM usage, and shape gating stay isolated with a working RVV fallback.
- Correctness-first methodology: Builds scalar oracles, per-block quantization checks, and A/B comparisons before touching pack, kernel, threading, or TCM pipelines.
- Prefill and decode tuning: Applies distinct strategies for prefill (data reuse, matrix unit utilization) and decode (weight traffic, dispatch overhead, effective bandwidth roofline).
- Remote board validation: Covers SSH-based cross-compilation, build matrices (vendor ON vs pure RVV OFF), llm_bench benchmarking, and sanitized performance reporting.
- Use Case: When a W4B64 quantized model decodes slowly on a SpacemiT board, use this Skill to profile the hot path, implement an IME2 GEMV kernel with correct zero-point correction, and validate tokens/s gains on the target hardware.
Quick Start
Use the riscv-cpu-optimize skill to analyze and optimize the decode performance of my quantized LLM running on a RISC-V board with RVV support.