Repository navigation
fix(backends): use engine's runai-pulled local dir for register_model - #10599
Conversation
WalkthroughThe PR adds a helper function ChangesModel source path resolution
🎯 2 (Simple) | ⏱️ ~8 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
Adds vllm + sglang unit tests covering: object-storage URI with pull, HF id, missing model_weights attr, empty-string sentinel, and (sglang) absent tokenizer_manager / model_config fallbacks. Responsive to @zhengluo-nv review on PR #10599. Signed-off-by: nnshah1 <[email protected]>
68c47f4 to
1e5fe26
Compare
When --model is an object-storage URI (s3://, gs://, az://), vLLM's
maybe_pull_model_tokenizer_for_runai (vllm/config/model.py) pulls
metadata files (config.json, tokenizer.json, …) to a local temp dir
and rewrites the ModelConfig:
- model_weights = <original URI> (for runai-streamer / mx plugin)
- model = <local temp dir> (now contains the metadata)
Dynamo's register_model was still receiving the raw URI and routing
it through hub.rs -> ModelExpress, which has no S3 provider and
returns 404 ("Is this a valid HuggingFace ID?"), crashing the
worker before vLLM finishes startup.
Pick vLLM's post-pull local dir when model_weights is populated;
register_model then takes its fs::exists shortcut in lib/bindings/
python/rust/lib.rs and skips the broken MX path entirely.
Temporary vLLM-only workaround. The longer-term fix is for hub.rs to
detect object-storage schemes and either route to the right
MxModelProvider variant or skip MX for schemes it cannot serve.
Signed-off-by: nnshah1 <[email protected]>
Mirror of the vLLM fix in the previous commit, applied to the SGLang LLM path. SGLang's ModelConfig.maybe_pull_model_tokenizer_from_remote (sglang/srt/configs/model_config.py:505) pulls *config.json files to a local temp dir for s3:// / gs:// model paths and rewrites: - .model_weights = <original URI> - .model_path = <local temp dir> This mutation lives on engine.tokenizer_manager.model_config, NOT on ServerArgs (which is what Dynamo's register_model previously read). The fix reads through the engine handle, same shape as vLLM's helper. LLM register path only — diffusion (Images/Videos) already skips the Rust-side HF download via lib/bindings/python/rust/lib.rs:314, so it doesn't need this. Signed-off-by: nnshah1 <[email protected]>
Replace nested getattr-with-default chain with try/except AttributeError on the well-known attribute path. mypy's getattr stub overloads can't resolve the default-arg type for the model_weights lookup. Behavior is identical. Signed-off-by: nnshah1 <[email protected]>
1e5fe26 to
ccee375
Compare
|
Local smoke verified — vllm worker launched against MinIO-faked S3 (Qwen3-0.6B, Remaining log error ( Integration test in #10610 still in progress; sglang local smoke kicking off in parallel (building sglang-runtime image). |
|
Local smoke verified for both backends. Test rig: MinIO (S3-compatible) on vllm (
sglang (
In both cases the previously-failing Integration test #10610 hitting the same downstream weight-load issue ( |
|
Full end-to-end smoke verified for both backends against MinIO-faked S3. Followed the canonical runai-model-streamer recipe per vLLM docs:
vLLM ( SGLang ( Both workers reach the post-register state — the fix's contract holds end-to-end across both backends. Integration test infra in #10610 now configured with the same env. |
…ai-dynamo#10599) Signed-off-by: nnshah1 <[email protected]>
Capstone of the gh-8749 stack: workers now advertise their MDC files over the system_status_server by default instead of requiring shared storage. Behavior: - Unset env -> ON (new default) - 0/false/no/off (case-insensitive) -> OFF (opt out) - Otherwise -> ON Hard-fail (anyhow::bail!) when self_host_metadata is on but DYN_SYSTEM_PORT is unset, so misconfigurations surface at first registration instead of producing WARN spam plus silently degraded hf:// MDC advertisement. The k8s operator already sets DYN_SYSTEM_PORT=9090 (deploy/operator/internal/dynamo/component_worker.go) so operator-managed deployments are unaffected. Bare / non-operator upgrades either set DYN_SYSTEM_PORT or set DYN_SELF_HOST_METADATA=0. All prerequisites in main: #8855 worker HTTP hosting on system_status_server #9057 frontend MDC verify-and-cache pipeline #9610 harvest non-weight siblings into slug_dir #9707 worker advertises non-typed metadata siblings via extra_files #10037 native preprocessor consumes resolved local_dir #10599 register_model uses engine's runai-pulled local dir on object-storage URIs #10351 auto-clean MetadataArtifactRegistry on detach Signed-off-by: nnshah1 <[email protected]>
Capstone of the gh-8749 stack: workers advertise their MDC files over the system_status_server by default instead of requiring shared storage. Behavior: - Unset env -> ON (new default) - 0/false/no/off (case-insensitive, trimmed) -> OFF (opt out) - Otherwise -> ON Hard-fail (anyhow::bail!) when self_host_metadata is on but DYN_SYSTEM_PORT is unset — surfaces misconfigurations at first registration instead of WARN spam plus silently degraded hf:// MDC advertisement. The k8s operator sets DYN_SYSTEM_PORT=9090 (see deploy/operator/internal/dynamo/component_worker.go), so operator- managed deployments are unaffected. Bare / non-operator upgrades either set DYN_SYSTEM_PORT or set DYN_SELF_HOST_METADATA=0. All prerequisites are in main: #8855 worker HTTP hosting on system_status_server #9057 frontend MDC verify-and-cache pipeline #9610 harvest non-weight siblings into slug_dir #9707 worker advertises non-typed metadata siblings via extra_files #10037 native preprocessor consumes resolved local_dir #10599 register_model uses engine's runai-pulled local dir on object-storage URIs #10351 auto-clean MetadataArtifactRegistry on detach Signed-off-by: nnshah1 <[email protected]>
Capstone of the gh-8749 stack: workers advertise their MDC files over the system_status_server by default instead of requiring shared storage. Behavior: - Unset env -> ON (new default) - 0/false/no/off (case-insensitive, trimmed) -> OFF (opt out) - Otherwise -> ON Hard-fail (anyhow::bail!) when self_host_metadata is on but DYN_SYSTEM_PORT is unset — surfaces misconfigurations at first registration instead of WARN spam plus silently degraded hf:// MDC advertisement. The k8s operator sets DYN_SYSTEM_PORT=9090 (see deploy/operator/internal/dynamo/component_worker.go), so operator- managed deployments are unaffected. Bare / non-operator upgrades either set DYN_SYSTEM_PORT or set DYN_SELF_HOST_METADATA=0. All prerequisites are in main: #8855 worker HTTP hosting on system_status_server #9057 frontend MDC verify-and-cache pipeline #9610 harvest non-weight siblings into slug_dir #9707 worker advertises non-typed metadata siblings via extra_files #10037 native preprocessor consumes resolved local_dir #10599 register_model uses engine's runai-pulled local dir on object-storage URIs #10351 auto-clean MetadataArtifactRegistry on detach Signed-off-by: nnshah1 <[email protected]>
Capstone of the gh-8749 stack: workers advertise their MDC files over the system_status_server by default instead of requiring shared storage. Behavior: - Unset env -> ON (new default) - 0/false/no/off (case-insensitive, trimmed) -> OFF (opt out) - Otherwise -> ON Hard-fail (anyhow::bail!) when self_host_metadata is on but DYN_SYSTEM_PORT is unset — surfaces misconfigurations at first registration instead of WARN spam plus silently degraded hf:// MDC advertisement. The k8s operator sets DYN_SYSTEM_PORT=9090 (see deploy/operator/internal/dynamo/component_worker.go), so operator- managed deployments are unaffected. Bare / non-operator upgrades either set DYN_SYSTEM_PORT or set DYN_SELF_HOST_METADATA=0. All prerequisites are in main: #8855 worker HTTP hosting on system_status_server #9057 frontend MDC verify-and-cache pipeline #9610 harvest non-weight siblings into slug_dir #9707 worker advertises non-typed metadata siblings via extra_files #10037 native preprocessor consumes resolved local_dir #10599 register_model uses engine's runai-pulled local dir on object-storage URIs #10351 auto-clean MetadataArtifactRegistry on detach Signed-off-by: nnshah1 <[email protected]>
Capstone of the gh-8749 stack: workers advertise their MDC files over the system_status_server by default instead of requiring shared storage. Behavior: - Unset env -> ON (new default) - 0/false/no/off (case-insensitive, trimmed) -> OFF (opt out) - Otherwise -> ON Hard-fail (anyhow::bail!) when self_host_metadata is on but DYN_SYSTEM_PORT is unset — surfaces misconfigurations at first registration instead of WARN spam plus silently degraded hf:// MDC advertisement. The k8s operator sets DYN_SYSTEM_PORT=9090 (see deploy/operator/internal/dynamo/component_worker.go), so operator- managed deployments are unaffected. Bare / non-operator upgrades either set DYN_SYSTEM_PORT or set DYN_SELF_HOST_METADATA=0. All prerequisites are in main: #8855 worker HTTP hosting on system_status_server #9057 frontend MDC verify-and-cache pipeline #9610 harvest non-weight siblings into slug_dir #9707 worker advertises non-typed metadata siblings via extra_files #10037 native preprocessor consumes resolved local_dir #10599 register_model uses engine's runai-pulled local dir on object-storage URIs #10351 auto-clean MetadataArtifactRegistry on detach Signed-off-by: nnshah1 <[email protected]>
Summary
When
--model(vLLM) /--model-path(SGLang) is an object-storage URI (s3://,gs://,az://), the engine pulls metadata files to a local temp dir during config construction and rewrites the runtime ModelConfig:maybe_pull_model_tokenizer_for_runai(vllm/config/model.py:734) — setsmodel_config.model = <local dir>,model_config.model_weights = <original URI>maybe_pull_model_tokenizer_from_remote(sglang/srt/configs/model_config.py:505) — setsmodel_config.model_path = <local dir>,model_config.model_weights = <original URI>Dynamo's
register_modelwas still receiving the raw URI (fromconfig.model/server_args.model_path), routing it throughlib/llm/src/hub.rs→ ModelExpress.MxModelProviderhas only three variants —HuggingFace,Ngc,Gcs— no S3. The call defaults toHuggingFace(hub.rs:155,163,207) and 404s:This crashes the worker before engine startup completes.
Fix
New helper
_register_model_source_path(...)per backend:components/src/dynamo/vllm/main.py): readsvllm_config.model_config.model_weightsas the sentinel; returnsvllm_config.model_config.model(post-pull local dir) when set.components/src/dynamo/sglang/register.py): reads through the engine handle:engine.tokenizer_manager.model_config.model_weights; returns its.model_pathwhen set. SGLang mutates the engine's ModelConfig — notServerArgs.model_path— so the access goes through the engine.In both cases
register_modelthen takes itsfs::existsshortcut (lib/bindings/python/rust/lib.rs:455) and skips the broken MX path.Scope
main.pyregister_vllm_modelcallsite.register.pyLLM-path callsite (_register_model_with_runtime_config). Image/video diffusion paths already skip the Rust-side HF download (lib/bindings/python/rust/lib.rs:314) and don't need this.Why "temporary workaround"
The proper fix belongs in
hub.rs: detect object-storage schemes and route to the matchingMxModelProvidervariant (Gcs exists, S3 doesn't), or skip MX for schemes the server cannot serve. Larger Rust + Python-binding change; this PR unblocks deployments today.Test plan
s3 + pulled → local,HF id → original,local path → identity,missing attr → original (fallback).s3 + pulled → local,HF id → original,no tokenizer_manager → fallback,no model_config → fallback.ast.parseclean.--model s3://...+--load-format modelexpress; confirm worker starts and serves.--model-path s3://...smoke if a deployment is available.🤖 Generated with Claude Code