Skip to content

feat(gemv): finite-dispatch Volcanic Vulkan quantized GEMV kernels (#9) - #11

Closed
saariuslystoned wants to merge 3 commits into
mainfrom
feat/9-finite-dispatch-vulkan-gemv
Closed

saariuslystoned wants to merge 3 commits into
mainfrom
feat/9-finite-dispatch-vulkan-gemv

Conversation

@saariuslystoned

Copy link
Copy Markdown
Contributor

Closes #9 (host implementation, capability gating, VK_ERROR_DEVICE_LOST recovery, shaders, tests, and device-lane benchmark harness).

Summary

  • Clean-room finite-dispatch GLSL 4.60 Q8_0 GEMV shaders (kernels/gemv/shaders/gemv_q8_0_baseline.comp & gemv_q8_0_volcanic.comp): zero persistent workgroup loops, zero cross-workgroup spin-wait rendezvous, zero atomics; Volcanic variant uses 128-wide subgroupAdd reduction with explicit inter-slice vkCmdPipelineBarrier.
  • Runtime capability gate, finite slice planner (<5–8ms budget), and VK_ERROR_DEVICE_LOST state machine (kernels/gemv/include/gemv_runtime.hpp): gates on subgroup properties, subgroup size control, buffer device address (4-byte alignment), and integer-dot support; falls back cleanly to portable baseline when any capability is absent or on device loss.
  • Device benchmark runner & schema (kernels/gemv/bench/gemv_bench.cpp, BENCH_RECEIPT_SCHEMA.json) ready for the dedicated device lane to capture the 3×10-minute stock Android OTA qualification receipts.
  • CI & Verification (.github/workflows/ci.yml, kernels/gemv/tests/gemv_runtime_test.cpp, tests/test_gemv_finite_dispatch.py, kernels/gemv/PROOF.md).

Verification

  • glslangValidator -V --target-env vulkan1.2 + spirv-val --target-env vulkan1.2 + spirv-dis barrier/atomic scan: PASS (0 barriers/atomics).
  • c++ -std=c++17 -O1 -g -fsanitize=address,undefined -Wall -Wextra -Werror: PASS.
  • python3 -m unittest discover -s tests -v: 19/19 OK.
  • python3 -m unittest discover -s freepvr-twin/tests -v: 25/25 OK.
  • ./scripts/clean-room-audit.sh: PASS (0 violations across 73 files).
  • See kernels/gemv/PROOF.md for host-verified vs. pending live Android OTA hardware qualification details.

@saariuslystoned

Copy link
Copy Markdown
Contributor Author

Adversarial Hardening & Public-Roads Audit Receipt (8966b34d)

  • Prior PR head: 76f0a476 → Hardened head: 8966b34d
  • 4 bugs fixed: UBSan float-cast-overflow, invalid vkCmdDispatch >65,535 workgroups (capped via kMaxGuaranteedWorkgroups), DeviceLostSession::Finish() stale checkpoint leak, --seconds nan infinite loop & strtoul trailing garbage + strict truncated fixture rejection.
  • Verification: glslangValidator + spirv-val (vulkan1.2), ASan+UBSan gemv_runtime_test, 15/15 GEMV + 25/25 twin unit tests, ./scripts/clean-room-audit.sh (73 files) PASS.

@saariuslystoned

Copy link
Copy Markdown
Contributor Author

Closing: superseded — freesilicon/mesa#2 already beats stock Android on Volcanic via standard FP16 F16X2 llama.cpp compute; freepvr stays focused on specs, validators, and probes.

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.

Finite-dispatch Volcanic Vulkan quantized GEMV kernels — no persistent cross-WG spinlocks

1 participant