mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
[PR #2492] [Engine] add opt-in gfx12 grid padding for selected decode matvecs #4075
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#4075
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/2492
Author: @i-Vladimir-i
Created: 10/14/2026
Status: 🔄 Open
Base:
main← Head:grid-pad📝 Commits (1)
9273f1b[Codex]: add opt-in gfx12 grid padding for decode matvecs📊 Changes
6 files changed (+179 additions, -12 deletions)
View changed files
📝
CMakeLists.txt(+3 -0)📝
docs/AMD_HIP.md(+9 -0)➕
include/strata/kernels/grid_pad.hpp(+81 -0)📝
src/kernels/cuda/native_bf16.cu(+5 -2)📝
src/kernels/cuda/native_mmvq.cu(+31 -10)➕
src/kernels/grid_pad_test.cpp(+50 -0)📄 Description
Problem and result
Selected T=1 decode matvec launches on gfx12 stall near full-die wave-slot boundaries.
STRATA_GRID_PAD=1adds empty workgroups that return before indexing output rows.Padding remains off by default; T>1, CUDA and non-gfx12 launch geometry is unchanged.
Related discussion
This refreshes the existing #2492, without VMM, ISA, copy-stream or MCP changes.
The current wave MMVQ path can bypass padded fallbacks, so default-wave and explicit
STRATA_MMVQ_WAVE=0controls are reported separately.Approach
Use a per-device gfx12 geometry check and a bounded padding rule for the selected
single-token launchers. Extra blocks return before signed row indexing. Host tests
cover stall boundaries, no-op multi-token cases, overflow bounds and idempotence.
Validation
Linux AMD Radeon AI PRO R9700/gfx1201; official GGML
3cf03257f219afbe7334045ff7c6a06ac68c627d.Tested base
9f7d977d220e9fdf2ec53cf2620cdadac1cfb24e, candidate tree398c5ffedbe7162a7d8eb54f747e45c5b903463e.Published base
54828c7eonly adds eight sponsor README files; the tested feature diffis byte-identical, SHA256
5db2f0beca7cec0bd5184f29760cc5752144f9d29cf5f5ab7d8a8d0b03b34f4b.The separate evidence package records command arrays and all individual measurements.
Passed:
CPU/HIP/CUDA/SYCL builds for main and candidate. Server suite on each:
python -B -m unittest discover -s serve -p 'test_*.py' -v, 1450 tests/17 skips, exit 0.Qualified CPU CTest: main 88 passed/5 skipped; candidate 89/5. Full HIP CTest:
main 211 passed/13 skipped, candidate 212/13, exit 0; numeric PLE/stock MMQ included.
ctest --test-dir "$QUALIFIED_DIR" --output-on-failure --timeout 180 -j1 --output-junit "$XML". Test-only ISA/copy/PLE supports and four scratch redirectsare disclosed separately; no support patch enters this feature diff.
24 numeric comparisons against main: unset/0/1 padding, default wave/fallback,
TSUM0/1 and EXACT0/1. Output inventory, finite/nonzero/sentinel checks and equality pass.
120 synthetic timing rows, three interleaved process repeats and five raw samples
per process. Selected T=1 medians, padding0→1, microseconds:
Independent readback exit 0; all owned windows restored, health ok/loaded,
source/native/production invariants unchanged. Whitespace check exit 0, added lines ≤118.
Failed:
qualification passes. Initial read-only fixture-path and CRLF evidence-export
harness failures are retained; the qualified readback did not replay GPU tests.
default-wave/−1.81% fallback, including unchanged T>1 controls. All individual
repeats and variability are retained; these ranges are not confidence intervals.
Not run:
Local Metal build/runtime; NVIDIA, Intel Arc and Windows hardware execution;
whole-model token throughput or latency improvement; other gfx12 cards.
Limits
The measurements are synthetic kernels on one R9700. They do not establish an
end-to-end model speedup or justify enabling padding by default. The previous public
Metal CI ran on an older head. This updated head has its own build/link result below.
Published candidate and evidence
Head
9273f1bb04e5173b03826aae0ffd19b69a472f0f, parent54828c7efbcdf9474697e70922d851f6707f4b32.Reconstruct the SHA256-verified evidence ZIP.
ZIP SHA256:
4f795ed12c1091b6d9394c6e4e0935a1e19684d389fb8fa120abee8d9a7b8756. All three public raw files and decoded ZIP were read back exactly.CI on the updated head
Head
9273f1bb04e5173b03826aae0ffd19b69a472f0f.Metal CI compiled and linked the engine. It did not execute Metal inference or establish runtime GPU-kernel compilation/correctness. Local Metal hardware and the other Not run items above remain unavailable/unverified.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.