sglang-upgrade

Rebases Relax's sglang patch onto a new sglang release and updates the training Docker image.

585|144|Updated Apr 13, 2026
One-click install
npx skills add https://github.com/redai-infra/Relax --skill sglang-upgrade
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sglang-upgrade
Source: https://github.com/redai-infra/Relax/tree/main/skills/sglang-upgrade
Command: npx skills add https://github.com/redai-infra/Relax --skill sglang-upgrade

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

Upgrading the sglang version behind Relax's training Docker image is dominated by one painful task: rebasing the large private patch docker/patch/latest/sglang.patch onto a new upstream release without losing Relax-specific changes or re-porting code that upstream has already absorbed.

Core Features & Use Cases

  • Version Determination: Explains that the sglang version is pinned solely by the BASE_IMAGE ARG in docker/Dockerfile, not by requirements files, and how source overlays affect it.
  • Slime-Guided Rebase: Uses THUDM/slime's already-rebased per-version patches as a skeleton, then classifies Relax's private hunks into identical/shared/unique categories via scripts/classify_patch.sh.
  • Upstream-vs-Private Triage: Provides rules for deciding which private changes (NSA, BF16 MoE, weight hot-reload, SafeUnpickler whitelist) are already upstreamed and which must be ported, plus validation with git apply --check on a clean worktree.
  • Use Case: When bumping the base image from one sglang tag to another, follow the workflow to produce a verified new sglang.patch, update the Dockerfile and requirements, and record keep/drop decisions in an upgrade plan document.

Quick Start

Upgrade Relax's sglang base image to the new tag vX.Y.Z and rebase the sglang patch accordingly.

Frequently Asked Questions about sglang-upgrade

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I upgrade the sglang version in a Docker-based training image?

Change the BASE_IMAGE ARG tag in docker/Dockerfile, since the sglang version is pinned there rather than in requirements files. Then rebase the private sglang.patch onto the new release and validate it with git apply --check on a clean worktree of the target tag.

How to rebase a large git patch onto a new upstream release?

Use an already-rebased reference patch (THUDM/slime maintains per-version sglang patches) as a skeleton, then classify your private hunks into identical, shared, and unique files. Port only the deltas that upstream has not already absorbed, and verify with git apply --check.

How do I tell if my custom patch is already upstreamed?

Check out the target release source tree and grep for the key symbols or function names your patch adds. If the functionality exists upstream, drop your hunk; model-layer features like NSA or BF16 MoE kernels are frequently absorbed by upstream sglang.

Why does pip show sglang report the wrong version after a source overlay?

An rsync source overlay replaces only the source files, not the .dist-info metadata that setuptools_scm froze at image build time. The installed package metadata therefore disagrees with the actual source, so trust the Dockerfile base image tag instead.

What are common pitfalls when rebasing sglang patches?

Patch @@ line-number offsets pollute change comparisons, so compare only real +/- lines. Also avoid copying slime-private changes meant for their custom base image, and confirm Relax actually references a private feature before deleting it.