Archived
libr4d: hc_project takes one direction for every stream, reduced at the wave's width
The device kernel did not implement the operation core/cvec.h states, in two ways
found with a card probe (one row, n 2560, hc 4, through the plugin's own entry
point):
- it offset the direction by the stream (`v + blockIdx.y * v_ld`, with v_ld
falling back to n), so each hyper-connection stream was projected along a
NEIGHBOUR layer's direction -- rows of the table the caller never named, and
past its end when the range ends at the last row. libref and libavx both use
one v for all streams, as the package's JSON does;
- its block reduction used `__shfl_down(acc, off, 64)` under a 64-lane "wave"
bookkeeping, but gfx12 runs wave32 and nothing sets -mwavefrontsize64, so half
of each 64-group's partials never reached LDS: one application left h.v at
0.45 where the operation leaves 0.
Now one workgroup per (row, stream), the direction read once per stream, and the
reduction is the house one (r4d_wave_sum, a partial a wave in LDS, kWaves 32).
The entry refuses a [hc, n] direction table by name instead of reading it as one
direction a stream.
The kernel moves into the gated residual's unit (r4d_hc_bf16.hip), which already
has kWave/kThreads/bf2f/f2bf and the hc_common operand checks: one file fewer and
89 lines fewer than the standalone unit, and no duplicated reduction or conversion
code.
Measured through r4d_rad_hc_project after the change: each stream's h.v ends at
1e-3..6e-3 (bf16 rounding; rel_l2 1.6e-3 against the operation computed in
double), a row with `on` 0 changes 0 of its 10240 bf16 values, and a [hc, n]
table is refused. ctest -L fast: 80 of 82, the two failures environmental
(videos_test needs FFmpeg, ops_doc needs gawk, absent from rad-toolchain).
This commit is contained in:
1 parent
40f7390766
commit
cac79bb3ba
3 files changed
+57
-147
No files matched your search
@@ -175,9 +175,6 @@ set(R4D_UNITS
|
||||
# Gemma 4's sandwich-norm joins (norm_add_norm, norm_add_norm_route, join_add_scale) and
|
||||
# expert_scale, each one kernel for a chain of small ones.
|
||||
"r4d_norm_join_bf16|"
|
||||
# The experimental speed projection (core/cvec.h): one pass of h[s] -= s (h[s].v) v over the wide
|
||||
# stream, with a per-row switch.
|
||||
"r4d_hc_project|"
|
||||
"r4d_expert_scale_bf16|"
|
||||
# Runtime LoRA's two halves (lora_shrink, lora_expand), per-row adapter slot: scalar and tiled rows.
|
||||
"r4d_lora_bf16|"
|
||||
|
||||
Reference in new issue
Block a user