def from_native_module(module: Attention, process_group, *args, **kwargs) -> Attention:
        """
        Convert a native RMSNorm module to colossalai layer norm module,
        and optionally mark parameters for gradient aggregation.

        Args:
            module (nn.Module): The native RMSNorm module to be converted.
            sp_partial_derived (bool): Whether this module's gradients are partially derived in sequence parallelism.

        Returns:
            nn.Module: The RMSNorm module.
        """

        # Since gradients are computed using only a subset of the data,
        # aggregation of these gradients is necessary during backpropagation.
        # Therefore, we annotate these parameters in advance to indicate the need for gradient aggregation.
        SeqParallelUtils.marked_as_sp_partial_derived_param(module.to_q.weight)
        SeqParallelUtils.marked_as_sp_partial_derived_param(module.to_k.weight)
        SeqParallelUtils.marked_as_sp_partial_derived_param(module.to_v.weight)

        if module.to_q.bias is not None:
            SeqParallelUtils.marked_as_sp_partial_derived_param(module.to_q.bias)
            SeqParallelUtils.marked_as_sp_partial_derived_param(module.to_k.bias)
            SeqParallelUtils.marked_as_sp_partial_derived_param(module.to_v.bias)

        module.set_processor(MemEfficientRingAttnProcessor(process_group))

        return module

        Convert a native RMSNorm module to colossalai layer norm module,
        and optionally mark parameters for gradient aggregation.

        Args:
            module (nn.Module): The native RMSNorm module to be converted.
            sp_partial_derived (bool): Whether this module's gradients are partially derived in sequence parallelism.

        Returns:
            nn.Module: The RMSNorm module.
        
opensora/models/hunyuan_vae/distributed.py