diff --git a/libr3d/r3d_rows.cpp b/libr3d/r3d_rows.cpp index 0965b015..322820d0 100644 --- a/libr3d/r3d_rows.cpp +++ b/libr3d/r3d_rows.cpp @@ -525,7 +525,7 @@ static const RadOperandSpec oArgmax[] = { { "logits", RAD_OPD_IN, 0 }, { "params", RAD_OPD_IN, 0 }, { "token", RAD_OPD_OUT, 0 } }; static const RadOperandSpec oLogprobs[] = { { "logits", RAD_OPD_IN, 0 }, - { "params", RAD_OPD_IN, 0 }, + { "params", RAD_OPD_IN, 1 }, { "stats", RAD_OPD_OUT, 0 } }; static const RadOperandSpec oNarrow[] = { { "cand_idx", RAD_OPD_INOUT, 0 }, { "cand_val", RAD_OPD_INOUT, 0 }, @@ -2572,7 +2572,7 @@ static const RadKernelInfo kKernels[] = { "one read of the logits plane where the reference reads it three (max, sum, k-list); the sum is " "SUM exp(v - max) in DOUBLE, the reference's law, and a row's k-list is one insertion list in " "registers, not an upper_bound per element; stats is [M][2 + 2k], and rows the flag leaves alone " - "are not written", + "are not written (no params at all: every row runs)", "f32 logits, f32 params, f32 stats; k <= 64 is the pool's depth and above it the shim refuses " "(RAD_E_UNSUPPORTED); on a row that contains a NaN the reference's list freezes at the first k it " "saw: once a NaN sits in the k-list's tail, every later real value fails the tail's compare " diff --git a/libr3d/r3d_sample_pre_f32.hip b/libr3d/r3d_sample_pre_f32.hip index e48c5568..567fcfe6 100644 --- a/libr3d/r3d_sample_pre_f32.hip +++ b/libr3d/r3d_sample_pre_f32.hip @@ -189,7 +189,7 @@ __global__ __launch_bounds__(THR) void sample_logprobs_kernel( float* __restrict__ st, uint32_t n, uint32_t k, uint32_t lg_ld, uint32_t st_ld, int32_t voff) { const uint32_t row = blockIdx.x; - if (!(pr[row].flags & RAD_SP_LOGPROBS)) return; + if (pr && !(pr[row].flags & RAD_SP_LOGPROBS)) return; /* no params: every row */ Acc a; a.mx = -INFINITY; @@ -570,7 +570,7 @@ static inline int logits_rows(const RadArgs* a, const RadTensor* lg, long long* extern "C" int r3d_sample_logprobs(long lg, long params, long stats, int M, int n_vocab, int k, long long lg_ld, long long stats_ld, int vocab_off, long stream) { - if (!lg || !params || !stats) return -1; + if (!lg || !stats) return -1; if (M <= 0 || n_vocab <= 0 || k <= 0) return -2; if (k > kKMax) return -2; if (!lg_ld) lg_ld = n_vocab;