code: def linear_with_frozen_weight(
      input: torch.Tensor,
      weight: torch.Tensor,
      bias: Optional[torch.Tensor],
      gradient_accumulation_fusion: bool,
      async_grad_allreduce: bool,
      sequence_parallel: bool,
  ) -> torch.Tensor:
      """Linear layer execution with weight.requires_grad == False.
  
      This function handles linear layers with weight frozen (untrainable).
      In the forward, it only saves weight and does not save input activations.
      In the backward, it does not perform weight gradient calculation, or
      weight gradient allreduce.
  
      Arguments:
  
      input (torch.Tensor required): input like torch.nn.functional.linear
  
      weight (torch.Tensor required): weight like torch.nn.functional.linear
  
      bias (torch.Tensor optional): bias like torch.nn.functional.linear
  
      gradient_accumulation_fusion (bool required): dummy argument, used to
      keep the API unified between all forward implementation functions.
  
      async_grad_allreduce (bool required): dummy argument, used to
      keep the API unified between all forward implementation functions.
  
      sequence_parallel (bool required): Indicates that sequence
          parallelism is used and thus in the forward pass the input is
          all gathered, and the backward pass the input gradients are
          reduce scattered.
      """
  
      if sequence_parallel:
          input = gather_from_sequence_parallel_region(
              input, tensor_parallel_output_grad=True
          )
      else:
          input = input
  
      args = [
          input,
          weight,
          bias,
      ]
  
      return LinearWithFrozenWeight.apply(*args)
  
imports: import math
  import os
  import warnings
  from typing import Callable, Optional
  import torch
  import torch.nn.functional
  import torch.nn.init
  from torch.cuda.amp import custom_bwd, custom_fwd
  from torch.nn.parameter import Parameter
  from megatron.core.model_parallel_config import ModelParallelConfig
  from megatron.core.parallel_state import get_global_memory_buffer, get_tensor_model_parallel_group, get_tensor_model_parallel_rank, get_tensor_model_parallel_world_size
  from .mappings import copy_to_tensor_model_parallel_region, gather_from_sequence_parallel_region, gather_from_tensor_model_parallel_region, reduce_from_tensor_model_parallel_region, reduce_scatter_to_sequence_parallel_region, scatter_to_tensor_model_parallel_region
  from .random import get_cuda_rng_tracker, get_expert_parallel_rng_tracker_name
  from .utils import VocabUtility, divide, split_tensor_along_last_dim
label_desc: Use image node_id 7 for calling a global function with example usage: linear_with_frozen_weight(input, weight, bias, gradient_accumulation_fusion, async_grad_allreduce, sequence_parallel) and returns: LinearWithFrozenWeight