Archived
New models and formats: - IQR for Qwen3.8-27B: weights on the int8 grid under GPTQ, a trellis down each GPTQ column (IQR-V2), and IQR-V3, a computed trellis code under one scale a row, kept at its codes' width in VRAM and decoded in the GEMM; 15 IQR-V3 recipes from ~2 to ~7 bits a weight (data/recipes/q38-27b-*-v3.recipe, docs/IQR.md) - libhalo: a kernel library for Strix Halo (gfx1151), preferred there over libr3d - Nemotron 3.5 Embed 1B and 8B (nemotron35_embed): text and image embeddings through a Pixtral tower, on the card and on the CPU - Nemotron 3.5 Rerank 8B - /v1/systemone: Cloudflare's clef and clef-flash, Convai Innovations' Laya and Mica beside LiquidAI d1; scored steps read the candidates' logits from the head table with no lm_head pass - LFM2's 8-bit trunk: block-fp8 or int8 linears with the fused producers, and the d1-3B recipe - DeepSeek-V4.1's reply format with DSML tool calls and typed argument tags Weights on the drive: - The file tier reads only the experts the pass routes rows to; the draft head's weights stay in the host pool - A hot VRAM cache for routed experts read off the drive, reads deposited straight into free host pool slots, and copyless evictions; the file tier's counters are now ssd_* - GLM-5 Next shards its routed experts by expert, not by width, so they can live on the drive - The stall watch counts drive reads as progress, and the DMA lane's room check reads the lane's own completion fence Quantisation tooling: - --calib-corpus, --calib-dir and --calib-layers record each linear's input Hessian; beside --kld-record the reference's own run records them - --kld-top N records a sparse KL reference (the N most likely tokens and the tail's mass) - GPTQ in a third of the time with the same codes, trellis GPTQ on the card, vector codebooks with coordinate descent, and rad-convert --reuse repeated, each container supplying what the earlier ones lack Speculation: - Prompt lookup alone (--spec-ngram K, --spec-ngram-min/-max): each sequence keeps an index of its n-grams, and a proposal is verified only when its measured step cost says it pays; --draft-window adaptive follows it Speed: - IQR decode: the narrow tile splits K for four times the int8 tile's waves and folds each 128-K block once; at 8 tokens down and the output projections run in 0.61-0.82x and 0.70-0.92x FP8's time (2-6 bits); IQ6R-S-V3 with its DFlash2 drafter steps in 26.3 ms at TP2, against 29.4 ms before and FP8's 27.3 - Qwen MXFP4 feed-forward: the gated fold up to 16 rows, not 8 - libr4d: the gated prefill fold, the short-prompt split row, and the rows forms of rmsnorm and rope; KLATE again for the head-256 gqa6 paged prefill; gram_accum on the matrix cores Features: - /health, /v1/health and /ping answer 503 with "status": "stuck" once the device has advanced nothing for a minute or a queue has faulted, so a supervisor can restart a wedged server (#356) - --image-gen-max-pixels and --image-gen-max-refs size an image generator's buffers (#344) - The startup report lists only the options not at their default, with a count; -v lists all (#250) - --preempt-wait-ms bounds how long a preempted prefill waits for its whole-recompute room - --placement layer_offload spills dense layers so one --max-model-len sequence fits - Startup refuses amdgpu with CWSR off and says how to fix it; --proceed-with-incompatible-configuration starts anyway under an UNSUPPORTED banner Fixes: - The n-gram read-ahead hands each row to the reader once and reads only as far ahead as the row cache holds, and pauses while decode reads: about one drive read a row instead of two (#355) - A file-tier window reads each of its runs once, not once a run per run - The decode split law's verify floor is bounded by the batch's workgroups: max_seqs 256 no longer declares 64x the scratch (#342) - A prefetch DMA list's mark stays out of the signal pool until the engine has read it, and a prefill stage copies only the blocks its own tables name (#343) - The split-KV row sum is read with fetch-inactive (#328) - LFM2 on the host backend: libref and libavx serve the row-form ops it declares (#348) - The preempted-prefill gate skips a KV group that holds no blocks (#352) - Every request entry point bounded, gated and sanitised (JSON depth, invalid UTF-8, control bytes in the log, the dashboard's CSP, cross-origin browsers on the loopback-only routes); a prompt id outside the vocabulary refused at admission; --api-key "" refused at startup - The telemetry the HTTP thread reads is atomic - An RMS norm row no longer depends on how many rows its launch carries; prefill attention's rescale is decided by live rows only - A --kld-record prefill chunk that finishes no sequence gets its logits on a tied-head model - A kernel's lazily made counter block is zeroed outside the lock other ranks take (a TP2 first-step hang) Changes: Plugin ABI 32. Every plugin exports a layout fingerprint of the ABI structs and the loader refuses a plugin without it or with another (#302), so out-of-tree plugins must be rebuilt. Appended: RadBuildCtx calib_* and gen_max_*, RadArchProbe gen_max_*, RadBatch score_only and plugin_words, RadDeviceProps::unified, RadChatFormat arg_json_value_prefix.
330 lines
14 KiB
Plaintext
330 lines
14 KiB
Plaintext
/* Derived from libr4d/r4d_gemm_wpa8i8_tiled.hip by the libhalo rename transform (2026-10-26),
|
|
* then ported to gfx1151; see libhalo/README.md. */
|
|
// halo_gemm_wpa8i8_tiled.hip - gemm_w4a8i8_tiled / gemm_w5a8i8_tiled: the 4- and 5-bit
|
|
// asymmetric weight x int8 activation GEMM for prefill row counts (ParoQuant int4 / int5).
|
|
// C[M,N] = A[M,K] @ dequant(Wq)[N,K]^T with dequant = scale[n][k/128] * (code - zero[n][k/128]),
|
|
// the activation int8 with an f32 scale per (row, part, 128 of K).
|
|
//
|
|
// The tile machinery is halo_gemm_w4a8_tiled's (128 x 256 blocks, the weight's packed dwords
|
|
// staged through LDS, the activation staged row-major so a fragment is four consecutive
|
|
// dwords); what differs is the fragment and the fold:
|
|
// * the weight byte is (code - zero), formed in the fragment by libr4d's three-op SWAR
|
|
// subtract, ((codes | 0x80808080) - zero) ^ 0x80808080 per dword -- exact for codes and
|
|
// zeros in 0..31, so the iu8 WMMA accumulates the corrected product in int32;
|
|
// * BITS 5 takes the code's fifth bit from the plane after the nibbles (one dword per
|
|
// (n-tile, 64 of K, lane); byte s = k step s, bit e = fragment element e), spread into
|
|
// bit 4 of each byte as halo_gemm_w5a16_nt_m64 spreads it;
|
|
// * the fold is per (row, group): acc += g * (w_scale[col] * a_scale[row][g]).
|
|
// A partitioned weight (pb1/pb2) is one launch per part over windows of the planes (mx_parts).
|
|
#include "halo.h"
|
|
#include "halo_gemm_args.h"
|
|
#include "halo_common.h"
|
|
#include "halo_gdn_wmma.h" // accRow: the gfx11 accumulator row mapping
|
|
#include <hip/hip_bf16.h>
|
|
#include <hip/hip_fp16.h>
|
|
#include <cstdint>
|
|
#include <stdexcept>
|
|
|
|
#define HALO_WPT_KPB 64
|
|
|
|
typedef int v2i_t __attribute__((ext_vector_type(2)));
|
|
typedef int v4i_t __attribute__((ext_vector_type(4)));
|
|
typedef int v8i_t __attribute__((ext_vector_type(8)));
|
|
typedef float v8f_t __attribute__((ext_vector_type(8)));
|
|
typedef unsigned u4v_t __attribute__((ext_vector_type(4)));
|
|
|
|
__device__ __forceinline__ v8i_t wpt_mmai(v4i_t a, v4i_t b, v8i_t c) {
|
|
return __builtin_amdgcn_wmma_i32_16x16x16_iu8_w32(true, a, true, b, c, false);
|
|
}
|
|
|
|
__device__ __forceinline__ v2i_t wpt_dequant8(unsigned w) {
|
|
v2i_t r;
|
|
r[0] = (int)((w << 4) & 0xF0F0F0F0u);
|
|
r[1] = (int)(w & 0xF0F0F0F0u);
|
|
return r;
|
|
}
|
|
|
|
/* Four code bytes (0..31) with the zero in every byte -> the four bytes of (code - zero). */
|
|
__device__ __forceinline__ unsigned wpt_sub_zero(unsigned codes4, unsigned zz) {
|
|
return ((codes4 | 0x80808080u) - zz) ^ 0x80808080u;
|
|
}
|
|
|
|
__device__ __forceinline__ unsigned wpt_spread16(unsigned n) { // 4 bits -> bit 4 of each byte
|
|
return ((n * 0x00204081u) & 0x01010101u) << 4;
|
|
}
|
|
|
|
/* The fragment from this lane's dword and its cross-half partner's, as in
|
|
* halo_gemm_w4a8_tiled, with the zero subtracted per byte. */
|
|
__device__ __forceinline__ v4i_t wpt_step(unsigned w, unsigned pw, int lane, int zero) {
|
|
const bool hi = lane >> 4;
|
|
const v2i_t lo = wpt_dequant8(hi ? pw : w);
|
|
const v2i_t hd = wpt_dequant8(hi ? w : pw);
|
|
const unsigned zz = (unsigned)zero * 0x01010101u;
|
|
v4i_t r;
|
|
r[0] = (int)wpt_sub_zero((unsigned)(lo[0] >> 4) & 0x0F0F0F0Fu, zz);
|
|
r[1] = (int)wpt_sub_zero((unsigned)(hd[0] >> 4) & 0x0F0F0F0Fu, zz);
|
|
r[2] = (int)wpt_sub_zero((unsigned)(lo[1] >> 4) & 0x0F0F0F0Fu, zz);
|
|
r[3] = (int)wpt_sub_zero((unsigned)(hd[1] >> 4) & 0x0F0F0F0Fu, zz);
|
|
return r;
|
|
}
|
|
|
|
/* BITS 5: hb (this lane's) and phb (the partner's) are the fifth-bit bytes of the two dwords.
|
|
* Fragment dword d takes its fifth bits from hb's low nibble (d < 2: nibbles 2b) or high
|
|
* nibble (d >= 2: nibbles 2b+1), as halo_gemm_w5a16_nt_m64's dequant5_pairs reads them. */
|
|
__device__ __forceinline__ v4i_t wpt_step5(unsigned w, unsigned pw, unsigned hb, unsigned phb,
|
|
int lane, int zero) {
|
|
const bool hi = lane >> 4;
|
|
const v2i_t lo = wpt_dequant8(hi ? pw : w);
|
|
const v2i_t hd = wpt_dequant8(hi ? w : pw);
|
|
const unsigned ahb = hi ? phb : hb, bhb = hi ? hb : phb;
|
|
const unsigned zz = (unsigned)zero * 0x01010101u;
|
|
v4i_t r;
|
|
r[0] = (int)wpt_sub_zero(((unsigned)(lo[0] >> 4) & 0x0F0F0F0Fu) | wpt_spread16(ahb & 15u), zz);
|
|
r[1] = (int)wpt_sub_zero(((unsigned)(hd[0] >> 4) & 0x0F0F0F0Fu) | wpt_spread16(bhb & 15u), zz);
|
|
r[2] = (int)wpt_sub_zero(((unsigned)(lo[1] >> 4) & 0x0F0F0F0Fu) | wpt_spread16(ahb >> 4), zz);
|
|
r[3] = (int)wpt_sub_zero(((unsigned)(hd[1] >> 4) & 0x0F0F0F0Fu) | wpt_spread16(bhb >> 4), zz);
|
|
return r;
|
|
}
|
|
|
|
// WM x WN waves, each owning TM x TN WMMA tiles. BM = WM*TM*16, BN = WN*TN*16. UNR k blocks
|
|
// (half-groups of 64) are unrolled per scale group of 128.
|
|
template <int WM, int WN, int TM, int TN, int BITS, int UNR>
|
|
__global__ __launch_bounds__(WM * WN * 32) void halo_gemm_wpa8i8_tiled_kernel(
|
|
const signed char* __restrict__ A, const float* __restrict__ Ascale,
|
|
const unsigned* __restrict__ Wq, const unsigned* __restrict__ Whi,
|
|
const unsigned* __restrict__ Ws, __hip_bfloat16* __restrict__ C,
|
|
int M, int K, int N, int lda, int as_rs, int n0g, int nend) {
|
|
constexpr int BK = 64; // half a scale group
|
|
constexpr int GRP = HALO_GEMM_W4A8_GROUP;
|
|
constexpr int BM = WM * TM * 16, BN = WN * TN * 16;
|
|
constexpr int NTILE = BN / 16;
|
|
constexpr int AW = BM * BK / 4; // A dwords per buffer
|
|
constexpr int WW = NTILE * 128; // W dwords per buffer
|
|
constexpr int HW = NTILE * 32; // fifth-bit dwords per buffer
|
|
|
|
__shared__ unsigned lds_a[2][AW];
|
|
__shared__ unsigned lds_w[2][WW];
|
|
__shared__ unsigned lds_h[2][HW];
|
|
|
|
const int tid = threadIdx.x, lane = tid & 31, wave = tid >> 5;
|
|
const int wm = wave / WN, wn = wave % WN;
|
|
const int m0 = blockIdx.y * BM, n0 = n0g + blockIdx.x * BN;
|
|
const int kpb = K / HALO_WPT_KPB, nsz = K / GRP;
|
|
const int ntlast = N / 16 - 1;
|
|
constexpr int NT_ = WM * WN * 32;
|
|
|
|
v8f_t acc[TN][TM];
|
|
#pragma unroll
|
|
for (int j = 0; j < TN; j++)
|
|
#pragma unroll
|
|
for (int i = 0; i < TM; i++) acc[j][i] = (v8f_t)(0.f);
|
|
v8i_t g[TN][TM];
|
|
unsigned scv[TN];
|
|
int zero[TN];
|
|
#pragma unroll
|
|
for (int j = 0; j < TN; j++) { scv[j] = 0; zero[j] = 0; }
|
|
|
|
#define ASW(r, c) ((r) * (BK / 4) + ((c) ^ ((((r) >> 1) & 7) << 1)))
|
|
|
|
constexpr int APT = (AW + NT_ - 1) / NT_, WPT = WW / NT_;
|
|
constexpr bool APAD = (AW % NT_) != 0;
|
|
unsigned ra[APT], rw[WPT > 0 ? WPT : 1];
|
|
constexpr int WPT4 = (WW / 4) / NT_;
|
|
constexpr bool W128 = WPT4 > 0 && (WW / 4) % NT_ == 0;
|
|
u4v_t rw4[WPT4 > 0 ? WPT4 : 1];
|
|
constexpr int HPT = (HW + NT_ - 1) / NT_;
|
|
unsigned rh[HPT > 0 ? HPT : 1];
|
|
static_assert(W128 || (WPT > 0 && WW % NT_ == 0), "no W staging path tiles this block shape");
|
|
auto issue = [&](int kk) {
|
|
if (W128) {
|
|
#pragma unroll
|
|
for (int x = 0; x < WPT4; x++) {
|
|
const int t = tid + x * NT_, tl = t / 32, off4 = t % 32;
|
|
const int tg = (n0 / 16 + tl) < ntlast ? (n0 / 16 + tl) : ntlast;
|
|
rw4[x] = *(const u4v_t*)(Wq + (unsigned)((tg * kpb + kk / HALO_WPT_KPB) * 128 + off4 * 4));
|
|
}
|
|
}
|
|
#pragma unroll
|
|
for (int x = 0; x < APT; x++) {
|
|
const int t = tid + x * NT_, r = t / (BK / 4), c = t % (BK / 4);
|
|
if (APAD && t >= AW) continue;
|
|
const int mm = m0 + r < M ? m0 + r : M - 1;
|
|
ra[x] = *(const unsigned*)(A + (size_t)mm * lda + kk + c * 4);
|
|
}
|
|
#pragma unroll
|
|
for (int x = 0; x < WPT && !W128; x++) {
|
|
const int t = tid + x * NT_, tl = t / 128, off = t % 128;
|
|
const int tg = (n0 / 16 + tl) < ntlast ? (n0 / 16 + tl) : ntlast;
|
|
rw[x] = Wq[(unsigned)((tg * kpb + kk / HALO_WPT_KPB) * 128 + off)];
|
|
}
|
|
if (BITS == 5) {
|
|
#pragma unroll
|
|
for (int x = 0; x < HPT; x++) {
|
|
const int t = tid + x * NT_;
|
|
if (t >= HW) continue;
|
|
const int tl = t / 32, ln = t % 32;
|
|
const int tg = (n0 / 16 + tl) < ntlast ? (n0 / 16 + tl) : ntlast;
|
|
rh[x] = Whi[(unsigned)((tg * kpb + kk / HALO_WPT_KPB) * 32 + ln)];
|
|
}
|
|
}
|
|
};
|
|
auto commit = [&](int buf) {
|
|
if (W128) {
|
|
#pragma unroll
|
|
for (int x = 0; x < WPT4; x++) *(u4v_t*)(lds_w[buf] + (tid + x * NT_) * 4) = rw4[x];
|
|
}
|
|
#pragma unroll
|
|
for (int x = 0; x < APT; x++) {
|
|
const int t = tid + x * NT_, r = t / (BK / 4), c = t % (BK / 4);
|
|
if (APAD && t >= AW) continue;
|
|
lds_a[buf][ASW(r, c)] = ra[x];
|
|
}
|
|
#pragma unroll
|
|
for (int x = 0; x < WPT && !W128; x++) lds_w[buf][tid + x * NT_] = rw[x];
|
|
if (BITS == 5) {
|
|
#pragma unroll
|
|
for (int x = 0; x < HPT; x++) {
|
|
const int t = tid + x * NT_;
|
|
if (t < HW) lds_h[buf][t] = rh[x];
|
|
}
|
|
}
|
|
};
|
|
#define HALO_WS(g_, j_) Ws[(unsigned)((((n0 / 16 + wn * TN + (j_)) < ntlast ? (n0 / 16 + wn * TN + (j_)) : ntlast) * nsz + (g_)) * 16 + (lane & 15))]
|
|
|
|
issue(0);
|
|
commit(0);
|
|
__syncthreads();
|
|
|
|
for (int kg = 0, it = 0; kg < K; kg += BK * UNR) {
|
|
#pragma unroll
|
|
for (int h = 0; h < UNR; h++, it++) {
|
|
const int k0 = kg + h * BK;
|
|
const int buf = it & 1;
|
|
if (k0 + BK < K) issue(k0 + BK);
|
|
|
|
const bool first_half = (k0 % GRP) == 0;
|
|
if (first_half) {
|
|
#pragma unroll
|
|
for (int j = 0; j < TN; j++) {
|
|
scv[j] = HALO_WS(k0 / GRP, j);
|
|
zero[j] = (int)(-__half2float(__ushort_as_half((unsigned short)(scv[j] >> 16))) - 1024.0f);
|
|
}
|
|
}
|
|
#pragma unroll
|
|
for (int u = 0; u < BK / 16; u++) {
|
|
v4i_t af[TM];
|
|
#pragma unroll
|
|
for (int i = 0; i < TM; i++) {
|
|
const int row = (wm * TM + i) * 16 + (lane & 15);
|
|
#pragma unroll
|
|
for (int d = 0; d < 4; d++)
|
|
af[i][d] = (int)lds_a[buf][ASW(row, u * 4 + d)];
|
|
}
|
|
#pragma unroll
|
|
for (int j = 0; j < TN; j++) {
|
|
const u4v_t wv = *(const u4v_t*)(lds_w[buf] + (size_t)(wn * TN + j) * 128 + lane * 4);
|
|
const u4v_t pv = *(const u4v_t*)(lds_w[buf] + (size_t)(wn * TN + j) * 128 + (lane ^ 16) * 4);
|
|
v4i_t bf;
|
|
if (BITS == 5) {
|
|
const unsigned hbw = lds_h[buf][(wn * TN + j) * 32 + lane];
|
|
const unsigned hbp = lds_h[buf][(wn * TN + j) * 32 + (lane ^ 16)];
|
|
bf = wpt_step5(wv[u], pv[u], (hbw >> (8 * u)) & 0xffu, (hbp >> (8 * u)) & 0xffu,
|
|
lane, zero[j]);
|
|
} else {
|
|
bf = wpt_step(wv[u], pv[u], lane, zero[j]);
|
|
}
|
|
#pragma unroll
|
|
for (int i = 0; i < TM; i++)
|
|
g[j][i] = (first_half && u == 0) ? wpt_mmai(af[i], bf, (v8i_t)(0))
|
|
: wpt_mmai(af[i], bf, g[j][i]);
|
|
}
|
|
}
|
|
|
|
if ((k0 + BK) % GRP == 0) { // the group closed: fold it into the float acc
|
|
float sc[TN];
|
|
#pragma unroll
|
|
for (int j = 0; j < TN; j++)
|
|
sc[j] = __half2float(__ushort_as_half((unsigned short)(scv[j] & 0xFFFFu)));
|
|
#pragma unroll
|
|
for (int i = 0; i < TM; i++) {
|
|
float as[8];
|
|
const int rb = m0 + (wm * TM + i) * 16;
|
|
#pragma unroll
|
|
for (int e = 0; e < 8; e++) {
|
|
int m = rb + 2 * e + (lane >> 4);
|
|
m = m < M ? m : M - 1;
|
|
as[e] = Ascale[(size_t)m * as_rs + k0 / GRP];
|
|
}
|
|
#pragma unroll
|
|
for (int j = 0; j < TN; j++)
|
|
#pragma unroll
|
|
for (int e = 0; e < 8; e++)
|
|
acc[j][i][e] = fmaf((float)g[j][i][e], sc[j] * as[e], acc[j][i][e]);
|
|
}
|
|
}
|
|
if (k0 + BK < K) commit(buf ^ 1);
|
|
__syncthreads();
|
|
}
|
|
}
|
|
#undef HALO_WS
|
|
#undef ASW
|
|
|
|
#pragma unroll
|
|
for (int j = 0; j < TN; j++)
|
|
#pragma unroll
|
|
for (int i = 0; i < TM; i++)
|
|
#pragma unroll
|
|
for (int e = 0; e < 8; e++) {
|
|
const int n = n0 + (wn * TN + j) * 16 + (lane & 15);
|
|
const int m = m0 + (wm * TM + i) * 16 + accRow(lane, e);
|
|
if (n < nend && m < M)
|
|
C[(size_t)m * N + n] = (__hip_bfloat16)acc[j][i][e];
|
|
}
|
|
}
|
|
|
|
template <int BITS>
|
|
static void wpa8i8_launch(long a, long ascale, long wq, long ws, long c, int M, int K, int N,
|
|
int lda, int as_rs, int n0, int n1, long stream) {
|
|
constexpr int BM = 128, BN = 128;
|
|
const unsigned* Whi = BITS == 5 ? (const unsigned*)wq + (size_t)N * K / 8 : nullptr;
|
|
dim3 grid((n1 - n0 + BN - 1) / BN, (M + BM - 1) / BM), block(512);
|
|
hipLaunchKernelGGL((halo_gemm_wpa8i8_tiled_kernel<4, 4, 2, 2, BITS, 2>), grid, block, 0,
|
|
(hipStream_t)stream, (const signed char*)a, (const float*)ascale,
|
|
(const unsigned*)wq, Whi, (const unsigned*)ws, (__hip_bfloat16*)c,
|
|
M, K, N, lda, as_rs, n0, n1);
|
|
if (hipGetLastError() != hipSuccess)
|
|
throw std::runtime_error("r4d gemm_wpa8i8_tiled: launch failed");
|
|
}
|
|
|
|
template <int BITS>
|
|
static int rad_wpa8i8_tiled(const RadArgs* a, RadStream s, const char* dtype) {
|
|
GemmOps g;
|
|
int rc = gemm_ops(a, &g, 1, /*parts=*/1);
|
|
if (rc != RAD_OK) return rc;
|
|
if (!g.ascale) return HALO_NO(RAD_E_INVAL);
|
|
MxParts mp;
|
|
rc = mx_parts(a, &g, &mp);
|
|
if (rc != RAD_OK) return rc;
|
|
const char* dt = halo_gets(a, "dtype");
|
|
if (!dt || std::strcmp(dt, dtype)) return HALO_NO(RAD_E_DTYPE);
|
|
if ((g.K % 128) || (g.N % 16)) return HALO_NO(RAD_E_SHAPE);
|
|
const long long PK = mp.lda > 0 ? mp.lda : g.K; // activation row pitch (elements)
|
|
const int PG = (int)(PK / 128); // scale groups a row, all parts
|
|
for (int p = 0; p < mp.n; ++p) {
|
|
HALO_TRY("gemm_wpa8i8_tiled",
|
|
wpa8i8_launch<BITS>(halo_addr(g.a) + (long)p * g.K,
|
|
halo_addr(g.ascale) + (long)p * (g.K / 128) * (long)sizeof(float),
|
|
halo_addr(g.b), halo_addr(g.bscale), halo_addr(g.y),
|
|
(int)g.M, (int)g.K, (int)g.N, (int)PK, PG,
|
|
(int)mp.n0[p], (int)mp.n1[p], (long)(uintptr_t)s));
|
|
}
|
|
return RAD_OK;
|
|
}
|
|
|
|
extern "C" int halo_rad_gemm_w4a8i8_tiled(const RadArgs* a, RadStream s) {
|
|
return rad_wpa8i8_tiled<4>(a, s, "w4a8i8_asym");
|
|
}
|
|
extern "C" int halo_rad_gemm_w5a8i8_tiled(const RadArgs* a, RadStream s) {
|
|
return rad_wpa8i8_tiled<5>(a, s, "w5a8i8");
|
|
}
|