Skip to content

Commit 3948525

Browse files
authored
feat: Per-model metric customization (#126)
1 parent 578491f commit 3948525

File tree

2 files changed

+87
-1
lines changed

2 files changed

+87
-1
lines changed

include/triton/common/error.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2626
#pragma once
2727

28-
#include <string>
2928
#include <cstdint>
29+
#include <string>
3030

3131
namespace triton { namespace common {
3232

protobuf/model_config.proto

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1869,6 +1869,85 @@ message ModelResponseCache
18691869
bool enable = 1;
18701870
}
18711871

1872+
//@@
1873+
//@@ .. cpp:var:: message ModelMetrics
1874+
//@@
1875+
//@@ The metrics setting of this model.
1876+
//@@ NOTE: Consider reusing this message body for backend metric custom
1877+
//@@ configuration.
1878+
//@@
1879+
message ModelMetrics
1880+
{
1881+
//@@
1882+
//@@ .. cpp:var:: message MetricControl
1883+
//@@
1884+
//@@ Override metrics settings of this model.
1885+
//@@
1886+
message MetricControl
1887+
{
1888+
//@@
1889+
//@@ .. cpp:var:: message MetricIdentifier
1890+
//@@
1891+
//@@ Specify metrics to be overridden with metric_option.
1892+
//@@
1893+
message MetricIdentifier
1894+
{
1895+
//@@ .. cpp:var:: string family
1896+
//@@
1897+
//@@ The name of the metric family to override with the custom value.
1898+
//@@ All core histogram metrics reported by Triton are customizable.
1899+
//@@
1900+
// https://github.com/triton-inference-server/server/blob/main/docs/user_guide/metrics.md#histograms
1901+
//@@
1902+
string family = 1;
1903+
}
1904+
1905+
//@@ .. cpp:var:: message HistogramOptions
1906+
//@@
1907+
//@@ Histogram metrics options.
1908+
//@@
1909+
message HistogramOptions
1910+
{
1911+
//@@ .. cpp:var:: double buckets (repeated)
1912+
//@@
1913+
//@@ Repeated double type in ascending order for histogram bucket
1914+
//@@ boundaries. Each bucket value represents a range less than or
1915+
//@@ equal to itself. The range greater than the largest bucket value
1916+
//@@ is allocated implicitly.
1917+
//@@ For example, [ -5.0, -2, 0, 3.5, 5 ].
1918+
//@@
1919+
repeated double buckets = 1;
1920+
}
1921+
1922+
//@@ .. cpp:var:: MetricIdentifier metric_identifier
1923+
//@@
1924+
//@@ The identifier defining metrics to be overridden with the
1925+
//@@ metric_options.
1926+
//@@
1927+
MetricIdentifier metric_identifier = 1;
1928+
1929+
//@@ .. cpp:var:: oneof metric_options
1930+
//@@
1931+
//@@ The value to override the metrics defined in metric_identifier.
1932+
//@@
1933+
oneof metric_options
1934+
{
1935+
//@@ .. cpp:var:: HistogramOptions histogram_options
1936+
//@@
1937+
//@@ Histogram options.
1938+
//@@
1939+
HistogramOptions histogram_options = 2;
1940+
}
1941+
}
1942+
1943+
//@@
1944+
//@@ .. cpp::var:: MetricControl metric_control (repeated)
1945+
//@@
1946+
//@@ Optional custom configuration for selected metrics.
1947+
//@@
1948+
repeated MetricControl metric_control = 1;
1949+
}
1950+
18721951
//@@
18731952
//@@.. cpp:var:: message ModelConfig
18741953
//@@
@@ -2076,4 +2155,11 @@ message ModelConfig
20762155
//@@ model.
20772156
//@@
20782157
ModelResponseCache response_cache = 24;
2158+
2159+
//@@ .. cpp:var:: ModelMetrics model_metrics
2160+
//@@
2161+
//@@ Optional setting for custom metrics configuration for this model.
2162+
//@@ Application default is applied to metrics that are not specified.
2163+
//@@
2164+
ModelMetrics model_metrics = 26;
20792165
}

0 commit comments

Comments
 (0)