Giter Club home page Giter Club logo

local_cache's Introduction

License

Triton Local Cache

This repo contains an example TRITONCACHE API implementation for caching data locally in-memory.

Ask questions or report problems in the main Triton issues page.

Build the Cache

Use a recent cmake to build. First install the required dependencies.

$ apt-get install libboost-dev rapidjson-dev

To build the cache:

$ mkdir build
$ cd build
$ cmake -DCMAKE_INSTALL_PREFIX:PATH=`pwd`/install ..
$ make install

The following required Triton repositories will be pulled and used in the build. By default the "main" branch/tag will be used for each repo but the following CMake arguments can be used to override.

  • triton-inference-server/core: -D TRITON_CORE_REPO_TAG=[tag]
  • triton-inference-server/common: -D TRITON_COMMON_REPO_TAG=[tag]

Configuring the Cache

Like other TRITONCACHE implementations, this cache is configured through the tritonserver --cache-config CLI arg or through the TRITONSERVER_SetCacheConfig API.

Currently, the following config fields are supported:

  • size: The fixed size (in bytes) of CPU memory allocated to the cache upfront. If this value is too large (ex: greater than available memory) or too small (ex: smaller than required overhead such as ~1-2 KB), initialization may fail.
    • example: tritonserver --cache-config local,size=1048576

Metrics

When TRITON_ENABLE_METRICS is enabled in this cache (enabled by default), it will check to see if the running Triton server has metrics enabled as well. If so, the cache will publish additional cache-specific metrics to Triton's metrics endpoint through the Custom Metrics API.

Cache Metrics

The following metrics are reported by this cache implementation:

Category Metric Metric Name Description Granularity Frequency
Utilization Total Cache Utilization nv_cache_util Total cache utilization rate (0.0 - 1.0) Server-wide Per interval
Count Total Cache Entry Count nv_cache_num_entries Total number of entries stored in cache Server-wide Per interval
Total Cache Lookup Count nv_cache_num_lookups Total number of cache lookups done by Triton Server-wide Per interval
Total Cache Hit Count nv_cache_num_hits Total number of cache hits Server-wide Per interval
Total Cache Miss Count nv_cache_num_misses Total number of cache misses Server-wide Per interval
Total Cache Eviction Count nv_cache_num_evictions Total number of cache evictions Server-wide Per interval
Latency Total Cache Lookup Time nv_cache_lookup_duration Cumulative time spent doing cache lookups (microseconds) Server-wide Per interval
Total Cache Insertion Time nv_cache_insertion_duration Cumulative time spent doint cache insertions (microseconds) Server-wide Per interval

local_cache's People

Contributors

dyastremsky avatar guanluo avatar nv-kmcgill53 avatar rmccorm4 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

local_cache's Issues

Local cache on sagemaker

Experiencing this error when starting a sagemaker endpoint with local-cache:
error: creating server: Invalid argument - unable to find 'libtritoncache_local.so' for cache. Searched: /opt/tritonserver/caches

endpoint image: 746233611703.dkr.ecr.eu-central-1.amazonaws.com/sagemaker-tritonserver:23.12-py3
environment variables:

"Environment": {
                "SAGEMAKER_TRITON_DEFAULT_MODEL_NAME": "ensemble",
                "SAGEMAKER_TRITON_THREAD_COUNT": "10",
                "SAGEMAKER_TRITON_LOG_INFO": "true",
                "SAGEMAKER_TRITON_LOG_VERBOSE": "true",
                
                "SAGEMAKER_TRITON_ALLOW_METRICS": "true",
                "SAGEMAKER_TRITON_PUBLISH_METRICS_TO_CLOUDWATCH": "true",
                "SAGEMAKER_TRITON_CLOUDWATCH_LOG_GROUP": f"/aws/SageMaker/Endpoints/TritonMetrics/{EXPERIMENT}",
                "SAGEMAKER_TRITON_CLOUDWATCH_METRIC_NAMESPACE": f"/aws/SageMaker/Endpoints/TritonMetrics/{EXPERIMENT}",
                "SAGEMAKER_TRITON_METRICS_PORT": "22000",
                "SAGEMAKER_TRITON_ADDITIONAL_ARGS": "--cache-config local,size=1000000",
            },

Any idea ho to add libtritoncache_local to sagemaker image ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.