nemotron 3.5 implementation

This commit is contained in:
Gaspa79 authored and StillDeadcode committed 2026-10-30 10:22:53 +01:00
1 parent 33108e488b
commit 94c90b17ad
59 files changed
+6046 -76

No files matched your search

+30 -1
View File
@@ -304,6 +304,7 @@ and runs.
| `lfm2_bf16` | LiquidAI LFM2 and LFM2-VL in bf16, including d1 (§5.13) |
| `embgemma2` | EmbeddingGemma 2, an embedding model (§5.6) |
| `nomicbert` | nomic-embed-text-v2-moe, an embedding model (§5.6) |
| `nemotron35_embed` | Nemotron 3.5 Embed 1B and 8B, BF16 text/image embeddings at TP1 (§5.6) |
| `qwenimage21` | Qwen-Image 2.1 and 2.1-Turbo, an image model (§5.6) |
| `krea2` | Krea 2 Raw and Turbo, an image model from text (§5.6) |
| `anima` | Anima Base, Aesthetic and Turbo, an anime and illustration image model from text (§5.6) |
@@ -2411,7 +2412,7 @@ token ids mixed, with its `add_special` and `parse_special` and their defaults);
returns `tokens` as llama-server does, as `{id, piece}` objects with `with_pieces`. `/detokenize`
returns the text as both `prompt` (vLLM) and `content` (llama-server).
**An embedding model** (EmbeddingGemma 2, nomic-embed-text-v2-moe) serves `/v1/embeddings` only;
**An embedding model** (EmbeddingGemma 2, nomic-embed-text-v2-moe, Nemotron 3.5 Embed) serves `/v1/embeddings` only;
completions and chat answer 501. One input is one vector and must fit one step
(`--max-num-batched-tokens`); a longer one is refused with `context_length_exceeded`.
@@ -2421,6 +2422,34 @@ the directory must contain `tokenizer.json`. The engine adds neither the `search
`search_document: ` prefix: the client sends it, or names the checkpoint's prompt with
`prompt_name`. The checkpoint's shared `experts.bias` tensors are not applied.
Nemotron 3.5 Embed 1B and 8B load directly from their native BF16 safetensors snapshots, including
the tokenizer, processor and retrieval-prompt files; no conversion is needed. Use the normal
HIP/FFmpeg build for R9700 (`-DRAD_WITH_HIP=ON -DRAD_GPU_TARGETS=gfx1201 -DRAD_WITH_FFMPEG=ON`):
```sh
RADIANCE_HOME="$PWD/build/radiance_home" build/bin/radiance \
--model /models/Nemotron-3.5-Embed-1B-BF16 --kernels libr4d,libavx --tp 1 \
--max-model-len 32768 --max-num-batched-tokens 32768 --max-num-seqs 4 \
--mm-max-patches 6400
```
Use the 8B checkpoint path for 8B, or a CPU build and `--kernels libavx` on x86-64. Named prompts
are `query` (`query: `) and `document` (`passage: `). Typed text/image inputs and one user message
with an optional leading system prefix follow the checkpoint's retrieval template: escaped user
text, images before text, exact spacing and no implicit BOS/EOS. Images use data URLs. Raw token
arrays are already formatted and receive no named prefix. Custom `--override-chat-template`
files are rejected; use a named prompt or system prefix instead.
The 32768-token maximum counts prefixes, image placeholders and separators. `--max-model-len`
may lower it. Four full inputs need `--max-num-batched-tokens 131072 --max-num-seqs 4` to share
one step; requests arriving during an active forward wait for the next step. Configured budgets
size the arenas, so raising a budget reserves more memory even for smaller requests. The BF16
GEMMs use bounded row launches and rebased pointers for tall combined batches, preserving whole
attention sequences and existing arithmetic; unsupported multi-launch chains are refused.
`--mm-max-patches 6400` covers the default 1120-square image in one encoder pass. See
[ARCHITECTURES.md](ARCHITECTURES.md#nemotron35_embed-embedding-models) for geometry, numerical
contracts and validation limits.
```sh
# text, a batch of texts, or token ids
curl -s http://localhost:8000/v1/embeddings -H 'Content-Type: application/json' \