|
triton_cpp v1.2.1
Header-only C++ wrapper for NVIDIA Triton Inference Server clients
|
Namespaces | |
| namespace | detail |
Classes | |
| class | CudaSharedMemoryRegion |
| Own a CUDA device allocation exportable through a CUDA IPC handle. More... | |
| struct | InputData |
| Couple a Triton input descriptor with its backing storage. More... | |
| struct | InputOutputMetaData |
| Shape, datatype, and byte-size metadata for one model tensor. More... | |
| class | SharedMemoryRegion |
| Own a POSIX shared-memory mapping used by the Triton client. More... | |
| class | TritonInterface |
| Synchronous, typed interface to one model served by Triton. More... | |
Typedefs | |
| template<typename T > | |
| using | VectorType |
| Helper type template for Eigen::Vector compatible with Triton. | |
| template<typename T > | |
| using | MatrixType |
| Helper type template for Eigen::Matrix compatible with Triton. | |
| template<typename T , int rank> | |
| using | TensorType |
| Helper type template for Eigen::Tensor compatible with Triton. | |
| using | TritonDataType |
| Type alias for all possible C++ scalar types that the triton server supports. | |
| using | ModelOutput = std::map<std::string, std::shared_ptr<triton::client::InferRequestedOutput>> |
| Map model output names to Triton requested-output objects. | |
Functions | |
| void | throw_on_cuda_error (cudaError_t status, const char *operation) |
| Throw a descriptive exception when a CUDA Runtime API call fails. | |
| bool | LocalCudaSharedMemorySupported (std::string *reason=nullptr) |
| Check whether this process can allocate CUDA IPC shared memory. | |
| TritonDataType | getZero (inference::DataType type) |
| Get a zero value in the correct C++ type, given a Triton datatype. | |
| std::size_t | getAlignment (inference::DataType type) |
| Return the natural C++ alignment for a Triton datatype. | |
| std::size_t | getSharedMemoryAlignment (inference::DataType type) |
| Return the alignment used when packing tensors into shared memory. | |
| std::size_t | alignUp (std::size_t offset, std::size_t alignment) |
| Round an offset up to an alignment boundary. | |
| template<typename T > | |
| std::ostream & | operator<< (std::ostream &os, const std::vector< T > &data) |
| Write a vector in bracketed, comma-separated form. | |
| template<typename It > | |
| std::int64_t | accumulate_shape (It begin, It end) |
| Compute the element count represented by a tensor shape. | |
| void | fail_on_error (const triton::client::Error &err, std::string message="") |
| Convert a failed Triton client status into a C++ exception. | |
| std::string | randstring (std::size_t len) |
| Generate an alphanumeric random string. | |
| using triton_cpp::MatrixType |
Helper type template for Eigen::Matrix compatible with Triton.
| T | Scalar data type. If T is const, the underlying Matrix will be const |
| using triton_cpp::ModelOutput = std::map<std::string, std::shared_ptr<triton::client::InferRequestedOutput>> |
| using triton_cpp::TensorType |
Helper type template for Eigen::Tensor compatible with Triton.
Note that Eigen::Tensor is officially unsupported in Eigen3, but works for the mappings used here.
| T | Scalar data type. If T is const, the underlying Tensor will be const |
Type alias for all possible C++ scalar types that the triton server supports.
String values are not represented because they require dedicated storage and conversion handling.
Eigen::half is appended to preserve the variant indexes of the previously supported alternatives.
| using triton_cpp::VectorType |
Helper type template for Eigen::Vector compatible with Triton.
| T | Scalar data type. If T is const, the underlying Vector will be const |
| std::int64_t triton_cpp::accumulate_shape | ( | It | begin, |
| It | end ) |
Compute the element count represented by a tensor shape.
Dimensions smaller than one contribute one to the product. This treats Triton's dynamic dimension marker -1 as an unspecified unit dimension.
| It | Iterator over values convertible to std::int64_t. |
| begin | Beginning of the shape range. |
| end | End of the shape range. |
Definition at line 55 of file utils.hpp.
|
inline |
Round an offset up to an alignment boundary.
| offset | Original byte offset. |
| alignment | Required alignment in bytes. Values zero and one leave the offset unchanged. |
offset. Definition at line 137 of file types.hpp.
|
inline |
Convert a failed Triton client status into a C++ exception.
| err | Triton client status to inspect. |
| message | Context prepended to the Triton error message. |
| std::runtime_error | if err does not represent success. |
Definition at line 65 of file utils.hpp.
|
inline |
Return the natural C++ alignment for a Triton datatype.
| type | Triton datatype to inspect. |
| std::invalid_argument | if type is unsupported. |
Definition at line 116 of file types.hpp.
References getZero().
Referenced by getSharedMemoryAlignment().
|
inline |
Return the alignment used when packing tensors into shared memory.
| type | Triton datatype to inspect. |
| std::invalid_argument | if type is unsupported. |
Definition at line 126 of file types.hpp.
References getAlignment().
|
inline |
Get a zero value in the correct C++ type, given a Triton datatype.
| type | The triton type |
| std::invalid_argument,if | the datatype is not supported yet |
Definition at line 79 of file types.hpp.
Referenced by getAlignment().
|
inline |
Check whether this process can allocate CUDA IPC shared memory.
| reason | Optional destination for a diagnostic when support is unavailable. |
Definition at line 36 of file cuda_shm.hpp.
Referenced by triton_cpp::TritonInterface::TritonInterface().
| std::ostream & triton_cpp::operator<< | ( | std::ostream & | os, |
| const std::vector< T > & | data ) |
Write a vector in bracketed, comma-separated form.
| T | Streamable vector element type. |
| os | Stream receiving the formatted vector. |
| data | Vector to format. |
os. Definition at line 31 of file utils.hpp.
|
inline |
Generate an alphanumeric random string.
| len | Number of characters to generate. |
len characters. Definition at line 76 of file utils.hpp.
|
inline |
Throw a descriptive exception when a CUDA Runtime API call fails.
| status | Status returned by the CUDA Runtime API. |
| operation | Human-readable name of the failed operation. |
| std::runtime_error | if status is not cudaSuccess. |
Definition at line 24 of file cuda_shm.hpp.
Referenced by triton_cpp::TritonInterface::copyInputTensorToDevice(), and triton_cpp::CudaSharedMemoryRegion::CudaSharedMemoryRegion().