Archived
radiance 1.16.0
New models:
- Hunyuan3D-2 (hunyuan3d2): an untextured 3-D mesh from one picture of an object. DINOv2-giant
over the picture, a FLUX-shaped flow-matching DiT (16 double-stream and 32 single-stream blocks
of 1024) over 3072 latents with both guidance branches in one step, and the shape VAE's
geometry decoder. Converted from tencent/Hunyuan3D-2's hunyuan3d-dit-v2-0 folder with
data/recipes/hunyuan3d-2-bf16.recipe (fp16 cast to bf16, 4.4 GiB, one card). The licence
(Tencent Hunyuan 3D 2.0 Community License) does not cover the EU, the UK or South Korea
- Served on Hunyuan3D-2's own API server routes, so its Blender add-on and scripts work
unchanged: POST /generate answers with the mesh, POST /send runs it in the background and
GET /status/{uid} reports steps_done and then the file. GLB, OBJ, PLY or STL; the field is
sampled coarse to fine as FlashVDM's hierarchical decoding does, or densely with
"volume_decoding": "dense"; seed, steps, guidance and octree_resolution as the reference.
Texturing (Hunyuan3D-Paint) is refused for now (docs/GUIDE.md §5.17)
Merged:
- libr3d rewritten for RDNA3's wave matrix (@RikshaDriver): bf16, f16, int8-activation and vocab
GEMMs retiled to 16x128 blocks with a double-buffered k-walk; fp8, mxfp4a8, w2a8, w4a16, w5a16
and w8a8 quantised GEMMs and the gated form; grouped MoE GEMMs (bf16, fp8a8f32, mxfp4a8); the
norms and quantisers, the QSA state ops and the MoE router, scatter and gather. Brought onto the
op contract before release (13 schemas, the MoE GEMMs on weight tables with a_order and bf16
output, moe_gather's gate pitch, moe_scatter above 1024 slots, the mxfp4 m16 dispatch) and its
gated-delta-net kernels replaced by libhalo's; every op it serves now passes rad-kbench against
libref on a gfx1151, and r3d_selftest checks its MoE GEMMs by value
- Gemma 4 31B: asymmetric int5 linears (w5a8i8 above 64 rows, w5a16 up to 64, a scale per 128),
the norm, GELU and two-rank all-reduce junctions at quant_act_i8g's grid (rmsnorm_quant_i8g,
gelu_mul_quant_i8g, ar_rmsnorm_quant_i8g) so the prefill overlap runs on the i8a8, a4 and w5
trunks, and compose files for the 31B i8g, heretic-ara-i8g and w5 on two cards (@keptn42)
- The norms' lane sum reads eight at a time: TranslateGemma 27B decode is back from 225 to 239
tok/s a stream at four streams, bit for bit the same output (@mici81)
- The head-256 prefill softmax rescales each row by its own maximum, not by a vote of the wave, so
a row's rounding no longer depends on which rows share its launch (@gostar)
Anthropic Messages API:
- /v1/messages takes min_p, presence_penalty, frequency_penalty, repetition_penalty and
repeat_last_n as top-level fields with the chat path's names, ranges and meaning, so clients that
speak only the Anthropic format (Claude Code) can set a model card's sampling, such as Qwen's
presence_penalty 1.5. The penalties count the last repeat_last_n tokens of prompt and reply (64
by default, --repeat-last-n), as llama.cpp does
Plugin ABI 33:
- Shape generators: rad_declare_shape_generator, RadShapeGenBatch (RadBatch::sgen_b) and
RadArchProbe::gen_shape, with the SCOND, SSTEP, SLATENT and SQUERY passes. The layout
fingerprint table is regenerated; out-of-tree plugins rebuild against 33
- New op point_fourier ([x | sin(x 2^j) | cos(x 2^j)], times pi on request) in libref, libavx,
libr4d and libhalo
- A checkpoint for a model that reads no text gets a one-token vocabulary
More cards from the one image:
- stilldeadcode/radiance now carries libr3d (RDNA3: gfx11-generic, every gfx11 chip) and libhalo
(Strix Halo: gfx1151, preferred there over libr3d) beside libr4d (gfx1201). docker/build.sh and
the Dockerfile default to gfx1201;gfx11-generic;gfx1151
- libr3d loads only where the KFD topology lists a gfx11 card and libhalo only where it lists a
gfx1151; a process without /dev/kfd sees neither. On an RDNA4 card, or with no card at all,
the image therefore behaves exactly as before, and rad-convert lays weights out as before
- libhalo and libr3d now declare gemm_nt_q's w_rb, and libhalo gram_accum's upper, as libr4d
does. Before, any build carrying them refused both at load ("9 parameters vs 8"), so a build
for Strix Halo or RDNA3 had no device kernel library
- libhalo does not yet have every op libr4d added after it was ported (the IQR rows, Pixtral and
Ministral rope, the tree-attention and DFlash-tree rows, among others); halo_parity lists them
and is left out of the image's test stage until they are ported
Fixed -- container and checkpoint parsing:
- A .rad expert-1 entry inside or before expert 0 is refused; a vocab section whose count names
an array at offset 0 is refused rather than read from the file header; offset checks no longer
wrap; header tables must sit on their element alignment
- An imatrix array of arrays (unbounded recursion) and a safetensors header naming a tensor twice
are refused; a failed RadWriter undo says the container is damaged; a tune cache measured on
another machine is refused, as its format contract says
Fixed -- plugins:
- Two plugins declaring one op with different parameter roles are refused; before, the core
applied the first one's chunk/capacity roles to the other's rows
- Null tables behind nonzero counts, unknown roles, keyless parameters or constraints and more
operands than an issue carries are refused by name at load; on the host backend device rows are
dropped even when no fat binary was registered; rad-schemas checks the ABI layout fingerprint as
the engine does
Fixed -- device:
- Stream slots are recycled under a new generation: before, 1024 stream create/destroy cycles
(LoRA loads, lanes, uplinks) made every later rad_stream_create fail
- A stream whose drain fails keeps its queue and kernarg ring instead of freeing them under the
card; the kernarg ring no longer leaks when its access grant fails; a block over 1024 work-items
is refused
- rad_dev_free takes the allocation off the ledger the pin-cap check reads; the host backend
charges pages to the card the range was reserved for
Fixed -- engine and server:
- Two NDEBUG-only asserts (runtime-window totals, ring blocks per group) are refusals; a
plugin-declared lcm past int64 saturates so the quantum check refuses it; every share view rect
and part span is bounded by its entry
- Video: the timestep regions hold the refine rungs a schedule appends, a zero-frame encode is
refused, /v1/videos bounds each side before the area product, and a realtime session needs a
clip length to cut a turn at
Fixed -- kernels and quantisation:
- A trellis run shorter than a state's codes (tcq_rows=1, or N % tcq_rows == 1) read its seam
out of bounds; the encoder now refuses it as the decoder does, and tcq_rows below one state is
refused at parse
- qsa_tail_store bounds its slot index by the state plane (libr4d and libhalo); paged attention
refuses kv_heads <= 0; libavx row_amax skips a NaN as libref does
Fixed -- tools:
- pad_tp.py no longer runs cp through a shell with shard names from the checkpoint's index
(quote injection, path traversal): names must be bare file names
- ops_doc_check.sh runs under mawk (Ubuntu's awk); rad-kbench --max-cases/--max-bytes are checked
integers; oot_plugins fails unless the installed replay passed a case and failed none
Thanks to @RikshaDriver, @keptn42, @mici81 and @gostar.
This commit is contained in:
1 parent
cfa6a668f6
commit
769b4c64a6
122 files changed
+10092
-2203
No files matched your search
@@ -1471,6 +1471,87 @@ typedef struct RadVideoGenDecl {
|
||||
|
||||
int rad_declare_video_generator(RadBuilder* b, const RadVideoGenDecl* d);
|
||||
|
||||
/* ================================================================== the shape generator */
|
||||
/* A program that makes a 3-D shape from one picture: an image encoder reads the picture, a
|
||||
* denoiser steps a set of latent rows by flow matching, guided against an unconditioned branch,
|
||||
* and a decoder turns the latent into an occupancy field that the core samples at points of its
|
||||
* choosing and meshes. The core drives the passes (RadBatch::gen, RadShapeGenBatch), one request
|
||||
* a pass:
|
||||
*
|
||||
* RAD_GEN_PASS_SCOND the request's picture through the image encoder into the request's
|
||||
* lane: what the denoiser reads of it at every step, for both branches
|
||||
* (the picture's and the unconditioned one).
|
||||
* RAD_GEN_PASS_SSTEP one denoising step of one lane over both branches, `step_rows` rows:
|
||||
* each branch's conditioning and latent, laid out as the plugin likes, the
|
||||
* latents two entries of `latent_rows` (the conditioned first) for the
|
||||
* image generator's sampler ops. The first step draws the lane's noise.
|
||||
* RAD_GEN_PASS_SLATENT the lane's final latent through the decoder's network, into the lane:
|
||||
* what every query pass of the request reads. Runs once, after the last
|
||||
* step.
|
||||
* RAD_GEN_PASS_SQUERY the field at `n_query` points (RadShapeGenBatch::query, at most
|
||||
* `max_query`), one f32 a point in `field_out`, which the core reads
|
||||
* back.
|
||||
*
|
||||
* The picture. The core decodes it with its alpha (opaque without one) and prepares it as
|
||||
* Hunyuan3D-2's ImageProcessorV2 and image encoder do: the alpha's bounding box (its last row and
|
||||
* column left out, as the reference's slice leaves them) scaled with OpenCV's INTER_AREA to
|
||||
* (1 - border_ratio) of the longer side of the square that holds the picture, centred on it and
|
||||
* flattened onto white; that square resized to `canvas` x `canvas` with INTER_CUBIC; then as 0..1
|
||||
* values bilinearly resized to `enc_size` x `enc_size` (half-pixel centres, torchvision's), each
|
||||
* channel normalised by `pix_mean` and `pix_std`, and cut into (enc_size / enc_patch)^2 patches of
|
||||
* enc_patch x enc_patch pixels, row-major, each patch's values channel-major then row-major (a
|
||||
* convolution's weight order). An SCOND pass carries those patches.
|
||||
*
|
||||
* The sampler: a request's `steps` are sigma grid points, sigma_i = i / (steps - 1) for i in
|
||||
* [0, steps), numpy's linspace(0, 1) taken to f32; the latent starts as noise at sigma 0 and an
|
||||
* evaluation at each sigma but the last steps it to the next (the reference evaluates at the
|
||||
* last too, against itself, a step of zero). The model's timestep is sigma, the guided velocity
|
||||
* neg + cfg (pos - neg), and the step x + (sigma_next - sigma) v.
|
||||
*
|
||||
* The field: the decoder's logit at a point, inside the shape above `level`. The core samples the
|
||||
* cube [-bounds, bounds]^3 on a grid of `resolution` cells a side ((resolution + 1)^3 points,
|
||||
* numpy's linspace in f32 along each axis), coarse to fine as FlashVDM's hierarchical decoding
|
||||
* does: the whole grid at the coarsest level (resolution halved while it stays at least 63), then
|
||||
* at each finer level only the points near where the coarser one crosses `level` or is within
|
||||
* 0.95 of it. The surface is marching cubes over the finest grid, a vertex at grid index g placed
|
||||
* at g 2 bounds / (resolution + 1) - bounds, as the reference places it.
|
||||
*
|
||||
* A program declares exactly one of this, the other generators, logits or pooled vectors. */
|
||||
enum { RAD_GEN_PASS_SCOND = 15, RAD_GEN_PASS_SSTEP = 16, RAD_GEN_PASS_SLATENT = 17,
|
||||
RAD_GEN_PASS_SQUERY = 18 };
|
||||
|
||||
typedef struct RadShapeGenDecl {
|
||||
const char* name; /* "hunyuan3d-2" -- the served model id and messages */
|
||||
|
||||
/* The picture (above). */
|
||||
int64_t canvas;
|
||||
double border_ratio;
|
||||
int64_t enc_size, enc_patch;
|
||||
double pix_mean[3], pix_std[3];
|
||||
|
||||
/* The latent: `latent_rows` rows of `latent_channels` a branch; a step's rows, both branches
|
||||
* with their conditioning. */
|
||||
int64_t latent_rows, latent_channels, step_rows;
|
||||
|
||||
/* The sampler (above) and the guidance a request that names none runs at. */
|
||||
int64_t default_steps, max_steps;
|
||||
double default_guidance;
|
||||
|
||||
/* The field (above): the cube's half side, the iso value, and the grid's resolution a request
|
||||
* that names none is sampled at, with the range a request may name. */
|
||||
double bounds;
|
||||
double level;
|
||||
int64_t default_resolution, min_resolution, max_resolution;
|
||||
|
||||
/* `max_lanes` requests may hold state at once. `field_out` is a device f32 buffer of at least
|
||||
* `max_query` elements. */
|
||||
int64_t max_lanes;
|
||||
int64_t max_query;
|
||||
rad_buf field_out;
|
||||
} RadShapeGenDecl;
|
||||
|
||||
int rad_declare_shape_generator(RadBuilder* b, const RadShapeGenDecl* d);
|
||||
|
||||
/* ================================================================== diagnostics */
|
||||
/* A plugin may annotate the graph dump. Free-form, printed under --debug-graph. */
|
||||
void rad_note(RadBuilder* b, const char* fmt, ...);
|
||||
@@ -1605,6 +1686,12 @@ typedef struct RadArchProbe {
|
||||
* gen_patches answer for them. */
|
||||
int64_t gen_max_pixels;
|
||||
int64_t gen_max_refs;
|
||||
|
||||
/* ---- appended in ABI 33 (the shape generator) */
|
||||
/* Nonzero for a shape generator, which the engine sizes as it does a video generator from
|
||||
* `gen_rows` (its largest pass: a step's two branches, or a query pass's points). It keeps no
|
||||
* KV. */
|
||||
int32_t gen_shape;
|
||||
} RadArchProbe;
|
||||
|
||||
int rad_arch_probe(const RadModelMeta* meta, RadArchProbe* out);
|
||||
|
||||
Reference in new issue
Block a user