Benchmark Model

benchmark_model(self, input_model_path: str, target_device_name: DeviceName, target_software_version: str | SoftwareVersion | None = None, target_hardware_type: str | HardwareType | None = None, wait_until_done: bool = True, sleep_interval: int = 30) BenchmarkerMetadata

Benchmark the specified model on the specified device.

Parameters:
  • input_model_path (str) – The file path where the model is located.

  • target_device_name (DeviceName) – Target device name.

  • target_software_version (Union[str, SoftwareVersion], optional) – Target software version. Required if target_device_name is one of the Jetson devices.

  • target_hardware_type (Union[str, HardwareType], optional) – Hardware type. Acceleration options for processing the model inference.

  • wait_until_done (bool) – If True, wait for the benchmark result before returning the function. If False, request the benchmark and return the function immediately.

Raises:

e – If an error occurs during the benchmarking of the model.

Returns:

Benchmark metadata.

Return type:

BenchmarkerMetadata

Example

from netspresso import NetsPresso
from netspresso.enums import DeviceName, SoftwareVersion


netspresso = NetsPresso(email="YOUR_EMAIL", password="YOUR_PASSWORD")

benchmarker = netspresso.benchmarker_v2()
benchmark_task = benchmarker.benchmark_model(
    input_model_path="./outputs/converted/TENSORRT_JETSON_AGX_ORIN_JETPACK_5_0_1/TENSORRT_JETSON_AGX_ORIN_JETPACK_5_0_1.trt",
    target_device_name=DeviceName.JETSON_AGX_ORIN,
    target_software_version=SoftwareVersion.JETPACK_5_0_1,
)