Skip to content

Conversation

@biswapanda
Copy link
Contributor

@biswapanda biswapanda commented Jul 26, 2025

Overview:

add sglang disagg examples

Details:

Where should the reviewer start?

Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to)

  • closes GitHub issue: #xxx

Summary by CodeRabbit

  • New Features
    • Introduced new deployment configurations for aggregate and disaggregate modes, enabling flexible service orchestration with dedicated frontend and worker services.
    • Added support for specialized worker roles, including decode and prefill workers, with configurable resource allocation and environment variables.
  • Chores
    • Updated frontend service startup commands for improved process management.

@github-actions github-actions bot added the feat label Jul 26, 2025
@biswapanda biswapanda changed the title feat: add sglang disagg examples feat: add sglang disagg deployment examples Jul 26, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jul 26, 2025

Walkthrough

This update modifies the startup command for the Frontend service in the SGLang aggregate deployment to use dynamo run with HTTP and KV router parameters. Additionally, it introduces two new Kubernetes deployment YAMLs for SGLang: one for an aggregate router and another for a disaggregated deployment, each defining services, resources, probes, and worker configuration.

Changes

File(s) Change Summary
components/backends/sglang/deploy/agg.yaml Changed Frontend service command to use dynamo run with HTTP/KV router parameters.
components/backends/sglang/deploy/agg_router.yaml Added new DynamoGraphDeployment YAML for aggregate router with Frontend and SGLangDecodeWorker services.
components/backends/sglang/deploy/disagg.yaml Added new DynamoGraphDeployment YAML for disaggregated deployment with Frontend, Decode, and Prefill workers.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Frontend
    participant SGLangDecodeWorker
    participant SGLangPrefillWorker

    User->>Frontend: HTTP request (in=http)
    Frontend->>SGLangDecodeWorker: Forward request (out=dyn)
    SGLangDecodeWorker-->>Frontend: Processed result
    Frontend-->>User: Response

    %% For disaggregated deployment:
    User->>Frontend: HTTP request
    Frontend->>SGLangPrefillWorker: Prefill request (if needed)
    SGLangPrefillWorker-->>Frontend: Prefill result
    Frontend->>SGLangDecodeWorker: Decode request
    SGLangDecodeWorker-->>Frontend: Decode result
    Frontend-->>User: Final response
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

Poem

A bunny hops through YAML fields,
Deployments new, and old ones healed.
Frontend now with dynamo’s run,
Workers ready, tasks begun.
Probes and secrets, all in place—
SGLang’s graph, a rabbit’s race!
🐇✨

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 6

🧹 Nitpick comments (1)
components/backends/sglang/deploy/disagg.yaml (1)

155-155: Add trailing newline to pass YAML-lint.

-            - "nixl"
+\            - "nixl"\n
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 222245e and 1bda07a.

📒 Files selected for processing (3)
  • components/backends/sglang/deploy/agg.yaml (1 hunks)
  • components/backends/sglang/deploy/agg_router.yaml (1 hunks)
  • components/backends/sglang/deploy/disagg.yaml (1 hunks)
🧰 Additional context used
🧠 Learnings (4)
📓 Common learnings
Learnt from: julienmancuso
PR: ai-dynamo/dynamo#2012
File: deploy/cloud/helm/crds/templates/nvidia.com_dynamocomponentdeployments.yaml:1178-1180
Timestamp: 2025-07-18T16:05:05.534Z
Learning: The stopSignal field under lifecycle in DynamoComponentDeployment CRDs is autogenerated due to Kubernetes library upgrades (k8s.io/api and k8s.io/apimachinery from v0.32.3 to v0.33.1), not a manual design decision by the user.
components/backends/sglang/deploy/agg.yaml (3)

Learnt from: julienmancuso
PR: #2012
File: deploy/cloud/helm/crds/templates/nvidia.com_dynamocomponentdeployments.yaml:1178-1180
Timestamp: 2025-07-18T16:05:05.534Z
Learning: The stopSignal field under lifecycle in DynamoComponentDeployment CRDs is autogenerated due to Kubernetes library upgrades (k8s.io/api and k8s.io/apimachinery from v0.32.3 to v0.33.1), not a manual design decision by the user.

Learnt from: fsaady
PR: #1730
File: examples/sglang/slurm_jobs/scripts/worker_setup.py:230-244
Timestamp: 2025-07-03T10:14:30.570Z
Learning: In examples/sglang/slurm_jobs/scripts/worker_setup.py, background processes (like nats-server, etcd) are intentionally left running even if later processes fail. This design choice allows users to manually connect to nodes and debug issues without having to restart the entire SLURM job from scratch, providing operational flexibility for troubleshooting in cluster environments.

Learnt from: nnshah1
PR: #2124
File: components/backends/vllm/deploy/disagg.yaml:54-60
Timestamp: 2025-07-25T22:34:11.384Z
Learning: In vLLM worker deployments, startup probes (with longer periods and higher failure thresholds like periodSeconds: 10, failureThreshold: 60) are used to handle the slow model loading startup phase, while liveness probes are intentionally kept aggressive (periodSeconds: 5, failureThreshold: 1) for quick failure detection once the worker is operational. This pattern separates startup concerns from operational health monitoring in GPU-heavy workloads.

components/backends/sglang/deploy/agg_router.yaml (2)

Learnt from: julienmancuso
PR: #2012
File: deploy/cloud/helm/crds/templates/nvidia.com_dynamocomponentdeployments.yaml:1178-1180
Timestamp: 2025-07-18T16:05:05.534Z
Learning: The stopSignal field under lifecycle in DynamoComponentDeployment CRDs is autogenerated due to Kubernetes library upgrades (k8s.io/api and k8s.io/apimachinery from v0.32.3 to v0.33.1), not a manual design decision by the user.

Learnt from: julienmancuso
PR: #2012
File: deploy/cloud/helm/crds/templates/nvidia.com_dynamographdeployments.yaml:1233-1235
Timestamp: 2025-07-18T16:04:47.465Z
Learning: The stopSignal field in Kubernetes CRDs like DynamoGraphDeployment and DynamoComponentDeployment is autogenerated by controller-gen when upgrading Kubernetes library versions, and represents expected upstream API changes rather than manual code that needs custom validation.

components/backends/sglang/deploy/disagg.yaml (3)

Learnt from: julienmancuso
PR: #2012
File: deploy/cloud/helm/crds/templates/nvidia.com_dynamocomponentdeployments.yaml:1178-1180
Timestamp: 2025-07-18T16:05:05.534Z
Learning: The stopSignal field under lifecycle in DynamoComponentDeployment CRDs is autogenerated due to Kubernetes library upgrades (k8s.io/api and k8s.io/apimachinery from v0.32.3 to v0.33.1), not a manual design decision by the user.

Learnt from: julienmancuso
PR: #2012
File: deploy/cloud/helm/crds/templates/nvidia.com_dynamographdeployments.yaml:1233-1235
Timestamp: 2025-07-18T16:04:47.465Z
Learning: The stopSignal field in Kubernetes CRDs like DynamoGraphDeployment and DynamoComponentDeployment is autogenerated by controller-gen when upgrading Kubernetes library versions, and represents expected upstream API changes rather than manual code that needs custom validation.

Learnt from: julienmancuso
PR: #2012
File: deploy/cloud/helm/crds/templates/nvidia.com_dynamocomponentdeployments.yaml:92-98
Timestamp: 2025-07-18T16:04:31.771Z
Learning: CRD schemas in files like deploy/cloud/helm/crds/templates/*.yaml are auto-generated from Kubernetes library upgrades and should not be manually modified as changes would be overwritten during regeneration.

🪛 YAMLlint (1.37.1)
components/backends/sglang/deploy/disagg.yaml

[error] 155-155: no new line character at the end of file

(new-line-at-end-of-file)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: Mirror Repository to GitLab
  • GitHub Check: Build and Test - vllm
  • GitHub Check: pre-merge-rust (lib/runtime/examples)
  • GitHub Check: pre-merge-rust (lib/bindings/python)
  • GitHub Check: pre-merge-rust (.)
🔇 Additional comments (2)
components/backends/sglang/deploy/disagg.yaml (2)

45-45: Consider making clear_namespace non-blocking as in the router suggestion.

Same shell-chaining caveat applies.


71-79: GPU resource key may not be picked up by the device plugin.

gpu: "1" is not part of Kubernetes’ default resource list.
Clusters with NVIDIA device-plugin usually expect nvidia.com/gpu. Verify that your CRD → Pod translation maps this correctly; otherwise the scheduler will ignore the GPU request.

Also applies to: 126-134

@biswapanda biswapanda self-assigned this Jul 26, 2025
@copy-pr-bot
Copy link

copy-pr-bot bot commented Jul 27, 2025

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.

Copy link
Contributor

@atchernych atchernych left a comment

Choose a reason for hiding this comment

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

one comment regarding the health check timeouts

@biswapanda biswapanda enabled auto-merge (squash) July 28, 2025 20:51
@biswapanda biswapanda merged commit cfc6178 into main Jul 28, 2025
9 checks passed
@biswapanda biswapanda deleted the bis/sglang-disagg branch July 28, 2025 21:47
@coderabbitai coderabbitai bot mentioned this pull request Aug 19, 2025
@coderabbitai coderabbitai bot mentioned this pull request Aug 26, 2025
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.

4 participants