class_docstr: A helper class to handle all-reduce operations in a data parallel group.
  A all-reduce collective communication will be operated in
  :func:`handle_gradient` among a data parallel group.
  For better performance, it bucketizes the gradients of all parameters that are
  the same type to improve the efficiency of communication.
  
  Args:
      model (Module): Model where the gradients accumulate.
      optimizer (Optimizer): Optimizer for updating the parameters.
docstr: A method running a all-reduce operation in a data parallel group.
docstr_tok: ["A","method","running","a","all-reduce","operation","in","a","data","parallel","group","."]
code: def handle_gradient(self):
      """A method running a all-reduce operation in a data parallel group."""
      if gpc.get_world_size(ParallelMode.SEQUENCE_DP) > 1:
          bucket_allreduce(
              param_list=self._model.parameters(),
              group=gpc.get_group(ParallelMode.SEQUENCE_DP),
          )
  
file_path: colossalai/colossalai/legacy/engine/gradient_handler/_sequence_parallel_gradient_handler.py
imports: from colossalai.legacy.context.parallel_mode import ParallelMode
  from colossalai.legacy.core import global_context
  from colossalai.legacy.registry import GRADIENT_HANDLER
  from ._base_gradient_handler import BaseGradientHandler
  from .utils import bucket_allreduce
label_desc: Use image node_id 1 for calling the SequenceParallelGradientHandler obj's underlying member method code with example usage: obj.handle_gradient() without return types