Treat MambaLayer as an FSDP unit module#4633
Draft
wujingyue wants to merge 6 commits into
Draft
Conversation
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
Buckets whose parameter group has fsdp_unit_id is None must remain persistently allocated, because their parameters can be read across module boundaries (e.g. by fused kernels that bypass nn.Module.forward). Mark only unit-owned buckets as releasable during reset, and scope the "EMPTY after reset" assertion to those same buckets. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…9m�[38;5;129;01mas�[39;00m�[38;5;250m �[39man�[38;5;250m �[39mFSDP�[38;5;250m �[39munit�[38;5;250m �[39m�[38;5;129;01mmodule�[39;00m Co�[38;5;241m-�[39mAuthored�[38;5;241m-�[39m�[38;5;129;01mBy�[39;00m:�[38;5;250m �[39mClaude�[38;5;250m �[39mOpus�[38;5;250m �[39m�[38;5;241m4.7�[39m�[38;5;250m �[39m(�[38;5;241m1�[39mM�[38;5;250m �[39mcontext)�[38;5;250m �[39m�[38;5;241m<�[39mnoreply�[38;5;136m@anthropic�[39m.com�[38;5;241m>�[39m
cspades
reviewed
May 13, 2026
Member
cspades
left a comment
There was a problem hiding this comment.
Tested this (without CG) on my CG branch with a simple HybridModel MEMEMEME and it works, were you able to reproduce the original bug and why does making non-units persistent fix it? Is it basically just that some pointer gets dereferenced after the first reset and we AG the wrong variable? More details would be super nice!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Based on #4717.