Skip to content

Commit

Permalink
tests and precommit
Browse files Browse the repository at this point in the history
  • Loading branch information
jomayeri committed Jul 30, 2024
1 parent bfb86ff commit b3405f0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions deepspeed/runtime/zero/stage3.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ def move_to_cpu(tensor_list):
for tensor in tensor_list:
tensor.data = tensor.data.cpu()


@contextmanager
def unwrap_model_for_generation(model):
"""
Expand Down
2 changes: 2 additions & 0 deletions tests/unit/runtime/zero/test_unwrap_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,13 @@
elif get_accelerator().is_bf16_supported():
config["bf16"] = {"enabled": True}


class TestUnwrapModel(DistributedTest):
# gather across more than 1 gpu
world_size = 2

def test(self):

def hooks_exist(engine):
if engine.optimizer is not None and hasattr(engine.optimizer, "parameter_offload"):
optimizer_offload = engine.optimizer.parameter_offload
Expand Down

0 comments on commit b3405f0

Please sign in to comment.