#include <TritonData.h>
Public Types | |
using | Result = triton::client::InferResult |
using | ShapeType = std::vector< int64_t > |
using | ShapeView = edm::Span< ShapeType::const_iterator > |
using | TensorMetadata = inference::ModelMetadataResponse_TensorMetadata |
Public Member Functions | |
template<typename DT > | |
TritonInputContainer< DT > | allocate (bool reserve=true) |
unsigned | batchSize () const |
int64_t | byteSize () const |
const std::string & | dname () const |
template<typename DT > | |
TritonOutput< DT > | fromServer () const |
void | prepare () |
void | setShape (const ShapeType &newShape) |
void | setShape (unsigned loc, int64_t val) |
const ShapeView & | shape () const |
int64_t | sizeDims () const |
int64_t | sizeShape () const |
template<typename DT > | |
void | toServer (TritonInputContainer< DT > ptr) |
TritonData (const std::string &name, const TensorMetadata &model_info, TritonClient *client, const std::string &pid) | |
bool | variableDims () const |
Private Member Functions | |
bool | anyNeg (const ShapeView &vec) const |
triton::client::InferenceServerGrpcClient * | client () |
void | computeSizes () |
void | createObject (IO **ioptr) |
IO * | data () |
int64_t | dimProduct (const ShapeView &vec) const |
unsigned | fullLoc (unsigned loc) const |
void | reset () |
void | resetSizes () |
void | setBatchSize (unsigned bsize) |
void | setResult (std::shared_ptr< Result > result) |
unsigned | uid () const |
void | updateMem (size_t size) |
std::string | xput () const |
Private Attributes | |
unsigned | batchSize_ |
int64_t | byteSize_ |
size_t | byteSizePerBatch_ |
TritonClient * | client_ |
std::shared_ptr< IO > | data_ |
const ShapeType | dims_ |
std::string | dname_ |
bool | done_ {} |
inference::DataType | dtype_ |
ShapeType | fullShape_ |
std::shared_ptr< void > | holder_ |
std::shared_ptr < TritonMemResource< IO > > | memResource_ |
std::string | name_ |
bool | noBatch_ |
int64_t | productDims_ |
std::shared_ptr< Result > | result_ |
ShapeView | shape_ |
std::string | shmName_ |
size_t | sizeShape_ |
size_t | totalByteSize_ |
bool | useShm_ |
bool | variableDims_ |
Friends | |
class | TritonClient |
class | TritonCpuShmResource< IO > |
class | TritonHeapResource< IO > |
class | TritonMemResource< IO > |
Definition at line 45 of file TritonData.h.
using TritonData< IO >::Result = triton::client::InferResult |
Definition at line 47 of file TritonData.h.
using TritonData< IO >::ShapeType = std::vector<int64_t> |
Definition at line 49 of file TritonData.h.
using TritonData< IO >::ShapeView = edm::Span<ShapeType::const_iterator> |
Definition at line 50 of file TritonData.h.
using TritonData< IO >::TensorMetadata = inference::ModelMetadataResponse_TensorMetadata |
Definition at line 48 of file TritonData.h.
TritonData< IO >::TritonData | ( | const std::string & | name, |
const TensorMetadata & | model_info, | ||
TritonClient * | client, | ||
const std::string & | pid | ||
) |
Definition at line 19 of file TritonData.cc.
References TritonData< IO >::createObject(), and TritonData< IO >::data_.
template TritonInputContainer< int64_t > TritonInputData::allocate | ( | bool | reserve = true | ) |
Definition at line 150 of file TritonData.cc.
References TritonData< IO >::anyNeg(), TritonData< IO >::batchSize_, TritonData< IO >::computeSizes(), TritonData< IO >::shape_, and TritonData< IO >::sizeShape_.
|
inlineprivate |
Definition at line 101 of file TritonData.h.
References edm::Span< T >::begin(), edm::Span< T >::end(), and mps_fire::i.
Referenced by TritonData< IO >::allocate().
|
inline |
|
inline |
|
private |
Definition at line 68 of file TritonData.cc.
|
private |
Definition at line 106 of file TritonData.cc.
Referenced by TritonData< IO >::allocate(), TritonData< IO >::prepare(), and TritonData< IO >::toServer().
|
private |
Referenced by TritonData< IO >::TritonData().
|
inlineprivate |
Definition at line 94 of file TritonData.h.
References TritonData< IO >::data_.
Referenced by TritonData< IO >::toServer().
|
inlineprivate |
Definition at line 104 of file TritonData.h.
References edm::Span< T >::begin(), and edm::Span< T >::end().
Referenced by TritonData< IO >::sizeShape().
|
inline |
template TritonOutput< float > TritonOutputData::fromServer | ( | ) | const |
Definition at line 206 of file TritonData.cc.
References TritonData< IO >::batchSize_, TritonData< IO >::byteSize_, TritonData< IO >::dname_, TritonData< IO >::done_, GeomDetEnumerators::DT, Exception, TritonData< IO >::memResource_, TritonData< IO >::name_, hltrates_dqm_sourceclient-live_cfg::offset, diffTwoXMLs::r1, TritonData< IO >::result_, and TritonData< IO >::sizeShape_.
|
inlineprivate |
Definition at line 90 of file TritonData.h.
References TritonData< IO >::noBatch_.
Referenced by TritonData< IO >::reset().
void TritonOutputData::prepare | ( | ) |
Definition at line 198 of file TritonData.cc.
References TritonData< IO >::computeSizes(), TritonData< IO >::memResource_, TritonData< IO >::totalByteSize_, and TritonData< IO >::updateMem().
|
private |
Definition at line 235 of file TritonData.cc.
References TritonData< IO >::data_, TritonData< IO >::dims_, TritonData< IO >::done_, TritonData< IO >::fullLoc(), TritonData< IO >::fullShape_, TritonData< IO >::holder_, mps_fire::i, TritonData< IO >::resetSizes(), TritonData< IO >::shape_, edm::Span< T >::size(), and TritonData< IO >::variableDims_.
|
private |
|
private |
Definition at line 99 of file TritonData.cc.
|
inlineprivate |
Definition at line 93 of file TritonData.h.
References mps_fire::result, and TritonData< IO >::result_.
void TritonData< IO >::setShape | ( | const ShapeType & | newShape | ) |
void TritonData< IO >::setShape | ( | unsigned | loc, |
int64_t | val | ||
) |
Definition at line 81 of file TritonData.cc.
References Exception, and hgcalPerformanceValidation::val.
|
inline |
|
inline |
Definition at line 76 of file TritonData.h.
References TritonData< IO >::productDims_.
Referenced by TritonData< IO >::sizeShape().
|
inline |
Definition at line 78 of file TritonData.h.
References TritonData< IO >::dimProduct(), TritonData< IO >::shape_, TritonData< IO >::sizeDims(), and TritonData< IO >::variableDims_.
void TritonInputData::toServer | ( | TritonInputContainer< DT > | ptr | ) |
Definition at line 164 of file TritonData.cc.
References TritonData< IO >::batchSize_, TritonData< IO >::byteSize_, TritonData< IO >::byteSizePerBatch_, TritonData< IO >::computeSizes(), TritonData< IO >::data(), TritonData< IO >::data_, TritonData< IO >::dname_, TritonData< IO >::done_, GeomDetEnumerators::DT, Exception, TritonData< IO >::fullShape_, TritonData< IO >::holder_, TritonData< IO >::memResource_, TritonData< IO >::name_, TritonData< IO >::totalByteSize_, and TritonData< IO >::updateMem().
|
inlineprivate |
Definition at line 109 of file TritonData.h.
|
private |
Definition at line 121 of file TritonData.cc.
References LocalCPU, LocalGPU, or, and findQualityFiles::size.
Referenced by TritonData< IO >::prepare(), and TritonData< IO >::toServer().
|
inline |
|
private |
Definition at line 58 of file TritonData.cc.
|
friend |
Definition at line 81 of file TritonData.h.
|
friend |
Definition at line 84 of file TritonData.h.
|
friend |
Definition at line 83 of file TritonData.h.
|
friend |
Definition at line 82 of file TritonData.h.
|
private |
Definition at line 123 of file TritonData.h.
Referenced by TritonData< IO >::allocate(), TritonData< IO >::batchSize(), TritonData< IO >::fromServer(), and TritonData< IO >::toServer().
|
private |
Definition at line 130 of file TritonData.h.
Referenced by TritonData< IO >::byteSize(), TritonData< IO >::fromServer(), and TritonData< IO >::toServer().
|
private |
Definition at line 132 of file TritonData.h.
Referenced by TritonData< IO >::toServer().
|
private |
Definition at line 118 of file TritonData.h.
|
private |
Definition at line 117 of file TritonData.h.
Referenced by TritonData< IO >::data(), TritonData< IO >::reset(), TritonData< IO >::toServer(), and TritonData< IO >::TritonData().
|
private |
Definition at line 121 of file TritonData.h.
Referenced by TritonData< IO >::reset().
|
private |
Definition at line 128 of file TritonData.h.
Referenced by TritonData< IO >::dname(), TritonData< IO >::fromServer(), and TritonData< IO >::toServer().
|
mutableprivate |
Definition at line 141 of file TritonData.h.
Referenced by TritonData< IO >::fromServer(), TritonData< IO >::reset(), and TritonData< IO >::toServer().
|
private |
Definition at line 129 of file TritonData.h.
|
private |
Definition at line 124 of file TritonData.h.
Referenced by TritonData< IO >::reset(), and TritonData< IO >::toServer().
|
private |
Definition at line 137 of file TritonData.h.
Referenced by TritonData< IO >::reset(), and TritonData< IO >::toServer().
|
private |
Definition at line 138 of file TritonData.h.
Referenced by TritonData< IO >::fromServer(), TritonData< IO >::prepare(), and TritonData< IO >::toServer().
|
private |
Definition at line 116 of file TritonData.h.
Referenced by TritonData< IO >::fromServer(), and TritonData< IO >::toServer().
|
private |
Definition at line 122 of file TritonData.h.
Referenced by TritonData< IO >::fullLoc().
|
private |
Definition at line 127 of file TritonData.h.
Referenced by TritonData< IO >::sizeDims().
|
private |
Definition at line 139 of file TritonData.h.
Referenced by TritonData< IO >::fromServer(), and TritonData< IO >::setResult().
|
private |
Definition at line 125 of file TritonData.h.
Referenced by TritonData< IO >::allocate(), TritonData< IO >::reset(), TritonData< IO >::shape(), and TritonData< IO >::sizeShape().
|
private |
Definition at line 120 of file TritonData.h.
|
private |
Definition at line 131 of file TritonData.h.
Referenced by TritonData< IO >::allocate(), and TritonData< IO >::fromServer().
|
private |
Definition at line 133 of file TritonData.h.
Referenced by TritonData< IO >::prepare(), and TritonData< IO >::toServer().
|
private |
Definition at line 119 of file TritonData.h.
|
private |
Definition at line 126 of file TritonData.h.
Referenced by TritonData< IO >::reset(), TritonData< IO >::sizeShape(), and TritonData< IO >::variableDims().