Skip to content

add quant_state to state_dict #805

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

Closed
wants to merge 1 commit into from
Closed

Conversation

yuchengliu1
Copy link

Fix the failure happened when the module's name mismatches the state dict keys if a layer rewrites the _save_to_state_dict function.

@jiqing-feng
Copy link
Contributor

I don't know if it's a robust fix because quant_state is BNB-specific. Besides, I'd like to know why we wrap state_dict in ipex. Thanks!

@yuchengliu1
Copy link
Author

We need modify the static_dict according to the wrapper of parameter. So we recursively find the parameter from model by the key of original static_dict. BNB hook the recursive process when generating the static_dict. The different of recursive process between IPEX and BNB cause the failure.

@jiqing-feng
Copy link
Contributor

As we discussed offline. The BNB rewrite the _save_to_state_dict func so the quant_state parameter can be accessed. IPEX need same modification to read quant_state parameter.

@yuchengliu1 yuchengliu1 closed this by deleting the head repository Apr 15, 2025
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.

2 participants