MCPcopy Create free account
hub / github.com/deepspeedai/DeepSpeed / _split_global_input

Method _split_global_input

deepspeed/runtime/zero/tiling.py:156–168  ·  view source on GitHub ↗

Partition an input tensor along the last dimension, aligned with given splits. Subclasses should override this method to account for new input types. Args: input (List[Tensor]): The tensor to partition along the last dimension. split_sizes (List[int]): The s

(self, input, split_sizes)

Source from the content-addressed store, hash-verified

154 return outputs
155
156 def _split_global_input(self, input, split_sizes):
157 """Partition an input tensor along the last dimension, aligned with given splits.
158
159 Subclasses should override this method to account for new input types.
160
161 Args:
162 input (List[Tensor]): The tensor to partition along the last dimension.
163 split_sizes (List[int]): The size of each partition.
164
165 Returns:
166 List[Any]: A list of the chunks of ``input``.
167 """
168 return split_tensor_along_last_dim(input, split_sizes)
169
170 def _reduce_local_output(self, in_id, out_id, current_out, new_out):
171 """Reduce (sum) a new local result into the existing local results.

Callers 1

forwardMethod · 0.95

Calls 1

Tested by

no test coverage detected