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 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()
    if isinstance(
            all_config['TrainConfig']['learning_rate'], dict
    ) and all_config['TrainConfig']['learning_rate']['type'] == 'CosineAnnealingDecay':
        step = int(
            math.ceil(
                float(args.total_images) / (
                    global_config['batch_size'] * gpu_num)))
        all_config['TrainConfig']['learning_rate']['T_max'] = step
        print('total training steps:', step)
    global data_dir
    data_dir = global_config['data_dir']
    global img_size, resize_size
    img_size = global_config['img_size'] if 'img_size' in global_config else 224
    resize_size = global_config[
        'resize_size'] if 'resize_size' in global_config else 256
    train_dataset = ImageNetDataset(
        mode='train',
        data_dir=data_dir,
        crop_size=img_size,
        resize_size=resize_size)
    batch_sampler = DistributedBatchSampler(
        train_dataset,
        batch_size=global_config['batch_size'],
        shuffle=True,
        drop_last=True)
    train_loader = DataLoader(
        train_dataset,
        places=[place],
        batch_sampler=batch_sampler,
        num_workers=0)
    train_dataloader = reader_wrapper(train_loader, global_config['input_name'])
    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=train_dataloader,
        eval_callback=eval_function if rank_id == 0 else None,
        eval_dataloader=reader_wrapper(
            eval_reader(
                data_dir,
                global_config['batch_size'],
                crop_size=img_size,
                resize_size=resize_size,
                place=place), global_config['input_name']))
    ac.compress()