Skip to content

fix(sglang): support model_path in GDS loading - #605

Open
daii-0818 wants to merge 1 commit into
ai-dynamo:mainfrom
daii-0818:codex/fix-sglang-gds-model-path
Open

fix(sglang): support model_path in GDS loading#605
daii-0818 wants to merge 1 commit into
ai-dynamo:mainfrom
daii-0818:codex/fix-sglang-gds-model-path

Conversation

@daii-0818

@daii-0818 daii-0818 commented Aug 11, 2026

Copy link
Copy Markdown

Summary

  • resolve the checkpoint path from vLLM model or SGLang model_path
  • preserve revision and tqdm handling for both engines
  • add a regression test using an SGLang-shaped model config

Problem

The shared GDS strategy currently reads ctx.model_config.model. SGLang exposes the checkpoint as model_path, so GDS loading fails immediately with:

'ModelConfig' object has no attribute 'model'

The strategy then falls back to the default disk loader, preventing SGLang from using GDS.

Testing

uv run --frozen --extra dev pytest tests/test_gds_loader.py tests/test_sglang_loader.py tests/test_vllm_loader.py -q
129 passed, 8 skipped

Summary by CodeRabbit

  • Bug Fixes

    • GDS model loading now supports configurations that provide a model path instead of a model reference.
    • Loading continues to honor the configured revision and progress-display settings.
    • Clearer errors are raised when no model or model path is available.
  • Tests

    • Added coverage for model-path loading and loader shutdown behavior.

Signed-off-by: DAI0818 <daii-0818@users.noreply.github.com>
@copy-pr-bot

copy-pr-bot Bot commented Aug 11, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

GDS loading now resolves the checkpoint path from model or model_path. It raises AttributeError when neither field exists. An integration test verifies path resolution, revision and tqdm propagation, and loader shutdown.

Changes

GDS model path resolution

Layer / File(s) Summary
Resolve the GDS model path
modelexpress_client/python/modelexpress/load_strategy/gds_strategy.py
The GDS strategy selects the first non-empty model or model_path value and rejects configurations without either field.
Validate SGLang-style loading
modelexpress_client/python/tests/test_gds_loader.py
The integration test uses model_path and verifies revision, tqdm configuration, and loader shutdown.

Estimated code review effort: 2 (Simple) | ~10 minutes

Poem

I hop through paths, both near and far,
model_path guides the loader’s car.
Revision and tqdm join the ride,
Then GDS shuts down with pride.
— A testing rabbit 🐇

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: adding SGLang model_path support to GDS loading.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
modelexpress_client/python/tests/test_gds_loader.py (1)

265-289: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Cover the remaining path-resolution branches.

This test covers only the case where model is absent. Add cases where both fields exist, where model is empty and model_path is set, and where neither field exists. These cases verify precedence, fallback, and failure behavior. Through GdsStrategy.load, the missing-path error is wrapped as StrategyFailed.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@modelexpress_client/python/tests/test_gds_loader.py` around lines 265 - 289,
Extend test_gds_uses_sglang_model_path to cover GdsStrategy.load path resolution
when both model and model_path are set, when model is empty with model_path set,
and when neither field exists. Assert that model takes precedence, model_path is
used as the fallback, and the missing-path case raises the wrapped
StrategyFailed error.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@modelexpress_client/python/tests/test_gds_loader.py`:
- Around line 265-289: Extend test_gds_uses_sglang_model_path to cover
GdsStrategy.load path resolution when both model and model_path are set, when
model is empty with model_path set, and when neither field exists. Assert that
model takes precedence, model_path is used as the fallback, and the missing-path
case raises the wrapped StrategyFailed error.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: ea72bed3-4987-46b7-a04d-18363b2d1e57

📥 Commits

Reviewing files that changed from the base of the PR and between b7e6686 and bf5d0cb.

📒 Files selected for processing (2)
  • modelexpress_client/python/modelexpress/load_strategy/gds_strategy.py
  • modelexpress_client/python/tests/test_gds_loader.py

@daii-0818

Copy link
Copy Markdown
Author

PR #605:

@zhengluo-nv Could you please review this SGLang/GDS compatibility fix when you have a chance? It allows GDS loading to resolve SGLang's model_path while preserving the existing model precedence. All CI checks are green.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant