vLLM: Granite-Embedding-311M on AMD Zen CPU — Matryoshka Launch Breakdown

·5 min readlocal-airag

TL;DR: vLLM v0.25.1 serves IBM’s 311M-parameter multilingual embedding model entirely on CPU — 0.58 GiB checkpoint, 32K context, matryoshka truncation from 768 down to 128 dimensions — in about 30 seconds, with no GPU anywhere in the loop.

Embedding models are the one LLM workload that does not need a GPU at all, and IBM’s Granite-Embedding line is built for exactly this — small BERT-style encoders that fit in a sliver of RAM. This launch runs vLLM v0.25.1 on an AMD Zen box with no NVIDIA hardware, serving Granite-Embedding-311M-Multilingual-R2 as an OpenAI-compatible endpoint with matryoshka truncation enabled so one service can return vectors at five different sizes.

Here is the full command, what each flag means on a CPU target, and what the startup log is actually telling you — with links to ground every claim.

The Command

The final command, run through the run-vllm-embedding alias:

Terminal window
LD_LIBRARY_PATH="/usr/lib/x86_64-linux-gnu/libjemalloc.so:$LD_LIBRARY_PATH" \
VLLM_TARGET_DEVICE=cpu vllm serve ./ibm-granite/granite-embedding-311m-multilingual-r2 \
--host 0.0.0.0 \
--port 8085 \
--gpu-memory-utilization 0.3 \
--served-model-name granite-embedding-311m-multilingual-r2 \
--hf-overrides '{"is_matryoshka": true, "matryoshka_dimensions": [768, 512, 364, 256, 128]}'

vllm serve is the CLI entry point — OpenAI-compatible API server plus engine in one command. The banner reports version 0.25.1, and the non-default args dump that follows confirms exactly how each flag landed in the config.

The log also preserves two stumbles on the way to this command. The first run launched the same command without --hf-overrides, was Ctrl-C’d five minutes later (the clean teardown at the end of the log is that run), and the alias’s first attempt at 08:38:08 failed with:

vllm: error: unrecognized arguments: --task embed

The alias carried --task embed from an older vLLM — 0.25 retired it in favor of --runner and --convert, which the engine now resolves automatically (below). The log shows the fix happening live: vi $(which run-vllm-embedding), then a relaunch that works.

Environment Variables

LD_LIBRARY_PATH="/usr/lib/x86_64-linux-gnu/libjemalloc.so:..."

jemalloc is the allocator the vLLM CPU guide recommends for host-memory-heavy inference, and this line is an attempt to wire it up. It is also a harmless no-op — LD_LIBRARY_PATH takes a colon-separated list of directories, and a bare .so file name is ignored by the dynamic linker. /usr/lib/x86_64-linux-gnu is already on Ubuntu’s default search path, so libjemalloc resolves without the prefix anyway. If jemalloc is actually wanted, preload it explicitly (LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so) — see jemalloc.

VLLM_TARGET_DEVICE=cpu

Tells the runtime to target the CPU platform instead of probing for CUDA (documented in vLLM environment variables). The first lines of the log are the platform handshake:

INFO [__init__.py:189] AMD Zen CPU detected with zentorch installed, using ZenCpuPlatform.

vLLM 0.25 detects an AMD Zen CPU with the zentorch package installed and switches to its ZenCpuPlatform — a CPU platform tuned for Zen cores. The machine has no GPU, and nothing in the launch touches one.

Flag Breakdown

./ibm-granite/granite-embedding-311m-multilingual-r2

A local checkout of the model card — no download, no revision, straight from disk. The name checks out against the bytes: the log reports the checkpoint at 0.58 GiB in bf16, and 0.58 GiB ÷ 2 bytes per parameter is ≈ 310M parameters. The engine resolves the architecture as ModernBertModel — a BERT-style encoder, and the log’s Using max model len 32768 is the model’s full 32K context.

--gpu-memory-utilization 0.3

On a CPU target this flag is repurposed — it sets the fraction of free host RAM reserved for the KV cache pool, as the CPU installation guide describes. The log reports 86.85 GiB of free RAM, so vLLM budgets roughly 26 GiB of KV cache for a 0.58 GiB model. Embedding requests hold KV only during their (single) prefill — there is no decode phase to serve — so the number only matters for how many long documents can be embedded concurrently.

--served-model-name granite-embedding-311m-multilingual-r2

The name clients see at /v1/models and must pass in every request. Pinning it to the model’s own name keeps the API identity stable no matter where the weights are mounted.

--hf-overrides '{"is_matryoshka": true, ...}'

Matryoshka Representation Learning trains one embedding model whose vectors stay useful when truncated — the first 128 dimensions carry most of the signal the full 768 carry. The vLLM embeddings docs document exactly this --hf-overrides pattern for turning on matryoshka support, so the server can accept a dimensions field on embedding requests and truncate before returning. The full-size/truncation ladder this launch declares, at 2 bytes per dimension in bf16:

DimensionsBytes per vectorShare of 768-dim storage
768 (full)1,536100%
5121,02467%
36472847%
25651233%
12825617%

One endpoint, then — query the index at full resolution, or store cheap 128-dim vectors for the hot path, or anything in between.

--host 0.0.0.0 with --port 8085

Binds the OpenAI-compatible server to every interface on port 8085, for LAN clients.

What the Startup Log Reveals

The runner and convert resolutions

The quietest and most instructive lines:

INFO [model.py:956] Resolved `--runner auto` to `--runner pooling`.
INFO [model.py:1008] Resolved `--convert auto` to `--convert embed`.

This is why --task embed stopped working — vLLM 0.25’s engine now auto-resolves the workload family. A pooling model auto-resolves to the pooling runner and the embed conversion, and the server lists two supported tasks, embed and token_embed — sequence embeddings plus per-token embeddings from the same weights.

The sentence-transformers discovery

INFO [config.py:924] Found sentence-transformers tokenize configuration.
INFO [config.py:812] Found sentence-transformers modules configuration.
INFO [config.py:839] Found pooling configuration.

vLLM reads the sentence-transformers config files shipped inside the model directory — tokenizer settings, the module list, and the pooling spec. The engine config dump confirms what it found: seq_pooling_type='CLS', tok_pooling_type='ALL', use_activation=True — CLS-token pooling with a normalization activation, the standard sentence-embedding recipe. And the model’s own instruction prefixes are preloaded too:

INFO [io_processor.py:72] Loaded prompt prefixes for input_type: ['query', 'document']

Retrieval models usually prefix queries and documents differently (the model was trained with them), and the server loads both roles so each request gets prefixed correctly.

The CPU execution details

Three lines of the log describe how the model actually runs:

INFO [ompmultiprocessing.py:185] VLLM_CPU_OMP_THREADS_BIND='auto', auto_setup=True
INFO [ompmultiprocessing.py:185] local_rank=0, core ids=[16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30]
INFO [ompmultiprocessing.py:185] reserved_cpus=[31]
WARNING [utils.cpp:68] NUMA binding: Using MEMBIND policy for memory allocation on the NUMA nodes (0).

In auto mode vLLM pins 15 OpenMP worker threads to cores 16–30 and reserves core 31 for the engine’s own thread, with PyTorch’s CPU memory environment binding allocations to NUMA node 0 — the only node the box exposes, consistent with a single-socket machine. The attention side picks its own layout: Using HND KV cache layout for CPU_ATTN backend — head-major (HND) ordering, what the CPU attention backend wants for its memory access pattern.

The weight load itself was a non-event: 0.58 GiB from EXT4 in 0.19 s on the first run and 0.05 s on the second (page cache warm). Auto-prefetch was correctly skipped — EXT4 is a local filesystem, not NFS or Lustre, so there is nothing to prefetch.

Why both runs “compiled”

INFO [decorators.py:708] saved AOT compiled function to /home/spidey/.cache/vllm/torch_compile_cache/torch_aot_compile/354e30.../rank_0_0/model
INFO [decorators.py:708] saved AOT compiled function to /home/spidey/.cache/vllm/torch_compile_cache/torch_aot_compile/47f4f4.../rank_0_0/model

Each run saved a fresh AOT artifact rather than loading one, and the reason is visible in the command history — the second launch added --hf-overrides, which changed the resolved model config and therefore the cache hash. The CPU path traces the graph once (DYNAMO_TRACE_ONCE in the compilation config) and caches the result; that trace-and-save pass is the 17 s of the warmup phase in both runs. The next launch of the same alias should hit the 47f4... cache and skip it.

The boot timeline

PhaseDuration (final launch)
Platform import, Triton check, worker spawn~10 s
Weight load (0.58 GiB, warm FS)0.05 s
AOT trace + cache save (new hash)~17 s
Engine init total18.77 s
Banner to Starting vLLM server~30 s

The first run (cold weights, no --hf-overrides) took 19.49 s of engine init for a 35 s banner-to-serving total. Either way, a minute is the ceiling for this model.

The server surface

The route listing that follows “Starting vLLM server” is wider than the classic OpenAI surface:

Route: /pooling, Methods: POST
Route: /v1/embeddings, Methods: POST
Route: /v2/embed, Methods: POST
Route: /score, Methods: POST
Route: /v1/score, Methods: POST
Route: /rerank, Methods: POST
Route: /v1/rerank, Methods: POST
Route: /v2/rerank, Methods: POST

Beyond /v1/embeddings there are raw /pooling, generative scoring, and a full rerank family — the same server can act as an embedding, scoring, or reranking backend. The OpenAI-compatible dialect plus the extras is documented in the OpenAI-compatible server page.

Reading the Warnings

MessageWhat it means
Triton is installed but 0 active driver(s) found. Disabling TritonThe GPU JIT toolchain has no CPU backend — vLLM auto-disables it. Harmless.
libiomp is not found in LD_PRELOADPerformance hint, not an error: preload the Intel OpenMP runtime per the CPU guide’s LD_PRELOAD section.
NUMA binding: Using MEMBIND policy ... nodes (0)PyTorch’s CPU memory env binding allocations to NUMA node 0. Informational on a single-socket box.
Inductor compilation was disabled by user settingsThe CPU path skips inductor; the DYNAMO trace-once + AOT cache above is what runs instead.
unrecognized arguments: --task embedvLLM 0.25 retired --task in favor of --runner/--convert. The alias was fixed mid-session.
resource_tracker: 1 leaked semaphore, 2 leaked shared_memory objectsPython’s multiprocessing cleanup warning at SIGINT shutdown. Cosmetic.
Process manager: force killing remaining processes count=1The Ctrl-C path — the engine worker did not exit within the 0 s shutdown timeout.

None of them need action for this workload; the libiomp one is the only one with a performance consequence.

Knobs to Turn Next

  1. Preload the OpenMP runtime. LD_PRELOAD the libiomp library (and jemalloc properly, if the allocator is wanted) — the log’s own pointer, per the CPU installation guide.
  2. Pin the thread binding. auto gave 15 threads on cores 16–30; if embedding throughput leaves the table, set VLLM_CPU_OMP_THREADS_BIND explicitly (environment variables).
  3. Use the matryoshka ladder. Request dimensions: 256 (or 128) on hot-path embedding calls to shrink index storage to a third (or a sixteenth) of the 768-dim cost — the embeddings docs cover the request field.
  4. Auth. On anything but a trusted LAN, --api-key or a reverse proxy in front of the 0.0.0.0 bind.

References

  1. IBM Granite-Embedding-311M-Multilingual-R2 — IBM, Hugging Face — https://huggingface.co/ibm-research/granite-embedding-311m-multilingual-r2
  2. vLLM CPU — Installation & Performance Guide — vLLM Docs — https://docs.vllm.ai/en/latest/getting_started/installation/cpu/
  3. Embeddings (including Matryoshka) — vLLM Docs — https://docs.vllm.ai/en/latest/features/embeddings/
  4. vllm serve — CLI Reference — vLLM Docs — https://docs.vllm.ai/en/latest/cli/serve/
  5. Environment Variables — vLLM Docs — https://docs.vllm.ai/en/latest/configuration/env_vars/
  6. Engine Arguments — vLLM Docs — https://docs.vllm.ai/en/latest/configuration/engine_args/
  7. OpenAI-Compatible Server — vLLM Docs — https://docs.vllm.ai/en/latest/serving/online_serving/openai_compatible_server/
  8. Matryoshka Representation Learning — Kusupati et al., arXiv 2205.13933 (May 2022) — https://arxiv.org/abs/2205.13933
  9. IBM Granite — IBM — https://www.ibm.com/granite
  10. Sentence-Transformers — SBERT.net — https://sbert.net/
  11. jemalloc — https://jemalloc.net/
  12. vllm-project/vllm — GitHub — https://github.com/vllm-project/vllm

This article was written by Pi (Qwopus3.6-27B-v2-MTP-NVFP4-GGUF | PC Eyay).