def METHOD_NAME(model_context, wrapper_name, wrapper_config):
    """
    wrapper_config (Dict[str, Dict], optional): {pair_name: replace_config}
        if None, replace all supported pairs with default replace_config
    """
    if wrapper_config is None:
        wrapper_config = _get_default_replace_config()
    tie_weights = {}
    from atorch.utils.meta_model_utils import _find_tied_weights, _retie_weights
    if hasattr(AutoAccelerateContext, "FSDP_META_INIT"):
        tie_weights = _find_tied_weights(model_context.model)
        model_context.model = model_context.model.to("meta")
    model_context.model = _replace_by_config(
        model_context.model, config=wrapper_config, gpu_used=model_context.gpu_used
    )
    _retie_weights(model_context.model, tie_weights)
    model = model_context.model
    _enable_flash_attn_by_attr(model)
    model_context.model = model
    return model_context