mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #1279] [CLOSED] perf(cuda): use exact GP100 VMAD for native DP4A emulation #3355
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#3355
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/1279
Author: @bschrib
Created: 10/6/2026
Status: ❌ Closed
Base:
main← Head:perf/p100-vmad-dp4a📝 Commits (3)
d33ec7dP100-NODE: use exact GP100 VMAD for native DP4A emulation2c2ea72P100-NODE: document extended-context VMAD evidence and compile checksbe39de1P100-NODE: add exact diagnostic-twin API parity evidence📊 Changes
13 files changed (+1483 additions, -3 deletions)
View changed files
📝
AGENTS.md(+2 -0)📝
README.md(+2 -0)➕
bench/results/p100-vmad-2026-10-06.json(+263 -0)➕
bench/results/p100-vmad-correctness-2026-10-06.json(+505 -0)➕
bench/results/p100-vmad-extended128k-2026-10-06.json(+335 -0)📝
docs/OLDER_GPUS.md(+1 -1)➕
docs/P100_VMAD.md(+85 -0)📝
include/strata/kernels/dp4a.hpp(+20 -2)➕
tests/p100/dp4a_cases.hpp(+60 -0)➕
tests/p100/dp4a_compile_probe.cu(+17 -0)➕
tests/p100/dp4a_cuda.cu(+105 -0)➕
tests/p100/dp4a_model.cpp(+42 -0)➕
tests/p100/verify_offline.py(+46 -0)📄 Description
Tesla P100's sm_60 native DP4A fallback extracts and multiplies four signed bytes in scalar code. This uses four exact integer VMAD operations on GP100. Other CUDA architectures and HIP retain their existing source paths. The pinned llama.cpp MMQ helper is unchanged.
The original optimization idea and P100 work belong to shinbunbun, specifically llama-cpp-p100-patches patch 01. This submission adapts that idea to Strata, adds a scoped accumulator to avoid output/input register aliasing, and supplies focused tests and Strata measurements. The original MIT notice is retained.
Validation:
Measurements used pinned Strata v0.1.39 on two PCIe P100 16 GB cards at Gen3 x8/x8, Ryzen 7900X, Ubuntu 24.04.5, R580 and CUDA 12.9.86. Both arms used 128K context, INT8 KV with 32K resident, split25/23, MTP spec4 and zero prompt-cache reuse. This PR targets newer main with the same pristine DP4A header; the full current-main engine was not built or benchmarked. Its header passed separate CUDA compile-only probes.
Eight API prompt pairs passed full 248,320-value first-position bitwise logit parity and matching text/reasoning/usage. These checks used separately identified diagnostic twins with identical API instrumentation, relinked with unchanged original kernel libraries. The existing standalone dump hook does not cover the API; the rejected missing-dump attempt is retained separately. This does not establish every generated-position logit or general quantization quality. Instantaneous power excursions above configured/enforced200W are retained in the evidence.
Mechanism, commands, limits, source/build/model identities and raw timing rows are in docs/P100_VMAD.md and its linked benchmark JSON files. The original pristine node baseline remains archived and unchanged.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.