Trace Extension — NVIDIA Triton Inference Server (original) (raw)

This document describes Triton’s trace extension. The trace extension enables the client to configure the trace settings during a Triton run. Because this extension is supported, Triton reports “trace” in the extensions field of its Server Metadata.

HTTP/REST#

In all JSON schemas shown in this document $number, $string, $boolean,$object and $array refer to the fundamental JSON types. #optionalindicates an optional JSON field.

Triton exposes the trace endpoint at the following URL. The client may use HTTP GET request to retrieve the current trace setting. A HTTP POST request will modify the trace setting, and the endpoint will return the updated trace setting on success or an error in the case of failure. Optional model name can be provided to get or to set the trace settings for specific model.

GET v2[/models/${MODEL_NAME}]/trace/setting

POST v2[/models/${MODEL_NAME}]/trace/setting

Trace Setting Response JSON Object#

A successful trace setting request is indicated by a 200 HTTP status code. The response object, identified as $trace_setting_response, is returned in the HTTP body for every successful trace setting request.

$trace_setting_response = { $trace_setting, ... } tracesetting=trace_setting = tracesetting=string : string∣[string | [ string[string, ...]

Each $trace_setting JSON describes a “name”/”value” pair, where the “name” is the name of the trace setting and the “value” is a $string representation of the setting value, or an array of $string for some settings. Currently the following trace settings are defined:

Trace Setting Response JSON Error Object#

A failed trace setting request will be indicated by an HTTP error status (typically 400). The HTTP body must contain the$trace_setting_error_response object.

$trace_setting_error_response = { "error": $string }

Trace Setting Request JSON Object#

A trace setting request is made with a HTTP POST to the trace endpoint. In the corresponding response the HTTP body contains the response JSON. A successful request is indicated by a 200 HTTP status code.

The request object, identified as $trace_setting_request must be provided in the HTTP body.

$trace_setting_request = { $trace_setting, ... }

The $trace_setting JSON is defined inTrace Setting Response JSON Object, only the specified settings will be updated. In addition to the values mentioned in response JSON object, JSON null value may be used to remove the specification of the trace setting. In such case, the current global setting will be used. Similarly, if this is the first request to initialize a model trace settings, for the trace settings that are not specified in the request, the current global setting will be used.

GRPC#

For the trace extension Triton implements the following API:

service GRPCInferenceService { …

// Update and get the trace setting of the Triton server. rpc TraceSetting(TraceSettingRequest) returns (TraceSettingResponse) {} }

The Trace Setting API returns the latest trace settings. Errors are indicated by the google.rpc.Status returned for the request. The OK code indicates success and other codes indicate failure. The request and response messages for Trace Setting are:

message TraceSettingRequest { // The values to be associated with a trace setting. // If no value is provided, the setting will be clear and // the global setting value will be used. message SettingValue { repeated string value = 1; }

// The new setting values to be updated, // settings that are not specified will remain unchanged. map<string, SettingValue> settings = 1;

// The name of the model to apply the new trace settings. // If not given, the new settings will be applied globally. string model_name = 2; }

message TraceSettingResponse { message SettingValue { repeated string value = 1; }

// The latest trace settings. map<string, SettingValue> settings = 1; }

The trace settings are mentioned inTrace Setting Response JSON Object. Note that if this is the first request to initialize a model trace settings, for the trace settings that are not specified in the request, the value will be copied from the current global settings.