Skip to content

[MUSA] Update 3rd party dir to build/_deps#18035

Merged
Kangyan-Zhou merged 1 commit intosgl-project:mainfrom
yeahdongcn:xd/3rd_party
Jan 31, 2026
Merged

[MUSA] Update 3rd party dir to build/_deps#18035
Kangyan-Zhou merged 1 commit intosgl-project:mainfrom
yeahdongcn:xd/3rd_party

Conversation

@yeahdongcn
Copy link
Collaborator

Motivation

The MUSA build previously cloned third-party repositories (mutlass, flashinfer) into sgl-kernel/third_party/, which polluted the source tree and required explicit .gitignore entries. This was inconsistent with the CUDA CMake build, which uses FetchContent to clone dependencies into build/_deps/ - a directory already ignored by the existing **/build/ pattern in .gitignore.

Modifications

  • sgl-kernel/setup_musa.py:

    • Change default third-party directory from third_party to build/_deps to match CMake's FetchContent behavior
    • Add SGLANG_MUSA_THIRD_PARTY_DIR environment variable for custom override
    • Rename SKIP_THIRD_PARTY to SGLANG_MUSA_SKIP_THIRD_PARTY for consistent naming convention
    • Add parents=True to mkdir() to create full directory hierarchy
  • .gitignore:

    • Remove sgl-kernel/third_party/ entries (no longer needed since build/_deps/ is covered by **/build/)

Testing Done

sgl-kernel build on MUSA passed.

Accuracy Tests

Benchmarking and Profiling

Checklist

Review Process

  1. Ping Merge Oncalls to start the PR flow. 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.
    • /tag-run-ci-label, /rerun-failed-ci, /tag-and-rerun-ci
  4. After green CI and required approvals, ask Merge Oncalls to merge.

Signed-off-by: Xiaodong Ye <xiaodong.ye@mthreads.com>
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @yeahdongcn, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request refactors the MUSA build process to standardize how third-party dependencies are managed. By relocating these dependencies from a source-tree-polluting sgl-kernel/third_party/ to the build/_deps/ directory, it achieves consistency with the CUDA CMake build and leverages existing .gitignore rules. This change streamlines the build environment, reduces clutter, and improves maintainability.

Highlights

  • Third-party directory relocation: The default directory for third-party dependencies has been changed from sgl-kernel/third_party/ to build/_deps/ in sgl-kernel/setup_musa.py. This aligns with the CUDA CMake build's dependency handling.
  • Environment variable for custom directory: A new environment variable, SGLANG_MUSA_THIRD_PARTY_DIR, has been introduced in sgl-kernel/setup_musa.py to allow users to specify a custom location for third-party dependencies.
  • Consistent environment variable naming: The environment variable SKIP_THIRD_PARTY has been renamed to SGLANG_MUSA_SKIP_THIRD_PARTY in sgl-kernel/setup_musa.py for better naming consistency.
  • Directory creation robustness: The mkdir() call in sgl-kernel/setup_musa.py now includes parents=True, ensuring that all necessary parent directories are created if they don't already exist.
  • .gitignore cleanup: Specific .gitignore entries for sgl-kernel/third_party/ have been removed, as the new build/_deps/ location is already covered by existing **/build/ rules.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

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 refactors the MUSA build process to handle third-party dependencies more cleanly, moving them from the source tree to a build/_deps directory. This aligns with the CUDA build process and simplifies the .gitignore file. The changes are well-motivated and improve consistency. However, I've found a critical issue in path construction for the new third-party directory that will likely cause the build to fail. I've provided a suggestion to fix this.

@Kangyan-Zhou Kangyan-Zhou merged commit 46095f0 into sgl-project:main Jan 31, 2026
52 of 58 checks passed
charlesHsuGG pushed a commit to charlesHsuGG/sglang that referenced this pull request Feb 2, 2026
Signed-off-by: Xiaodong Ye <xiaodong.ye@mthreads.com>
sfiisf pushed a commit to sfiisf/sglang that referenced this pull request Feb 5, 2026
Signed-off-by: Xiaodong Ye <xiaodong.ye@mthreads.com>
Johnsonms pushed a commit to Johnsonms/sglang that referenced this pull request Feb 14, 2026
Signed-off-by: Xiaodong Ye <xiaodong.ye@mthreads.com>
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.

2 participants