Skip to content

[AMD] Run MI355X disaggregation Nightly Test with runtime checkout code mechanism - #30386

Merged
bingxche merged 4 commits into
mainfrom
amd-disagg-checkout
Jul 8, 2026
Merged

bingxche merged 4 commits into
mainfrom
amd-disagg-checkout

Conversation

@yctseng0211

@yctseng0211 yctseng0211 commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Run the MI355X disagg nightly against the workflow checkout instead of image-baked sglang / sglang-router packages.
  • Stage the checkout on shared NFS, mount it read-only into Slurm containers, and reinstall checkout sglang for prefill/decode/bench.
  • Build and reinstall checkout sglang-router in the bench container before launching the router.
  • Add SGLANG_USE_CHECKOUT_RUNTIME=0 opt-out to use image-baked packages.
  • Clean per-run MI355X scratch state and avoid staging .git/config.
  • Support recipe-driven max_total_tokens; cap DSV4 Flash MI355X 1k/1k configs at 8551168.

Tests

  • Accuracy test: passed.
image

CI States

Latest PR Test (Base): ✅ Run #28873717185
Latest PR Test (Extra): ❌ Run #28873716286

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request introduces the SGLANG_USE_CHECKOUT_RUNTIME option to scripts/ci/slurm/launch_mi355x.sh, allowing the Slurm compute-node containers to reinstall and run the sglang package directly from the workflow's git checkout instead of using the image's baked-in version. The review feedback suggests optimizing the workspace staging by excluding the .git directory from the tarball to save disk space and transfer time. Additionally, it recommends using conditional parameter expansion when modifying PYTHONPATH to avoid trailing colons, which can unintentionally append the current working directory to Python's search path.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread scripts/ci/slurm/launch_mi355x.sh Outdated
Comment on lines +186 to +187
tar --exclude='__pycache__' --exclude='*.pyc' \
-C "$GITHUB_WORKSPACE" -cf - . | tar -C "$CHECKOUT_STAGE" -xf -

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.

medium

Staging the entire $GITHUB_WORKSPACE directory over shared NFS can be slow and consume significant disk space if the .git directory is large. Excluding the .git directory from the tar command is a safe optimization since the checkout SHA is already retrieved via git rev-parse and passed as an environment variable.

Suggested change
tar --exclude='__pycache__' --exclude='*.pyc' \
-C "$GITHUB_WORKSPACE" -cf - . | tar -C "$CHECKOUT_STAGE" -xf -
tar --exclude='__pycache__' --exclude='*.pyc' --exclude='.git' \
-C "$GITHUB_WORKSPACE" -cf - . | tar -C "$CHECKOUT_STAGE" -xf -

python3 -m pip install --no-deps --no-build-isolation -e "$RUNTIME_CHECKOUT/python"

export RUNTIME_CHECKOUT
export PYTHONPATH="$RUNTIME_CHECKOUT/python:${PYTHONPATH:-}"

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.

medium

Using :${PYTHONPATH:-} when PYTHONPATH is empty or unset results in a trailing colon (e.g., /path/to/dir:). In Python, an empty entry in PYTHONPATH (such as a trailing colon) is implicitly treated as the current working directory (.), which can lead to unexpected import behavior or security risks. Using the ${PYTHONPATH:+:$PYTHONPATH} parameter expansion cleanly appends the existing PYTHONPATH only if it is non-empty.

Suggested change
export PYTHONPATH="$RUNTIME_CHECKOUT/python:${PYTHONPATH:-}"
export PYTHONPATH="$RUNTIME_CHECKOUT/python${PYTHONPATH:+:$PYTHONPATH}"

source "\$CIDIR/model_flags.sh"
bash "\$CIDIR/install_checkout_sglang.sh"
if [[ "\${SGLANG_USE_CHECKOUT_RUNTIME:-1}" != "0" ]]; then
export PYTHONPATH=/tmp/sglang-checkout-runtime/python:\${PYTHONPATH:-}

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.

medium

Using :\${PYTHONPATH:-} when PYTHONPATH is empty or unset results in a trailing colon, which implicitly adds the current working directory to Python's search path. Use the \${PYTHONPATH:+:\$PYTHONPATH} parameter expansion to safely append the existing PYTHONPATH only if it is non-empty.

Suggested change
export PYTHONPATH=/tmp/sglang-checkout-runtime/python:\${PYTHONPATH:-}
export PYTHONPATH="/tmp/sglang-checkout-runtime/python\${PYTHONPATH:+:\$PYTHONPATH}"

source "\$CIDIR/model_flags.sh"
bash "\$CIDIR/install_checkout_sglang.sh"
if [[ "\${SGLANG_USE_CHECKOUT_RUNTIME:-1}" != "0" ]]; then
export PYTHONPATH=/tmp/sglang-checkout-runtime/python:\${PYTHONPATH:-}

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.

medium

Using :\${PYTHONPATH:-} when PYTHONPATH is empty or unset results in a trailing colon, which implicitly adds the current working directory to Python's search path. Use the \${PYTHONPATH:+:\$PYTHONPATH} parameter expansion to safely append the existing PYTHONPATH only if it is non-empty.

Suggested change
export PYTHONPATH=/tmp/sglang-checkout-runtime/python:\${PYTHONPATH:-}
export PYTHONPATH="/tmp/sglang-checkout-runtime/python\${PYTHONPATH:+:\$PYTHONPATH}"

Comment on lines +463 to +467
if [ "\${SGLANG_USE_CHECKOUT_RUNTIME:-1}" != "0" ]; then
export PYTHONPATH=/tmp/sglang-checkout-runtime/python:\${PYTHONPATH:-}
else
export PYTHONPATH=/sgl-workspace/sglang/python:\${PYTHONPATH:-}
fi

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.

medium

Using :\${PYTHONPATH:-} when PYTHONPATH is empty or unset results in a trailing colon, which implicitly adds the current working directory to Python's search path. Use the \${PYTHONPATH:+:\$PYTHONPATH} parameter expansion to safely append the existing PYTHONPATH only if it is non-empty.

Suggested change
if [ "\${SGLANG_USE_CHECKOUT_RUNTIME:-1}" != "0" ]; then
export PYTHONPATH=/tmp/sglang-checkout-runtime/python:\${PYTHONPATH:-}
else
export PYTHONPATH=/sgl-workspace/sglang/python:\${PYTHONPATH:-}
fi
if [ "\${SGLANG_USE_CHECKOUT_RUNTIME:-1}" != "0" ]; then
export PYTHONPATH="/tmp/sglang-checkout-runtime/python\${PYTHONPATH:+:\$PYTHONPATH}"
else
export PYTHONPATH="/sgl-workspace/sglang/python\${PYTHONPATH:+:\$PYTHONPATH}"
fi

@bingxche

bingxche commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

Dispatched the full MI355X disaggregation workflow on amd-disagg-checkout (configs left empty, so all MI355X disagg matrix entries should run): https://github.com/sgl-project/sglang/actions/runs/28862299872

@yctseng0211

Copy link
Copy Markdown
Collaborator Author

@yctseng0211
yctseng0211 force-pushed the amd-disagg-checkout branch from ce746e2 to 0aac976 Compare July 7, 2026 14:23
@yctseng0211

Copy link
Copy Markdown
Collaborator Author

@bingxche
bingxche merged commit 9bf122a into main Jul 8, 2026
120 of 127 checks passed
@bingxche
bingxche deleted the amd-disagg-checkout branch July 8, 2026 01:27
Chronostasys pushed a commit to MindLab-Research/sglang that referenced this pull request Aug 24, 2026
…de mechanism (sgl-project#30386)

Co-authored-by: bingxche <bingxche@amd.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants