async def benchmark_predict(
        self,
        inputs: Optional[Dict[str, Any]] = None,
        iterations: int = 1,
        warmup: bool = False,
    ) -> "MLModelBenchmarker.Measurement":
        """
        Measures the prediction time of the model.

        This method loads the model, then runs predictions multiple times, measuring
        the duration of each prediction. It supports an optional warmup iteration.

        Parameters
        ----------
        inputs : Optional[Dict[str, Any]]
            The input data for the model prediction. If None, random input data will be generated.

        iterations: int
            The number of prediction iterations to run. Defaults to 1.

        warmup: bool
            Whether to perform a warmup iteration. Defaults to False.

        Returns
        -------
        MLModelBenchmarker.Measurement
            A Measurement object containing statistics and
            samples of the prediction durations in milliseconds.

        Raises:
            ValueError: If the number of iterations is less than 1.

        Note:
            This method is asynchronous and should be awaited when called.
            The warmup iteration, if enabled, is not included in the returned measurements.
        """
        if iterations < 1:
            raise ValueError("The number of iterations must be at least 1. Received: {iterations}")

        if self._loaded_model is None:
            loaded_model = await MLModelBenchmarker._create_loaded_model(
                model=self.model,
                device=self.device,
            )

            self._loaded_model = loaded_model

        if inputs is None:
            inputs = _gen_random_inputs(model_description=self.model_spec.description)

        return await MLModelBenchmarker._benchmark_model_predict(
            model=self._loaded_model,
            iterations=iterations,
            inputs=inputs,
            warmup=warmup,
        )

        Measures the prediction time of the model.

        This method loads the model, then runs predictions multiple times, measuring
        the duration of each prediction. It supports an optional warmup iteration.

        Parameters
        ----------
        inputs : Optional[Dict[str, Any]]
            The input data for the model prediction. If None, random input data will be generated.

        iterations: int
            The number of prediction iterations to run. Defaults to 1.

        warmup: bool
            Whether to perform a warmup iteration. Defaults to False.

        Returns
        -------
        MLModelBenchmarker.Measurement
            A Measurement object containing statistics and
            samples of the prediction durations in milliseconds.

        Raises:
            ValueError: If the number of iterations is less than 1.

        Note:
            This method is asynchronous and should be awaited when called.
            The warmup iteration, if enabled, is not included in the returned measurements.
        
coremltools/models/ml_program/experimental/perf_utils.py