def METHOD_NAME():
    rank_id = paddle.distributed.get_rank()
    if args.devices == 'gpu':
        place = paddle.CUDAPlace(rank_id)
        paddle.set_device('gpu')
    else:
        place = paddle.CPUPlace()
        paddle.set_device('cpu')
    global all_config, global_config
    all_config = load_slim_config(args.config_path)
    assert "Global" in all_config, f"Key 'Global' not found in config file. \n{all_config}"
    global_config = all_config["Global"]
    gpu_num = paddle.distributed.get_world_size()
    train_dataloader = build_dataloader(all_config, 'Train', args.devices,
                                        logger)
    global val_loader
    val_loader = build_dataloader(all_config, 'Eval', args.devices, logger)
    if isinstance(all_config['TrainConfig']['learning_rate'],
                  dict) and all_config['TrainConfig']['learning_rate'][
                      'type'] == 'CosineAnnealingDecay':
        steps = len(train_dataloader) * all_config['TrainConfig']['epochs']
        all_config['TrainConfig']['learning_rate']['T_max'] = steps
        print('total training steps:', steps)
    global_config['input_name'] = get_feed_vars(
        global_config['model_dir'], global_config['model_filename'],
        global_config['params_filename'])
    ac = AutoCompression(
        model_dir=global_config['model_dir'],
        model_filename=global_config['model_filename'],
        params_filename=global_config['params_filename'],
        save_dir=args.save_dir,
        config=all_config,
        train_dataloader=reader_wrapper(train_dataloader,
                                        global_config['input_name']),
        eval_callback=eval_function if rank_id == 0 else None,
        eval_dataloader=reader_wrapper(val_loader, global_config['input_name']))
    ac.compress()