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
@@ -1290,6 +1290,78 @@ extern "C" int r4d_rad_unrelayout_conv_tap(const RadParam* p, int n_p, int opera
|
||||
return RAD_OK;
|
||||
}
|
||||
|
||||
/* ---- conv3d_ndhwc: PyTorch's [cout][cin][kt][k][k] stored tap-major, [cout][kt][k][k][cin].
|
||||
*
|
||||
* conv2d_nhwc's reordering with the frame tap outermost: the implicit GEMM (r4d_upscaler.hip)
|
||||
* contracts over K = (tap, channel), tap = (dt k + dy) k + dx, the channel innermost, so a 16-byte
|
||||
* read of a voxel row is eight consecutive K. Operand 1 of conv3d_ndhwc; the bias is read as
|
||||
* stored. */
|
||||
namespace {
|
||||
int conv3d_geom(const RadParam* p, int n_p, const RadTensor* pl, int n, long long* cout,
|
||||
long long* cin, long long* taps) {
|
||||
*cout = r4d_pgeti_or(p, n_p, "cout", 0);
|
||||
*cin = r4d_pgeti_or(p, n_p, "cin", 0);
|
||||
const long long k = r4d_pgeti_or(p, n_p, "k", 0), kt = r4d_pgeti_or(p, n_p, "kt", 0);
|
||||
if (n != 1 || !pl || *cout <= 0 || *cin <= 0 || k <= 0 || kt <= 0) return RAD_E_SHAPE;
|
||||
*taps = kt * k * k;
|
||||
if (pl[0].dtype != RAD_BF16 || rad_tensor_numel(&pl[0]) != *cout * *cin * *taps)
|
||||
return RAD_E_SHAPE;
|
||||
return RAD_OK;
|
||||
}
|
||||
} /* namespace */
|
||||
|
||||
extern "C" int r4d_rad_layout_conv3d_tap(const RadParam* p, int n_p, int operand,
|
||||
const RadEncoding* enc, const int* sel,
|
||||
const RadTensor* pl, int n, RadLayout* out) {
|
||||
(void)sel;
|
||||
if (!out) return RAD_E_INVAL;
|
||||
if (operand != CONV_W_OPERAND) return RAD_E_UNSUPPORTED;
|
||||
if (!enc || !rad_enc_is(enc, "plain")) return RAD_E_DTYPE;
|
||||
long long co, ci, taps;
|
||||
const int rc = conv3d_geom(p, n_p, pl, n, &co, &ci, &taps);
|
||||
if (rc != RAD_OK) return rc;
|
||||
fill(out, "r4d.conv3d.tap_major", RAD_BF16, co, taps * ci, co * taps * ci * 2);
|
||||
return RAD_OK;
|
||||
}
|
||||
|
||||
extern "C" int r4d_rad_relayout_conv3d_tap(const RadParam* p, int n_p, int operand,
|
||||
const RadEncoding* enc, const int* sel,
|
||||
const RadTensor* pl, int n, void* dst,
|
||||
int64_t dst_bytes) {
|
||||
RadLayout L;
|
||||
const int rc = r4d_rad_layout_conv3d_tap(p, n_p, operand, enc, sel, pl, n, &L);
|
||||
if (rc != RAD_OK) return rc;
|
||||
if (dst_bytes != L.bytes || !pl[0].data) return RAD_E_SHAPE;
|
||||
long long co, ci, taps;
|
||||
conv3d_geom(p, n_p, pl, n, &co, &ci, &taps);
|
||||
const uint16_t* s = (const uint16_t*)pl[0].data;
|
||||
uint16_t* d = (uint16_t*)dst;
|
||||
for (long long o = 0; o < co; ++o)
|
||||
for (long long c = 0; c < ci; ++c)
|
||||
for (long long t = 0; t < taps; ++t)
|
||||
d[(o * taps + t) * ci + c] = s[(o * ci + c) * taps + t];
|
||||
return RAD_OK;
|
||||
}
|
||||
|
||||
extern "C" int r4d_rad_unrelayout_conv3d_tap(const RadParam* p, int n_p, int operand,
|
||||
const RadEncoding* enc, const int* sel,
|
||||
const void* src, int64_t src_bytes,
|
||||
const RadTensor* pl, int n) {
|
||||
RadLayout L;
|
||||
const int rc = r4d_rad_layout_conv3d_tap(p, n_p, operand, enc, sel, pl, n, &L);
|
||||
if (rc != RAD_OK) return rc;
|
||||
if (src_bytes != L.bytes || !pl[0].data) return RAD_E_SHAPE;
|
||||
long long co, ci, taps;
|
||||
conv3d_geom(p, n_p, pl, n, &co, &ci, &taps);
|
||||
const uint16_t* s = (const uint16_t*)src;
|
||||
uint16_t* d = (uint16_t*)pl[0].data;
|
||||
for (long long o = 0; o < co; ++o)
|
||||
for (long long c = 0; c < ci; ++c)
|
||||
for (long long t = 0; t < taps; ++t)
|
||||
d[(o * ci + c) * taps + t] = s[(o * taps + t) * ci + c];
|
||||
return RAD_OK;
|
||||
}
|
||||
|
||||
/* ---- conv1d and conv_t1d: a vocoder's 1-D weights, reordered so K runs over (tap, channel) with
|
||||
* the channel innermost, as conv2d_nhwc's (r4d_audio.hip). Operand 1 of both.
|
||||
*
|
||||
|
||||
Reference in new issue
Block a user