Skip to content

[Raiden Weight Sync 4/7] Target-free and streaming weight conversion for vLLM - #5169

Merged
copybara-service[bot] merged 1 commit into
mainfrom
yixuann-m3-weight-converter
Sep 10, 2026
Merged

[Raiden Weight Sync 4/7] Target-free and streaming weight conversion for vLLM#5169
copybara-service[bot] merged 1 commit into
mainfrom
yixuann-m3-weight-converter

Conversation

@YixuanWang-99

@YixuanWang-99 YixuanWang-99 commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

Overview

Part of the stacked Raiden weight-sync enablement PR chain replacing #5089.

Stack:

Details

  • Implements TargetFreeWeightConverter to convert MaxText weights directly into target vLLM formats without requiring pre-initialized target model structures.
  • Implements streaming parameter conversion to minimize host peak RSS during staging.
  • Adds comprehensive unit tests in tests/post_training/unit/weight_converter_test.py.

Verification

  • pytest tests/post_training/unit/weight_converter_test.py (34/34 passed).

Checklist

Before submitting this PR, please make sure (put X in square brackets):

  • I have performed a self-review of my code. For an optional AI review, add the gemini-review label.
  • I have necessary comments in my code, particularly in hard-to-understand areas.
  • I have run end-to-end tests tests and provided workload links above if applicable.
  • I have made or will make corresponding changes to the doc if needed, including adding new documentation pages to the relevant Table of Contents (toctree directive) as explained in our documentation.

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

Copy link
Copy Markdown

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 target-free weight conversion and streaming weight conversion (convert_streaming) to the MaxText-to-MaxText converter, allowing incremental processing and reduced host memory usage. It also refactors compatibility context management and adds comprehensive unit tests. The review feedback correctly identifies several critical issues where assumptions about self.scan_axis being 1 are hardcoded, which could lead to incorrect shapes or runtime errors if configured differently. Additionally, the feedback points out a risky string prefix check for layer_ that could inadvertently match layers_ and cause crashes, suggesting a safer regex-based approach.

Comment thread src/maxtext/integration/vllm/weight_converter.py Outdated
Comment thread src/maxtext/integration/vllm/weight_converter.py Outdated
Comment thread src/maxtext/integration/vllm/weight_converter.py Outdated
Comment thread src/maxtext/integration/vllm/validate_converter.py Outdated
@YixuanWang-99
YixuanWang-99 force-pushed the yixuann-m2-moe-fused-layout branch from 57c2cce to cea33d1 Compare September 9, 2026 17:56
@YixuanWang-99
YixuanWang-99 force-pushed the yixuann-m3-weight-converter branch from 877295e to 9d299ad Compare September 9, 2026 17:56
Comment thread src/maxtext/integration/vllm/weight_converter.py Outdated
Comment thread src/maxtext/integration/vllm/weight_converter.py Outdated
Comment thread src/maxtext/integration/vllm/weight_converter.py Outdated
@YixuanWang-99
YixuanWang-99 force-pushed the yixuann-m2-moe-fused-layout branch from 0c22cdb to 053be1f Compare September 9, 2026 20:53
@A9isha
A9isha force-pushed the yixuann-m3-weight-converter branch from db7d733 to b948c90 Compare September 9, 2026 20:57
@A9isha
A9isha changed the base branch from yixuann-m2-moe-fused-layout to main September 9, 2026 20:58
@A9isha
A9isha force-pushed the yixuann-m3-weight-converter branch 2 times, most recently from e97ce8f to 9e415a2 Compare September 9, 2026 21:24
@codecov

codecov Bot commented Sep 9, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 73.15789% with 51 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/maxtext/integration/vllm/weight_converter.py 73.22% 36 Missing and 13 partials ⚠️
src/maxtext/integration/vllm/convert_utils.py 71.42% 1 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@A9isha
A9isha force-pushed the yixuann-m3-weight-converter branch from 9e415a2 to 28d54bf Compare September 9, 2026 23:26
@SurbhiJainUSC
SurbhiJainUSC force-pushed the yixuann-m3-weight-converter branch from 28d54bf to d7c8aa0 Compare September 10, 2026 00:54
@A9isha
A9isha force-pushed the yixuann-m3-weight-converter branch 3 times, most recently from c16a82f to 3e01530 Compare September 10, 2026 01:06
@SurbhiJainUSC
SurbhiJainUSC force-pushed the yixuann-m3-weight-converter branch 15 times, most recently from eee8f12 to f21da9e Compare September 10, 2026 03:26
@SurbhiJainUSC
SurbhiJainUSC force-pushed the yixuann-m3-weight-converter branch from f21da9e to 7754d49 Compare September 10, 2026 03:27
@copybara-service
copybara-service Bot merged commit bf5e715 into main Sep 10, 2026
65 of 66 checks passed
@copybara-service
copybara-service Bot deleted the yixuann-m3-weight-converter branch September 10, 2026 05:58
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.

4 participants