class_docstr: Contains runtime information for any Determined workflow that uses the ``DeepSpeedTrial``
  API.
  
  With this class, users can do the following things:
  
  1. Wrap DeepSpeed model engines that contain the model, optimizer, lr_scheduler, etc.
     This will make sure Determined can automatically provide gradient aggregation,
     checkpointing and fault tolerance.  In contrast to :class:`determined.pytorch.PyTorchTrial`,
     the user does not need to wrap optimizer and lr_scheduler as that should all be instead
     passed to the DeepSpeed initialize function (see
     https://www.deepspeed.ai/getting-started/#writing-deepspeed-models) when building the
     model engine.
  2. Overwrite a deepspeed config file or dictionary with values from Determined's
     experiment config to ensure consistency in batch size and support hyperparameter tuning.
  3. Set a custom model parallel configuration that should instantiate a
     :class:`determined.pytorch.deepspeed.ModelParallelUnit` dataclass.  We automatically set the
     mpu for data parallel and standard pipeline parallel training.  This should only be needed
     if there is additional model parallelism outside DeepSpeed's supported methods.
  4. Disable data reproducibility checks to allow custom data loaders.
  5. Disable automatic gradient aggregation for non-pipeline-parallel training.
docstr: Returns true if the current batch is the first batch of the epoch.
  
  .. warning::
      Not accurate for variable size epochs.
code: def is_epoch_start(self) -> bool:
      """
      Returns true if the current batch is the first batch of the epoch.
  
      .. warning::
          Not accurate for variable size epochs.
      """
      if self._current_batch_idx is None:
          raise det.errors.InternalException("Training hasn't started.")
      if self._epoch_len is None:
          raise det.errors.InternalException(
              "Training DataLoader uninitialized."
          )
      return self._current_batch_idx % self._epoch_len == 0
  
imports: import contextlib
  import importlib.util
  import json
  import logging
  from typing import Any, Dict, Iterator, List, Optional, Set, Type, Union, cast
  import deepspeed
  import torch
  from deepspeed.runtime import config_utils
  import determined
  from determined import profiler, pytorch
  from determined.pytorch import deepspeed
  from determined.util import merge_dicts
label_desc: Use image node_id 14 for calling the DeepSpeedTrialContext obj's underlying member method code with example usage: obj.is_epoch_start() and returns: unknown