Skip to content
This repository was archived by the owner on Apr 20, 2026. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions configs/fix-timeouts.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash
BRANCH="fastdg"

# v0.5.8 + cherry-pick https://github.com/sgl-project/sglang/pull/18111
# Make sure to set SGLANG_JIT_DEEPGEMM_FAST_WARMUP=1
cd /sgl-workspace/sglang
git remote remove origin
git remote add origin https://github.com/trevor-m/sglang.git
git fetch origin
git checkout origin/${BRANCH}
Comment on lines +6 to +10
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.

⚠️ Potential issue | 🟡 Minor

Handle cd failure to prevent commands running in wrong directory.

If /sgl-workspace/sglang doesn't exist, the script continues and git commands would execute in the current directory, potentially corrupting an unrelated repository.

Proposed fix
-cd /sgl-workspace/sglang
+cd /sgl-workspace/sglang || { echo "Failed to cd to /sgl-workspace/sglang"; exit 1; }
 git remote remove origin
 git remote add origin https://github.com/trevor-m/sglang.git
 git fetch origin
 git checkout origin/${BRANCH}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
cd /sgl-workspace/sglang
git remote remove origin
git remote add origin https://github.com/trevor-m/sglang.git
git fetch origin
git checkout origin/${BRANCH}
cd /sgl-workspace/sglang || { echo "Failed to cd to /sgl-workspace/sglang"; exit 1; }
git remote remove origin
git remote add origin https://github.com/trevor-m/sglang.git
git fetch origin
git checkout origin/${BRANCH}
🧰 Tools
🪛 Shellcheck (0.11.0)

[warning] 6-6: Use 'cd ... || exit' or 'cd ... || return' in case cd fails.

(SC2164)

🤖 Prompt for AI Agents
In `@configs/fix-timeouts.sh` around lines 6 - 10, The script currently runs "cd
/sgl-workspace/sglang" without verifying it succeeded, so subsequent git
commands (git remote remove origin, git remote add origin ..., git fetch origin,
git checkout origin/${BRANCH}) may run in the wrong directory; fix by testing
that /sgl-workspace/sglang exists and that cd returns success (e.g., if [ -d
"/sgl-workspace/sglang" ] && cd "/sgl-workspace/sglang" || { echo "Failed to
enter /sgl-workspace/sglang"; exit 1; }) before running git commands so the
script aborts instead of operating in an unintended repo.


# Increase device timeout from 100s -> 1000s
cd /sgl-workspace/DeepEP
sed -i 's/#define NUM_TIMEOUT_CYCLES 200000000000ull/#define NUM_TIMEOUT_CYCLES 2000000000000ull/' csrc/kernels/configs.cuh
TORCH_CUDA_ARCH_LIST="10.0;10.3" MAX_JOBS=$(nproc) pip install --force-reinstall --no-build-isolation .
Comment on lines +13 to +15
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.

⚠️ Potential issue | 🟡 Minor

Handle cd failure to prevent sed and pip install running in wrong directory.

If the cd fails, sed would attempt to modify a file that may not exist or modify an unintended file, and pip install would install from the wrong location.

Proposed fix
-cd /sgl-workspace/DeepEP
+cd /sgl-workspace/DeepEP || { echo "Failed to cd to /sgl-workspace/DeepEP"; exit 1; }
 sed -i 's/#define NUM_TIMEOUT_CYCLES 200000000000ull/#define NUM_TIMEOUT_CYCLES 2000000000000ull/' csrc/kernels/configs.cuh
 TORCH_CUDA_ARCH_LIST="10.0;10.3" MAX_JOBS=$(nproc) pip install --force-reinstall --no-build-isolation .
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
cd /sgl-workspace/DeepEP
sed -i 's/#define NUM_TIMEOUT_CYCLES 200000000000ull/#define NUM_TIMEOUT_CYCLES 2000000000000ull/' csrc/kernels/configs.cuh
TORCH_CUDA_ARCH_LIST="10.0;10.3" MAX_JOBS=$(nproc) pip install --force-reinstall --no-build-isolation .
cd /sgl-workspace/DeepEP || { echo "Failed to cd to /sgl-workspace/DeepEP"; exit 1; }
sed -i 's/#define NUM_TIMEOUT_CYCLES 200000000000ull/#define NUM_TIMEOUT_CYCLES 2000000000000ull/' csrc/kernels/configs.cuh
TORCH_CUDA_ARCH_LIST="10.0;10.3" MAX_JOBS=$(nproc) pip install --force-reinstall --no-build-isolation .
🧰 Tools
🪛 Shellcheck (0.11.0)

[warning] 13-13: Use 'cd ... || exit' or 'cd ... || return' in case cd fails.

(SC2164)

🤖 Prompt for AI Agents
In `@configs/fix-timeouts.sh` around lines 13 - 15, The script currently runs sed
and pip immediately after `cd /sgl-workspace/DeepEP`; add a guard after the cd
to abort if it fails so sed -i and the pip install line
(TORCH_CUDA_ARCH_LIST="10.0;10.3" MAX_JOBS=$(nproc) pip install
--force-reinstall --no-build-isolation .) never run in the wrong directory —
e.g. test the exit status of the cd command and exit with a non-zero status and
error message if it fails (or enable errexit) before executing the sed
replacement of NUM_TIMEOUT_CYCLES and the pip install.


Loading