def METHOD_NAME(resources):
    """A simple runtime model for Resnet50."""
    # 3.8 G Multiply-Adds, 2 FLOPs per MADD, 3 for fwd+bwd.
    flops_for_one_image = 3.8 * (10**9) * 2 * 3
    def _v100(num_v100s):
        # Adds communication overheads per step (in seconds).
        communication_slack = 0.0
        if num_v100s == 4:
            communication_slack = 0.15
        elif num_v100s == 8:
            communication_slack = 0.30
        max_per_device_batch_size = 256
        effective_batch_size = max_per_device_batch_size * num_v100s
        # 112590 steps, 1024 BS = 90 epochs.
        total_steps = 112590 * (1024.0 / effective_batch_size)
        flops_for_one_batch = flops_for_one_image * max_per_device_batch_size
        # 27 TFLOPs, harmonic mean b/t 15TFLOPs (single-precision) & 120 TFLOPs
        # (16 bit).
        utilized_flops = 27 * (10**12)
        # print('****** trying 1/3 util for v100')
        utilized_flops = 120 * (10**12) / 3
        estimated_step_time_seconds = flops_for_one_batch / utilized_flops \
          + communication_slack
        estimated_run_time_seconds = estimated_step_time_seconds * total_steps
        return estimated_run_time_seconds
    if isinstance(resources.cloud, sky.AWS):
        instance = resources.instance_type
        if instance == 'p3.2xlarge':
            num_v100s = 1
        elif instance == 'p3.8xlarge':
            num_v100s = 4
        elif instance == 'p3.16xlarge':
            num_v100s = 8
        else:
            assert False, 'Not supported: {}'.format(resources)
        return _v100(num_v100s)
    elif isinstance(resources.cloud, sky.GCP):
        accelerators = resources.accelerators
        if accelerators is None:
            assert False, 'not supported'
        assert len(accelerators) == 1, resources
        for acc, acc_count in accelerators.items():
            break
        if acc == 'V100':
            assert acc_count in [1, 2, 4, 8], resources
            return _v100(acc_count)
        assert acc == 'tpu-v3-8', resources
        tpu_v3_8_flops = 420 * (10**12)
        known_resnet50_utilization = 0.445  # From actual profiling.
        # GPU - fixed to 1/3 util
        # TPU
        #  - 1/4 util: doesn't work
        #  - 1/3 util: works
        #  - 1/2 util: works
        # print('*** trying hand written util for TPU')
        known_resnet50_utilization = 1 / 3
        max_per_device_batch_size = 1024
        total_steps = 112590  # 112590 steps, 1024 BS = 90 epochs.
        flops_for_one_batch = flops_for_one_image * max_per_device_batch_size
        utilized_flops = tpu_v3_8_flops * known_resnet50_utilization
        estimated_step_time_seconds = flops_for_one_batch / utilized_flops
        estimated_run_time_seconds = estimated_step_time_seconds * total_steps
        logger.debug('  tpu-v3-8 estimated_step_time_seconds %f',
                     estimated_step_time_seconds)
        return estimated_run_time_seconds
    else:
        assert False, 'not supported cloud in prototype: {}'.format(
            resources.cloud)