docstr: Build a new model instance.
docstr_tok: ["Build","a","new","model","instance","."]
code: def build_model(cls, args, task):
      """Build a new model instance."""
  
      # make sure all arguments are present
      base_architecture(args)
  
      task.source_dictionary.pad_to_multiple_(
          args.model_parallel_size * 8
      )
      task.target_dictionary.pad_to_multiple_(
          args.model_parallel_size * 8
      )
  
      if not hasattr(args, "max_positions"):
          args.max_positions = args.tokens_per_sample
  
      if getattr(args, "untie_weights_roberta", False):
          raise NotImplementedError(
              "--untie-weights-roberta is not supported in model parallel mode"
          )
  
      encoder = ModelParallelRobertaEncoder(
          args, task.source_dictionary
      )
      return cls(args, encoder)
  
imports: import logging
  import torch
  import torch.nn
  import torch.nn.functional
  from fairseq import utils
  from fairseq.model_parallel.models.transformer import ModelParallelTransformerEncoder
  from fairseq.models import register_model, register_model_architecture
  from fairseq.models.roberta import roberta_base_architecture, roberta_prenorm_architecture, RobertaEncoder, RobertaModel
  from fairseq.modules import LayerNorm
label_desc: Use image node_id 3 for calling the ModelParallelRobertaModel obj's underlying member method code with example usage: obj.build_model(cls, args, task) and returns: cls