Skip to content

[AMD] Replace msgpack with msgspec in MORI-IO#19007

Open
Duyi-Wang wants to merge 1 commit intosgl-project:mainfrom
Duyi-Wang:replace_msgpack_with_msgspec
Open

[AMD] Replace msgpack with msgspec in MORI-IO#19007
Duyi-Wang wants to merge 1 commit intosgl-project:mainfrom
Duyi-Wang:replace_msgpack_with_msgspec

Conversation

@Duyi-Wang
Copy link
Contributor

Motivation

MORI-IO integration introduced a new dependency on msgpack, but it was not added to requirements.txt. After the base image change, the ROCm 7.2 Docker image no longer includes msgpack, causing runtime issues.

Modifications

To resolve this, msgpack is replaced with msgspec, which is already an existing dependency in SGLang.

Accuracy Tests

1P/1D DeepSeek-R1 accuracy test

# python3 bench_sglang.py --num-questions 100 --port 8000
Downloading from https://raw.githubusercontent.com/openai/grade-school-math/master/grade_school_math/data/test.jsonl to /tmp/test.jsonl
/tmp/test.jsonl: 732kB [00:00, 1.68MB/s]                                                         
100%|██████████████████████████████████████████████████████████| 100/100 [00:19<00:00,  5.03it/s]
Accuracy: 0.960
Invalid: 0.000
Latency: 19.892 s
Output throughput: 431.627 token/s

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.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @Duyi-Wang, 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 addresses a critical dependency issue within the MORI-IO integration. The msgpack library, which was not explicitly listed as a dependency, became unavailable after a base Docker image update (ROCm 7.2), causing runtime failures. By switching to msgspec, an existing dependency within SGLang, the system's stability is improved, and the overall dependency management is streamlined without introducing new external requirements.

Highlights

  • Dependency Replacement: Replaced the msgpack library with msgspec in the MORI-IO integration to resolve a missing dependency issue.
  • Serialization Logic Update: Updated the _pack_mem_desc_list and _unpack_mem_desc_list functions to use msgspec.msgpack.encode and msgspec.msgpack.decode for data serialization and deserialization.

🧠 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.

Changelog
  • python/sglang/srt/disaggregation/mori/conn.py
    • Replaced the msgpack import with msgspec.
    • Updated msgpack.packb calls to msgspec.msgpack.encode.
    • Updated msgpack.unpackb calls to msgspec.msgpack.decode.
Activity
  • No specific activity (comments, reviews, progress) was found in the provided context.
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 replaces the msgpack dependency with msgspec for the MORI-IO functionality. This is a good change as it resolves a missing dependency issue by leveraging msgspec, which is already an existing dependency in the project. The implementation changes are straightforward and correct, simply replacing the msgpack serialization and deserialization functions with their msgspec equivalents. The code looks good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments