Speed up CPU stack startup, fix empty OMP_NUM_THREADS

The CPU stand reached 'Application startup complete' but needed ~11 minutes:
the warmup/profiling run took 604 s and the model was recompiled twice.

- drop OMP_NUM_THREADS: it resolved to an empty string, which makes libgomp
  warn and vLLM bind a single thread
- default to --enforce-eager (ENFORCE_EAGER=1): inductor compilation is minutes
  of work on CPU, eager is measurably no slower (0.18 s vs 0.18 s per ~30 word
  text) and engine init drops to 0.00 s
- lower CPU defaults to MAX_MODEL_LEN_CPU=2048 with
  MAX_NUM_BATCHED_TOKENS_CPU=2048 (batched tokens must be >= max model len),
  which is plenty for indexing
- README: what each noisy log line means and that DTYPE_CPU=float32 buys
  nothing but memory
This commit is contained in:
opencode committed 2026-10-07 08:41:50 +07:00
1 parent 4dc15869d1
commit ff6b9f8b25
3 files changed
+47 -11

No files matched your search

+6 -3
View File
@@ -23,12 +23,13 @@ services:
- ${HF_CACHE:-/root/.cache/huggingface}:/root/.cache/huggingface
environment:
MODEL: ${MODEL:-BAAI/bge-m3}
MAX_MODEL_LEN: ${MAX_MODEL_LEN_CPU:-8192}
MAX_MODEL_LEN: ${MAX_MODEL_LEN_CPU:-2048}
MAX_NUM_BATCHED_TOKENS_CPU: ${MAX_NUM_BATCHED_TOKENS_CPU:-2048}
ENFORCE_EAGER: ${ENFORCE_EAGER:-1}
BGE_M3_SPARSE_MODE: ${BGE_M3_SPARSE_MODE:-sparse}
BGE_M3_SPARSE_THRESHOLD: ${BGE_M3_SPARSE_THRESHOLD:-0.0}
VLLM_CPU_KVCACHE_SPACE: ${VLLM_CPU_KVCACHE_SPACE:-8}
VLLM_CPU_NUM_OF_RESERVED_CPU: ${VLLM_CPU_NUM_OF_RESERVED_CPU:-1}
OMP_NUM_THREADS: ${OMP_NUM_THREADS:-}
# not a login shell on purpose: /root/.profile in the vllm image dumps the
# whole environment before running anything
entrypoint: ["/bin/bash", "-c"]
@@ -314,6 +315,8 @@ services:
--hf-overrides '{"architectures": ["BgeM3EmbeddingModel"], "head_dtype": "float32"}' \
--pooler-config.task token_classify \
--io-processor-plugin bge_m3_sparse_plugin \
--max-model-len "$${MAX_MODEL_LEN:-8192}" \
--max-model-len "$${MAX_MODEL_LEN:-2048}" \
--max-num-batched-tokens "$${MAX_NUM_BATCHED_TOKENS_CPU:-2048}" \
$${ENFORCE_EAGER:+--enforce-eager} \
--port 8000 \
--dtype "$${DTYPE_CPU:-bfloat16}"