code: def base_architecture(args):
      # specify a small value (300) which meet the needs of most NLP datasets, to avoid OOM error
      args.max_source_positions = min(
          MAX_SEQ_LENGTH,
          getattr(args, "max_source_positions", MAX_SEQ_LENGTH),
      )
      args.max_target_positions = min(
          MAX_SEQ_LENGTH,
          getattr(args, "max_target_positions", MAX_SEQ_LENGTH),
      )
  
      args.encoder_embed_path = getattr(
          args, "encoder_embed_path", None
      )
      args.encoder_embed_dim = getattr(args, "encoder_embed_dim", 512)
      args.encoder_ffn_embed_dim = getattr(
          args, "encoder_ffn_embed_dim", 2048
      )
      args.encoder_layers = getattr(args, "encoder_layers", 6)
      args.encoder_attention_heads = getattr(
          args, "encoder_attention_heads", 8
      )
      args.encoder_normalize_before = getattr(
          args, "encoder_normalize_before", False
      )
      args.encoder_learned_pos = getattr(
          args, "encoder_learned_pos", False
      )
      args.decoder_embed_path = getattr(
          args, "decoder_embed_path", None
      )
      args.decoder_embed_dim = getattr(
          args, "decoder_embed_dim", args.encoder_embed_dim
      )
      args.decoder_ffn_embed_dim = getattr(
          args, "decoder_ffn_embed_dim", args.encoder_ffn_embed_dim
      )
      args.decoder_layers = getattr(args, "decoder_layers", 6)
      args.decoder_attention_heads = getattr(
          args, "decoder_attention_heads", 8
      )
      args.decoder_normalize_before = getattr(
          args, "decoder_normalize_before", False
      )
      args.decoder_learned_pos = getattr(
          args, "decoder_learned_pos", False
      )
      args.attention_dropout = getattr(args, "attention_dropout", 0.0)
      args.activation_dropout = getattr(args, "activation_dropout", 0.0)
      args.activation_fn = getattr(args, "activation_fn", "relu")
      args.dropout = getattr(args, "dropout", 0.1)
      args.adaptive_softmax_cutoff = getattr(
          args, "adaptive_softmax_cutoff", None
      )
      args.adaptive_softmax_dropout = getattr(
          args, "adaptive_softmax_dropout", 0
      )
      args.share_decoder_input_output_embed = getattr(
          args, "share_decoder_input_output_embed", False
      )
      args.share_all_embeddings = getattr(
          args, "share_all_embeddings", False
      )
      args.no_token_positional_embeddings = getattr(
          args, "no_token_positional_embeddings", False
      )
      args.adaptive_input = getattr(args, "adaptive_input", False)
      args.no_cross_attention = getattr(
          args, "no_cross_attention", False
      )
      args.cross_self_attention = getattr(
          args, "cross_self_attention", False
      )
  
      args.decoder_output_dim = getattr(
          args, "decoder_output_dim", args.decoder_embed_dim
      )
      args.decoder_input_dim = getattr(
          args, "decoder_input_dim", args.decoder_embed_dim
      )
  
      args.no_scale_embedding = getattr(
          args, "no_scale_embedding", False
      )
      args.layernorm_embedding = getattr(
          args, "layernorm_embedding", False
      )
      args.tie_adaptive_weights = getattr(
          args, "tie_adaptive_weights", False
      )
      args.checkpoint_activations = getattr(
          args, "checkpoint_activations", False
      )
      args.offload_activations = getattr(
          args, "offload_activations", False
      )
      if args.offload_activations:
          args.checkpoint_activations = True
      args.encoder_layers_to_keep = getattr(
          args, "encoder_layers_to_keep", None
      )
      args.decoder_layers_to_keep = getattr(
          args, "decoder_layers_to_keep", None
      )
      args.encoder_layerdrop = getattr(args, "encoder_layerdrop", 0)
      args.decoder_layerdrop = getattr(args, "decoder_layerdrop", 0)
      args.quant_noise_pq = getattr(args, "quant_noise_pq", 0)
      args.quant_noise_pq_block_size = getattr(
          args, "quant_noise_pq_block_size", 8
      )
      args.quant_noise_scalar = getattr(args, "quant_noise_scalar", 0)
  
imports: import torch
  import torch.nn
  from fairseq import utils
  from fairseq.models import FairseqEncoder, FairseqEncoderDecoderModel, FairseqIncrementalDecoder, register_model, register_model_architecture
  from fairseq.models.fairseq_encoder import EncoderOut
  from fairseq.modules import LayerNorm
  from lightseq.training.ops.pytorch.layer_base import TransformerEmbeddingLayerBase
  from lightseq.training.ops.pytorch.quantization import QuantLinear, disable_quant, enable_quant, ptq_mode, qat_mode
label_desc: Use image node_id 2 for calling a global function with example usage: base_architecture(args) without return types