Repository navigation
lab: port the original selected Q4_K walk through HIP wave32 - #252
Conversation
4c35e4f to
0d534cd
Compare
Rebase only the selected follow-up after merged midagedev#248. All nine extracted bodies, the selected entry, and the two scalar oracle entry bodies are unchanged from the arithmetic baseline; only unrelated core helpers changed. Build, lint, tests and GPU verification intentionally unrun for coordinated final verification.
0d534cd to
b3774b8
Compare
There was a problem hiding this comment.
Verdict: MUST_FIX: The new upload helper duplicates the typed host-to-device transfer owner.
Must fix
1. Reuse overwrite for initial uploads
labs/hip-native/host/src/selected.rs:85 repeats labs/hip-native/host/src/selected.rs:95: the same typed source, byte span, transfer direction and error propagation. This is a kind B duplication under R14.
Reuse removes an unsafe copy site and its repeated invariant now, without adding an owner. Replace upload with:
fn upload<T: Copy>(context: &mut Context, values: &[T]) -> Result<*mut c_void, String> {
let ptr = context.alloc(std::mem::size_of_val(values))?;
overwrite(context, ptr, values)?;
Ok(ptr)
}Non-blocking
⚠ Record FAIL-first evidence: labs/hip-native/device/src/selected.rs:113. The body reports passing runs but no failing mutant run for the new contracts. Temporarily replace id != u32::MAX with true; the isolated HOST case must fail. Record that failure and the restored pass while this change is under review.
Checked
Duplicates: upload and overwrite repeat the same typed transfer; the proposed fix reuses overwrite.
Complexity: new case = 52 combines setup, selection runs and fault checks; new Plan::validate = 22 checks dimensions and spans. run rises 14 → 16 through two fallible calls.
Silent failure: 3 refusal paths followed. Source drift panics, invalid expert ids raise faults, and refused activation scales propagate NaN to an explicit check.
Tests: static inspection confirms short-span assertions reject dropped span checks. Removing the HOST exemption reaches the unexpected-fault rejection at host/src/selected.rs:343. GPU tests were not run here.
Gates: NMSE remains 1e-6; bitwise, sentinel and fault checks are added. No existing pins moved.
Escape catalog: no matching patterns.
Notes
dryer did not run because no changed Rust file is under crates/.
The linked GPU result and logs are outside the supplied trees and were not inspected.
🔨 Shingler, bloomery's review bot: approves a clean pull request and requests changes on a must-fix (how it works)
There was a problem hiding this comment.
Since the last review:
- Must-fix 1 fixed: labs/hip-native/host/src/selected.rs:87 reuses
overwrite.
Verdict: CLEAN: The incremental change removes the duplicate transfer and preserves its behavior.
Checked
Duplicates: 0 new items; the transfer now has one owner. No dryer pairs were supplied.
Complexity: diagnostic flags concern unchanged functions; this diff adds no branches.
Silent failure: 2 fallible calls followed; allocation, copy and synchronization errors propagate. Empty uploads still return the named zero-allocation error; failed uploads remain owned by Context.
Tests: no tests or assertions changed. No build or GPU tests were run.
Gates: no bands, pins or assertions changed.
Escape catalog: no matching patterns. Only standalone lab setup changed; no engine hot path changed.
Notes
dryer did not run because no changed Rust file is under crates/.
The linked GPU result and logs are outside the supplied trees and were not inspected. The body identifies source b3774b8, not the current head.
🔨 Shingler, bloomery's review bot: approves a clean pull request and requests changes on a must-fix (how it works)
|
@Burntgogi Thanks for the contribution. The review is done, so I'm merging this. |
What and why
Selected Q4_K down-row walk through the existing excluded AMD HIP contributor lab. Parent #248 is merged. This PR merged source
eaa04a5e1ce69347f3a78569c9c2052eb5d2e337ase195c9e6af40372d56543c779f52222e3cf5955ewhile the subsequent current-main validation was running.The lab extracts nine original functions from pinned
crates/gpu/src/cores.rsat build time and refuses source drift. The HIP shim preserves packed Q8 planes, row/slot addressing, 256-thread blocks with logical warp32 reduction, original FMA order, HOST skips, sticky earliest-layer faults and per-layer masks. Existing qdot scalar routines prepare activations and provide the oracle. No engine/CUDA kernels or numerical bands changed.Review correction:
uploadallocates once and reuses the existing fallibleoverwritetransfer/synchronization owner; the duplicate copy path is removed.Merged-head and subsequent rebased validation evidence
The merged head
eaa04a5passes all 7 verifier checks/18 actual GPU cases, including the restored control linked below. Separately, the subsequent branch on maincca9bea, source3395e11d3c8e5f8a90dde16b1459883f54b953d5, tree6df2410d1a35442f17fd0c3207e7187dc520cf72, also passes all 7/18 in a clean checkout.3395e11is not the PR's merged head. Hardware: RX7900GRE / gfx1100 / wave32; HIP runtime and driver70253210.9251b422a700bf27bf47512068c93f88d029dc6eba32ed516dbc067842b570ce. No weights uploaded.eaa04a5passes all 7 checks/18 cases again; the final rebased3395e11independently passes all 7/18.Final exact-head result and all verifier logs · HOST mutant result/log/patch · restored control.
Command (SDK environment as recorded in the logs):
Merged head
eaa04a5is preserved onBurntgogi/bloomery:archive/hip-selected-before-current-main; the original pre-rebase head remains onarchive/hip-selected-before-20261016. The later3395e11validation branch is retained separately. This is a bounded operator lab, not an AMD inference backend.