class_docstr: Dimensioning properties
docstr: Performs setup and creates an unembedding layer. This implementation assumes
  normalization prior to the LM head projection. If this does not match the model's
  implementation, override this method. This will set the ``self.unembed`` attribute.
docstr_tok: ["Performs","setup","and","creates","an","unembedding","layer",".","This","implementation","assumes","normalization","prior","to","the","LM","head","projection",".","If","this","does","not","match","the","model's","implementation",",","override","this","method",".","This","will","set","the","``","self.unembed","``","attribute","."]
code: def make_unembedding_layer(self) -> None:
      """
      Performs setup and creates an unembedding layer. This implementation assumes
      normalization prior to the LM head projection. If this does not match the model's
      implementation, override this method. This will set the ``self.unembed`` attribute.
      """
      unembed_dim = sharded_unembed_dim(
          self.vocab_size, self.tp_rank, self.tp_size
      )
  
      unembed_config = DSUnembedConfig(
          max_tokens=self._engine_config.state_manager.max_ragged_batch_size,
          max_sequences=self._engine_config.state_manager.max_ragged_sequence_count,
          dtype=self.activation_dtype,
          model_dim=self.model_dim,
          vocab_size=unembed_dim,
          norm_type=self.norm_type,
      )
  
      self.unembed = heuristics.instantiate_unembed(
          unembed_config, self._engine_config
      )
  
      if self.tp_size > 1:
          self._comm_logits = torch.empty(
              self.tp_size,
              self._engine_config.state_manager.max_ragged_sequence_count,
              unembed_dim,
              device=get_accelerator().current_device(),
              dtype=self.activation_dtype.value,
          )
          self._return_logits = torch.empty(
              self._engine_config.state_manager.max_ragged_sequence_count,
              self.vocab_size,
              device=get_accelerator().current_device(),
              dtype=self.activation_dtype.value,
          )
  
imports: from abc import abstractmethod
  from typing import Optional
  import torch
  from deepspeed.accelerator import get_accelerator
  from ..config_v2 import RaggedInferenceEngineConfig
  from ..inference_utils import ActivationType, ceil_div, is_gated
  from ..model_implementations import *
  from ..model_implementations.sharding import *
  from ..modules.configs import DSEmbeddingsConfig, DSLinearConfig, DSMoEConfig, DSNormConfig, DSSelfAttentionConfig, DSUnembedConfig, NormTypeEnum, PositionalEmbeddingType, RotateHalfConfig
  from ..modules import heuristics
  from ..ragged import DSSequenceDescriptor, KVCacheConfig, RaggedBatchWrapper
  from .inference_model_base import DSInferenceModelBase, DSModelImplementationConfig, MPType
  from ..inference_parameter import InferenceParameter
label_desc: Use image node_id 20 for calling the DSTransformerModelBase obj's underlying member method code with example usage: obj.make_unembedding_layer() without return types