Skip to content

[Bugfix] Fix sleep mode level 2 #1376

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

Potabk
Copy link
Contributor

@Potabk Potabk commented Jun 23, 2025

What this PR does / why we need it?

For sleep mode level 2, we discarded model both weights and kv_cache, but the problems is: When we discard weights, we also discard some tensors representing the model state which we called model.named_buffers(), such as: running_mean / running_var in BatchNorm、rope cos-sin cache ... when we update weights, but forgot to update buffers as well, this will lead to some unknown issue

Does this PR introduce any user-facing change?

How was this patch tested?

Signed-off-by: wangli <[email protected]>
Copy link

codecov bot commented Jun 23, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 27.36%. Comparing base (c30ddb8) to head (1b422c0).
Report is 10 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1376      +/-   ##
==========================================
- Coverage   27.39%   27.36%   -0.04%     
==========================================
  Files          56       56              
  Lines        6191     6184       -7     
==========================================
- Hits         1696     1692       -4     
+ Misses       4495     4492       -3     
Flag Coverage Δ
unittests 27.36% <ø> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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