Archived
radiance 1.8.1
- MiniMax-H3 and FastH3 no longer stop the server on a prompt longer than 16 tokens (FastH3) or 128 tokens (MiniMax-H3) - latent upscaling for the MiniMax-H3 containers: with LBH-123-AI's latent upscaler in the container, `latent_upscale` runs the first steps at a smaller size and refines the latent at the full size; `upscale_refine_steps` sets how many steps refine, and the video object reports both - rad-convert --in-place extends a container whose weights the plugin has regrouped since - plugin ABI 22: out-of-tree plugins must be rebuilt
This commit is contained in:
1 parent
7a7707a955
commit
816e24bd46
43 files changed
+4458
-81
No files matched your search
@@ -359,6 +359,17 @@ __global__ __launch_bounds__(kThreads) void narrow_f16_kernel(
|
||||
__builtin_bit_cast(uint16_t, (_Float16)bf2f(x[(size_t)m * x_ld + i]));
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------- cast f32 -> bf16
|
||||
// ref_cast: the value rounded to nearest even once.
|
||||
__global__ __launch_bounds__(kThreads) void narrow_bf16_kernel(
|
||||
const float* __restrict__ x, uint16_t* __restrict__ y, uint32_t n, uint32_t x_ld,
|
||||
uint32_t y_ld, uint32_t M) {
|
||||
const uint32_t i = blockIdx.x * kThreads + threadIdx.x;
|
||||
if (i >= n) return;
|
||||
for (uint32_t m = blockIdx.y; m < M; m += gridDim.y)
|
||||
y[(size_t)m * y_ld + i] = f32_to_bf16(x[(size_t)m * x_ld + i]);
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------- the audio tower
|
||||
// Gemma 4's USM conformer: elementwise rectifier and clamp, the subsampler's segment-wise
|
||||
// convolution, the light-conv block's causal depthwise convolution, the relative-position table,
|
||||
@@ -866,6 +877,17 @@ extern "C" int r4d_narrow_bf16_f16(long x, long y, int M, int n, int x_ld, int y
|
||||
return hipGetLastError() == hipSuccess ? 0 : -4;
|
||||
}
|
||||
|
||||
extern "C" int r4d_narrow_f32_bf16(long x, long y, int M, int n, int x_ld, int y_ld,
|
||||
long stream) {
|
||||
if (!x || !y) return -1;
|
||||
if (M <= 0 || n <= 0) return -2;
|
||||
hipLaunchKernelGGL(narrow_bf16_kernel,
|
||||
dim3((uint32_t)((n + kThreads - 1) / kThreads), grid_rows(M)),
|
||||
dim3(kThreads), 0, (hipStream_t)stream, (const float*)x, (uint16_t*)y,
|
||||
(uint32_t)n, (uint32_t)x_ld, (uint32_t)y_ld, (uint32_t)M);
|
||||
return hipGetLastError() == hipSuccess ? 0 : -4;
|
||||
}
|
||||
|
||||
extern "C" int r4d_relu_bf16(long x, long y, int M, int n, int x_ld, int y_ld, long stream) {
|
||||
if (!x || !y) return -1;
|
||||
if (M <= 0 || n <= 0) return -2;
|
||||
@@ -1216,6 +1238,24 @@ extern "C" int r4d_rad_cast_f16(const RadArgs* a, RadStream s) {
|
||||
(int)y_ld, (long)(uintptr_t)s));
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------ cast f32 -> bf16 */
|
||||
extern "C" int r4d_rad_cast_bf16(const RadArgs* a, RadStream s) {
|
||||
const RadTensor* x = r4d_opt(a, 0);
|
||||
const RadTensor* y = r4d_opt(a, 1);
|
||||
if (!x || !y) return R4D_NO(RAD_E_INVAL);
|
||||
if (x->dtype != RAD_F32) return R4D_NO(RAD_E_DTYPE);
|
||||
R4D_NEED(dt_bf16(y));
|
||||
const long long n = r4d_geti_or(a, "n", r4d_dim(y, (int)y->rank - 1));
|
||||
if (n <= 0) return R4D_NO(RAD_E_SHAPE);
|
||||
long long M = 0, Mx = 0;
|
||||
const long long y_ld = r4d_rows_pitch(y, n, &M);
|
||||
const long long x_ld = r4d_rows_pitch(x, n, &Mx);
|
||||
if (y_ld < 0 || x_ld < 0) return R4D_NO(RAD_E_STRIDE);
|
||||
if (M <= 0 || Mx < M) return R4D_NO(RAD_E_SHAPE);
|
||||
return enc_status(r4d_narrow_f32_bf16(r4d_addr(x), r4d_addr(y), (int)M, (int)n, (int)x_ld,
|
||||
(int)y_ld, (long)(uintptr_t)s));
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------ the audio tower */
|
||||
|
||||
extern "C" int r4d_rad_relu(const RadArgs* a, RadStream s) {
|
||||
|
||||
Reference in new issue
Block a user