def _get_ready_sharded_checkpoints(
        checkpointer_checkpoints: dict[str, Timestamp],
        remote_files: list[str],
    ) -> dict[str, Timestamp]:
        """Identify checkpoints ready to be evaled based on remote files.

        This has special logic for sharded checkpoints to consider checkpoints composed
        of multiple shards (one per gpu) and metadata

        Args:
            checkpointer_checkpoints: All checkpoints from the checkpointer state
            remote_files: List of remote files in the save folder

        Returns:
            Dict of checkpoints that are complete and ready to be evaled
        """
        # Count the number of shards for each checkpoint group
        remote_file_group_counts = Counter()
        for f in remote_files:
            checkpoint_ts_path = Path(f).parts[-2]
            remote_file_group_counts[checkpoint_ts_path] += 1

        # Check if all shards are present for each checkpoint group
        checkpoints_to_eval = {}
        for checkpoint, checkpoint_ts in checkpointer_checkpoints.items():
            # eg {save_folder}/ep0-ba1/file.blah.
            checkpoint_ts_path = Path(checkpoint).parts[-2]

            # expecting one shard per gpu + 1 for metadata
            expected_shard_count = dist.get_world_size() + 1
            if remote_file_group_counts[checkpoint_ts_path
                                       ] != expected_shard_count:
                log.debug(
                    f'Checkpoint {checkpoint} not fully uploaded (missing shards '
                    +
                    f'{remote_file_group_counts[checkpoint_ts_path]}/{expected_shard_count}), skipping',
                )
                continue

            checkpoints_to_eval[checkpoint_ts_path] = checkpoint_ts

        return checkpoints_to_eval
Identify checkpoints ready to be evaled based on remote files.

        This has special logic for sharded checkpoints to consider checkpoints composed
        of multiple shards (one per gpu) and metadata

        Args:
            checkpointer_checkpoints: All checkpoints from the checkpointer state
            remote_files: List of remote files in the save folder

        Returns:
            Dict of checkpoints that are complete and ready to be evaled
        
llmfoundry/callbacks/async_eval_callback.py