Skip to content

Handle fetch optimizer states for the KV ZCH with optimizer offloading enabled case #4522

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

Conversation

q10
Copy link
Contributor

@q10 q10 commented Jul 18, 2025

Summary:
There are 4 cases to handle when attempting to fetch the split optimizer states:

  1. The no-KV ZCH case
  2. The KV ZCH case, but where self.load_state_dict is True (i.e. fall back to self._cached_kvzch_data)
  3. The KV ZCH case, where self.load_state_dict is False, and self.enable_optimizer_offloading is false
  4. The KV ZCH case, where self.load_state_dict is False, and self.enable_optimizer_offloading is True

This diff handles the KV ZCH with optimizer offloading enabled case (case 4), thus completing handling of all 4 cases in the series

Reviewed By: sryap, emlin

Differential Revision: D77825320

…g enabled case

Summary:
There are 4 cases to handle when attempting to fetch the split optimizer states:

1. The no-KV ZCH case
1. The KV ZCH case, but where `self.load_state_dict` is `True` (i.e. fall back to `self._cached_kvzch_data`)
1. The KV ZCH case, where `self.load_state_dict` is `False`, and `self.enable_optimizer_offloading` is false 
1. The KV ZCH case, where `self.load_state_dict` is `False`, and `self.enable_optimizer_offloading` is `True`

This diff handles the KV ZCH with optimizer offloading enabled case (case 4), thus completing handling of all 4 cases in the series

Reviewed By: sryap, emlin

Differential Revision: D77825320
Copy link

netlify bot commented Jul 18, 2025

Deploy Preview for pytorch-fbgemm-docs ready!

Name Link
🔨 Latest commit 296f419
🔍 Latest deploy log https://app.netlify.com/projects/pytorch-fbgemm-docs/deploys/687a951bfab8240009d00564
😎 Deploy Preview https://deploy-preview-4522--pytorch-fbgemm-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D77825320

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.

2 participants