class_docstr: Large-scale distributed sampling face recognition training Module, of course sampling is an option,
  There will be no loss of accuracy in sampling in large-scale identities training tasks, uses only
  8 NVIDIA RTX2080Ti to complete classification tasks with 10 millions of identities, 64 NVIDIA
  RTX2080Ti can complete classification tasks with 100 million of identities.
  
  See the original paper:
  https://arxiv.org/abs/2203.15565
  
  Parameters
  ----------
  symbol: Symbol
      Backbone symbol.
  fc7_model: Object
      Object of margin loss.
  memory_bank: Memory bank Object.
      Object of memory bank, which maintain local class centers and their momentum.
  memory_optimizer: Optimizer object.
      The updater of memory bank, default is sgd optimizer.
  logger:
code: def __init__(
      self,
      symbol,
      fc7_model,
      memory_bank,
      memory_optimizer,
      logger=logging,
  ):
      self.size = hvd.size()
      self.rank = hvd.rank()
      self.local_rank = hvd.local_rank()
      self.gpu = mx.gpu(self.local_rank)
      self.cpu = mx.cpu()  # `device_id` is not needed for CPU.
      self.nd_cache = {}
      self.embedding_size = config.embedding_size
      self.batch_size = config.batch_size
      self.num_update = 0
      self.batch_end_param = namedtuple(
          "batch_end_param", ["loss", "num_epoch", "num_update"]
      )
  
      self.fc7_model = fc7_model
      self.symbol = symbol
      self.logger = logger
      self.backbone_module = mx.module.Module(
          self.symbol,
          ["data"],
          ["softmax_label"],
          logger=self.logger,
          context=self.gpu,
      )
  
      self.memory_bank = memory_bank
      self.memory_optimizer = memory_optimizer
      self.memory_lr = None
      self.loss_cache = None
      self.grad_cache = None
  
imports: import logging
  import warnings
  from collections import namedtuple
  import horovod.mxnet
  import mxnet
  import mxnet.ndarray
  import numpy
  from default import config
  from optimizer import DistributedOptimizer
label_desc: Use image node_id 1 to create a new SampleDistributeModule object from inherited base classes: object with example: obj = SampleDistributeModule(symbol, fc7_model, memory_bank, memory_optimizer, logger)