Skip to content

Profiler

Description

netspresso.profiler.profiler.Profiler

Bases: NetsPressoBase

__init__(token_handler, user_info)

Initialize the Profiler.

cancel_profile_task(profile_task_id)

Cancel the profile task with given profile task uuid.

Parameters:

Name Type Description Default
profile_task_id str

Profile task UUID of the profile task.

required

Raises:

Type Description
e

If an error occurs during the task cancel.

Returns:

Name Type Description
BenchmarkTask BenchmarkTask

Model profile task dictionary.

get_profile_task(profile_task_id)

Get information about the specified profile task using the profile task UUID.

Parameters:

Name Type Description Default
profile_task_id str

Profile task UUID of the profile task.

required

Raises:

Type Description
e

If an error occurs while retrieving information about the profile task.

Returns:

Name Type Description
BenchmarkTask BenchmarkTask

Model profile task object.

profile_model(input_model_path, target_device_name, target_software_version=None, target_hardware_type=None, wait_until_done=True, sleep_interval=30)

Profile the specified model on the specified device.

Parameters:

Name Type Description Default
input_model_path str

The file path where the model is located.

required
target_device_name DeviceName

Target device name.

required
target_software_version Union[str, SoftwareVersion]

Target software version. Required if target_device_name is one of the Jetson devices.

None
target_hardware_type Union[str, HardwareType]

Hardware type. Acceleration options for processing the model inference.

None
wait_until_done bool

If True, wait for the profile result before returning the function. If False, request the profile and return the function immediately.

True

Raises:

Type Description
e

If an error occurs during the profiling of the model.

Returns:

Name Type Description
ProfilerMetadata ProfilerMetadata

Profiler metadata.

Examples

Profiling converted model on Jetson AGX Orin

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


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

profiler = netspresso.profiler()
profiling_task = profiler.profile_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,
)