Skip to content

create rust workspace - #32014

Merged
merrymercy merged 7 commits into
mainfrom
rainj-me/rust-workspace
Jul 23, 2026
Merged

merrymercy merged 7 commits into
mainfrom
rainj-me/rust-workspace

Conversation

@rainj-me

@rainj-me rainj-me commented Jul 22, 2026 •

Copy link
Copy Markdown
Collaborator

Motivation

sglang single rust workspace for rust sub projects.

Modifications

  1. Convert the existing Rust folder into a workspace.
  2. Automatically register sub-projects into the SGLang build process using cargo metadata.
  3. Standardize Rust sub-project code formatting using cargo fmt.
  4. Use cargo clippy to automatically check for and fix code bad smells.
  5. Eliminate the dependency on the system protoc command during sglang-grpc compilation by using the protoc-bin-vendored crate.
  6. Optimize the performance of the generated .so file by enabling lto = true (fat LTO), opt-level = 3, and codegen-units = 1. (If linking speed becomes too slow later, adjust to lto = "thin" and codegen-units = 8 or 16).

Accuracy Tests

Speed Tests and Profiling

Checklist

Review and Merge Process

  1. Ping Merge Oncalls to start the process. See the PR Merge Process.
  2. Get approvals from CODEOWNERS and other reviewers.
  3. Trigger CI tests with comments or contact authorized users to do so.
    • Common commands include /tag-and-rerun-ci, /tag-run-ci-label, /rerun-failed-ci
  4. After green CI and required approvals, ask Merge Oncalls or people with Write permission to merge the PR.

CI States

Latest PR Test (Base): 🚫 Run #29975775661
Latest PR Test (Extra): ❌ Run #29975775590

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@github-actions github-actions Bot added the dependencies Pull requests that update a dependency file label Jul 22, 2026
@merrymercy

Copy link
Copy Markdown
Contributor

/tag-and-rerun-ci

@github-actions github-actions Bot added run-ci CI: run the baseline test suite on this PR mthreads labels Jul 22, 2026
@rainj-me
rainj-me force-pushed the rainj-me/rust-workspace branch from 80ed7f1 to 7480280 Compare July 22, 2026 17:15
@rainj-me

Copy link
Copy Markdown
Collaborator Author

/rerun-failed-ci

@rainj-me

rainj-me commented Jul 22, 2026 •

Copy link
Copy Markdown
Collaborator Author

/rerun-failed-ci try again

@rainj-me rainj-me mentioned this pull request Jul 22, 2026
13 of 30 tasks

@sherlockwu sherlockwu left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM, with one comment around lto inlined.

Comment thread rust/Cargo.toml Outdated
Comment thread rust/Cargo.toml
@@ -0,0 +1,33 @@
[workspace]

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.

why not put the workspace files under root dir?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Let's not pollute the root directory, since we have other rust lib like sglang-gateway sgl-router etc.

@rainj-me
rainj-me force-pushed the rainj-me/rust-workspace branch from 931c772 to 0a2b4a0 Compare July 22, 2026 23:19

@alexnails alexnails left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

both minor. LGTM

Comment thread rust/rust-toolchain.toml
Comment thread python/setup.py Outdated
rainj-me and others added 6 commits July 22, 2026 19:28
The sglang-mm PyO3 extension (sglang.srt.multimodal._core) declared in
pyproject_other.toml is built via setuptools-rust during the editable
install, but the MUSA CI never provisioned a Rust toolchain (unlike the
CUDA/AMD paths), so 'pip install -e python[dev_musa]' failed with
'error: can't find Rust compiler'. This has broken the MUSA multimodal-gen
jobs since the Inkling extension landed (#31681).

Install Rust via the shared install_rustup.sh helper before the editable
install, mirroring the CUDA/AMD CI paths.
…k since cargo does not allow per package lto overriding
@rainj-me
rainj-me force-pushed the rainj-me/rust-workspace branch from e6f217a to bff3bc3 Compare July 23, 2026 02:28
@merrymercy
merrymercy merged commit 7fe82dd into main Jul 23, 2026
245 of 287 checks passed
@merrymercy
merrymercy deleted the rainj-me/rust-workspace branch July 23, 2026 19:02
Zhylkaaa pushed a commit to Zhylkaaa/sglang that referenced this pull request Jul 29, 2026
Atituiset pushed a commit to Atituiset/sglang that referenced this pull request Sep 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bypass-fastfail dependencies Pull requests that update a dependency file mthreads run-ci CI: run the baseline test suite on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants