fix: set PackedSeqParams.total_tokens for mamba seq packing#2529
Merged
Conversation
Contributor
Author
|
/ok to test a81a6b7 |
Contributor
Author
|
/ok to test a2e8aec |
Contributor
Author
Yes, added a wandb screenshot in the description showing before and after this patch. |
terrykong
previously approved these changes
May 20, 2026
Collaborator
|
@yfw approved, can you resolve the sphinx build, prob unrelated to PR, but easier to just solve in this one |
|
awesome to see the fix being pushed so fast, that bug kinda ruined my weekend :D |
Without total_tokens, PackedSeqParams.__post_init__ skips building seq_idx, so Mamba's SSM state never resets between packed samples. This results in high logprob errors. Signed-off-by: Yi-Fu Wu <yifu.wu@gmail.com>
Signed-off-by: Yi-Fu Wu <yifu.wu@gmail.com>
yfw
force-pushed
the
yifu/fix_mamba_seqpack
branch
from
May 21, 2026 20:17
a2e8aec to
7519be8
Compare
Contributor
Author
|
/ok to test 7519be8 |
Signed-off-by: Yi-Fu Wu <yifu.wu@gmail.com>
Contributor
Author
|
/ok to test 31e9e38 |
terrykong
approved these changes
May 21, 2026
yfw
added a commit
that referenced
this pull request
May 27, 2026
Signed-off-by: Yi-Fu Wu <yifu.wu@gmail.com>
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.
What does this PR do ?
Without total_tokens,
PackedSeqParams.__post_init__skips building seq_idx, so Mamba's SSM state never resets between packed samples. This results in high logprob errors.Issues
List issues that this PR closes (syntax):
Usage
# Add a code snippet demonstrating how to use thisBefore your PR is "Ready for review"
Pre checks:
Additional Information