def METHOD_NAME(model_fn, data_gen_fn, output_transform_fn, loss_fn, test_config):
    org_model, org_optimizer, sharded_model, sharded_optimizer, criterion, booster = \
        build_model_from_hybrid_plugin(model_fn, loss_fn, test_config)
    org_loss, org_output, sharded_loss, sharded_output = \
        run_forward_backward_with_hybrid_plugin(
            org_model,
            sharded_model,
            sharded_optimizer,
            data_gen_fn,
            output_transform_fn,
            criterion,
            booster)
    stage_manager = booster.plugin.stage_manager
    tp_group = booster.plugin.tp_group
    # unwrap model
    vit_model = unwrap_model(org_model, 'ViTModel', 'vit')
    shard_vit_model = unwrap_model(sharded_model, 'ViTModel', 'vit')
    # check grad
    row_layer_for_check = ['encoder.layer[0].attention.attention.query', 'embeddings.patch_embeddings.projection']
    col_layer_for_check = ['encoder.layer[0].attention.output.dense']
    # Save gradient tensors for comparison between the original model and the sharded model before optimizer step.
    grads_to_check = {}
    if (stage_manager is None or stage_manager.is_first_stage()) and booster.plugin.zero_stage == 0:
        if test_config['precision'] == 'fp32':
            atol, rtol = 1e-5, 1e-3
        else:
            atol, rtol = 5e-3, 5e-3
        row_layer_grads = get_grad_tensors_for_check(vit_model,
                                                     shard_vit_model,
                                                     row_layer_for_check,
                                                     tp_group,
                                                     atol=atol,
                                                     rtol=rtol,
                                                     dim=0,
                                                     verbose=False)
        col_layer_grads = get_grad_tensors_for_check(vit_model,
                                                     shard_vit_model,
                                                     col_layer_for_check,
                                                     tp_group,
                                                     atol=atol,
                                                     rtol=rtol,
                                                     dim=1,
                                                     verbose=False)
        grads_to_check.update(col_layer_grads)
        grads_to_check.update(row_layer_grads)
    # optimizer executes step
    org_optimizer.step()
    sharded_optimizer.step()
    # check last hidden state & loss
    if stage_manager is None or stage_manager.is_last_stage():
        if test_config['precision'] == 'fp32':
            atol, rtol = 1e-5, 1e-3
        else:
            atol, rtol = 5e-3, 5e-3
        if org_model.__class__.__name__ == 'ViTModel':
            check_output_hidden_state(org_output, sharded_output, stage_manager, atol=atol, rtol=rtol)
        check_loss(org_loss, sharded_loss, atol=atol, rtol=rtol)
    # check weights
    if stage_manager is None or stage_manager.is_first_stage():
        if test_config['precision'] == 'fp32':
            atol, rtol = 5e-3, 1e-3
        else:
            atol, rtol = 5e-3, 5e-3
        check_weight(vit_model,
                     shard_vit_model,
                     col_layer_for_check,
                     tp_group,
                     atol=atol,
                     rtol=rtol,
                     dim=1,
                     verbose=False)
    # check grads
    check_all_grad_tensors(grads_to_check)
    torch.cuda.empty_cache()