deepspeedai / deepspeedai/DeepSpeed

Why not save frozen params unless: `self.zero_optimization_stage() >= ZeroStageEnum.gradients`?

Open
#5,439 3 comments 0 reactions 1 assignee View on GitHub

@samadejacobs is already working on this.

Since May 13, 2024.

Dominant language
Python
Stars
43.1k
Forks
5k
Avg merge
4d 15h
Merged PRs (30d)
112

Description

I've spent 2 days drilling into why my frozen params aren't getting saved, and it comes down to this line:

https://github.com/microsoft/DeepSpeed/blob/c632ea09f8d107d10f76aa2b776e4df3c1ccf98a/deepspeed/runtime/engine.py#L3297C1-L3297C107

        save_frozen_param = self.zero_optimization_partition_gradients() and not exclude_frozen_parameters

exclude_frozen_parameters is therefore misleading, since that is not the only determinant of whether frozen params get saved.

To make matters more confusing, I am using deepspeed 2, but if I make a breakpoint in that zero_optimization_partiotion_gradients function, I see:

(Pdb) self.zero_optimization_stage()
1
(Pdb) ZeroStageEnum.gradients
<ZeroStageEnum.gradients: 2>

Why is this, and is there a straightforward non-hacky solution to get frozen params to save?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.