Skip to content

Commit 8ae5113

Browse files
committed
fix: Fix minor comment/docstring typos in runtime and inference modules
Signed-off-by: nathon-lee <leejianwoo@gmail.com>
1 parent 5c75f99 commit 8ae5113

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

deepspeed/inference/v2/model_implementations/inference_model_base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ def max_sequence_length(self) -> int:
233233

234234
def maybe_free_kv(self, sequence: DSSequenceDescriptor) -> None:
235235
"""
236-
After completing a forward pass, determine whether or not the there are any KV blocks
236+
After completing a forward pass, determine whether or not there are any KV blocks
237237
that maybe freed since they are no longer in use.
238238
239239
Consider the following example:

deepspeed/runtime/activation_checkpointing/checkpointing.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -704,14 +704,14 @@ def backward(ctx, *grads):
704704
def non_reentrant_checkpoint(function, *args):
705705
"""This function is union of `torch.utils.checkpoint._checkpoint_without_reentrant` and `CheckpointFunction` in this module
706706
707-
This function is aim to solve the back probagation error raised from all input requires no grad.
707+
This function is aim to solve the back propagation error raised from all input requires no grad.
708708
* has already been implemented in pytorch for a while, the solution is stable at most time except for jit module mode.
709709
* can help to solve the issue which is hacked by `deepspeed.runtime.pipe.module.PipelineModule._is_checkpointable`
710710
711711
Main modifications compared to the implementation of torch:
712712
1. adapt to the signature of `checkpoint` function in this module
713713
2. solve the non-deterministic by random state management consistent with deepspeed `CheckpointFunction`
714-
3. when there is partition or cpu checkpointing, gather them in the unpack_hook during back probagation
714+
3. when there is partition or cpu checkpointing, gather them in the unpack_hook during back propagation
715715
4. make all after backward blocks in the hook which will executed after all leaf nodes backward execution.
716716
5. above 4. is inspired by `torch.autograd.graph.register_multi_grad_hook`, which is only implemented after 2.0.0
717717
"""
@@ -801,7 +801,7 @@ def checkpoint_unpack(holder_from_backward):
801801
"""retrieve the activations from recompute"""
802802
nonlocal deepspeed_saved_tensors, non_tensor_args, tensor_flags
803803

804-
# if this is the first step of backward probagation, recompute the graph and save
804+
# if this is the first step of backward propagation, recompute the graph and save
805805
# all the activations with the same order as `checkpoint_pack` does
806806
if len(storage) == 0:
807807
unpack_counter = 0

deepspeed/runtime/data_pipeline/data_sampling/variable_batch_size_and_lr.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ def step(self, epoch=None):
291291

292292
self.base_lr_scheduler.step(epoch) # set unscaled lr, _step_count, last_epoch, _last_lr for new epoch
293293

294-
# scale the learning rate for the the next iteration for each parameter group.
294+
# scale the learning rate for the next iteration for each parameter group.
295295
self.last_epoch = self.last_epoch + 1 if epoch is None else epoch
296296
# batch sizes are precomputed and stored in batch_sizes se we loop around to get the next one
297297
batch_size = self.batch_sizes[self.last_epoch % len(self.batch_sizes)]

0 commit comments

Comments
 (0)