#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 |
template<typename DT > | |
void | checkType () 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 47 of file TritonData.h.
using TritonData< IO >::Result = triton::client::InferResult |
Definition at line 49 of file TritonData.h.
using TritonData< IO >::ShapeType = std::vector<int64_t> |
Definition at line 51 of file TritonData.h.
using TritonData< IO >::ShapeView = edm::Span<ShapeType::const_iterator> |
Definition at line 52 of file TritonData.h.
using TritonData< IO >::TensorMetadata = inference::ModelMetadataResponse_TensorMetadata |
Definition at line 50 of file TritonData.h.
TritonData< IO >::TritonData | ( | const std::string & | name, |
const TensorMetadata & | model_info, | ||
TritonClient * | client, | ||
const std::string & | pid | ||
) |
Definition at line 18 of file TritonData.cc.
References TritonData< IO >::createObject(), and TritonData< IO >::data_.
TritonInputContainer< DT > TritonInputData::allocate | ( | bool | reserve = true | ) |
Definition at line 149 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 109 of file TritonData.h.
References edm::Span< T >::begin(), edm::Span< T >::end(), and mps_fire::i.
Referenced by TritonData< IO >::allocate().
|
inline |
|
inline |
|
inlineprivate |
Definition at line 102 of file TritonData.h.
References TritonData< IO >::dname_, GeomDetEnumerators::DT, TritonData< IO >::dtype_, Exception, Skims_PA_cff::name, and TritonData< IO >::name_.
|
private |
Definition at line 67 of file TritonData.cc.
|
private |
Definition at line 105 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 96 of file TritonData.h.
References TritonData< IO >::data_.
Referenced by TritonData< IO >::toServer().
|
inlineprivate |
Definition at line 112 of file TritonData.h.
References edm::Span< T >::begin(), and edm::Span< T >::end().
Referenced by TritonData< IO >::sizeShape().
|
inline |
TritonOutput< DT > TritonOutputData::fromServer | ( | ) | const |
Definition at line 204 of file TritonData.cc.
References TritonData< IO >::batchSize_, 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 92 of file TritonData.h.
References TritonData< IO >::noBatch_.
Referenced by TritonData< IO >::reset().
void TritonOutputData::prepare | ( | ) |
Definition at line 196 of file TritonData.cc.
References TritonData< IO >::computeSizes(), TritonData< IO >::memResource_, TritonData< IO >::totalByteSize_, and TritonData< IO >::updateMem().
|
private |
Definition at line 231 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 98 of file TritonData.cc.
|
inlineprivate |
Definition at line 95 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 80 of file TritonData.cc.
References Exception, and heppy_batch::val.
|
inline |
|
inline |
Definition at line 78 of file TritonData.h.
References TritonData< IO >::productDims_.
Referenced by TritonData< IO >::sizeShape().
|
inline |
Definition at line 80 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 163 of file TritonData.cc.
References TritonData< IO >::batchSize_, TritonData< IO >::byteSizePerBatch_, TritonData< IO >::computeSizes(), TritonData< IO >::data(), TritonData< IO >::data_, TritonData< IO >::done_, Exception, TritonData< IO >::fullShape_, TritonData< IO >::holder_, TritonData< IO >::memResource_, TritonData< IO >::name_, TritonData< IO >::totalByteSize_, and TritonData< IO >::updateMem().
|
inlineprivate |
Definition at line 117 of file TritonData.h.
|
private |
Definition at line 120 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 57 of file TritonData.cc.
|
friend |
Definition at line 83 of file TritonData.h.
|
friend |
Definition at line 86 of file TritonData.h.
|
friend |
Definition at line 85 of file TritonData.h.
|
friend |
Definition at line 84 of file TritonData.h.
|
private |
Definition at line 131 of file TritonData.h.
Referenced by TritonData< IO >::allocate(), TritonData< IO >::batchSize(), TritonData< IO >::fromServer(), and TritonData< IO >::toServer().
|
private |
Definition at line 138 of file TritonData.h.
Referenced by TritonData< IO >::byteSize().
|
private |
Definition at line 140 of file TritonData.h.
Referenced by TritonData< IO >::toServer().
|
private |
Definition at line 126 of file TritonData.h.
|
private |
Definition at line 125 of file TritonData.h.
Referenced by TritonData< IO >::data(), TritonData< IO >::reset(), TritonData< IO >::toServer(), and TritonData< IO >::TritonData().
|
private |
Definition at line 129 of file TritonData.h.
Referenced by TritonData< IO >::reset().
|
private |
Definition at line 136 of file TritonData.h.
Referenced by TritonData< IO >::checkType(), and TritonData< IO >::dname().
|
mutableprivate |
Definition at line 149 of file TritonData.h.
Referenced by TritonData< IO >::fromServer(), TritonData< IO >::reset(), and TritonData< IO >::toServer().
|
private |
Definition at line 137 of file TritonData.h.
Referenced by TritonData< IO >::checkType().
|
private |
Definition at line 132 of file TritonData.h.
Referenced by TritonData< IO >::reset(), and TritonData< IO >::toServer().
|
private |
Definition at line 145 of file TritonData.h.
Referenced by TritonData< IO >::reset(), and TritonData< IO >::toServer().
|
private |
Definition at line 146 of file TritonData.h.
Referenced by TritonData< IO >::fromServer(), TritonData< IO >::prepare(), and TritonData< IO >::toServer().
|
private |
Definition at line 124 of file TritonData.h.
Referenced by TritonData< IO >::checkType(), TritonData< IO >::fromServer(), and TritonData< IO >::toServer().
|
private |
Definition at line 130 of file TritonData.h.
Referenced by TritonData< IO >::fullLoc().
|
private |
Definition at line 135 of file TritonData.h.
Referenced by TritonData< IO >::sizeDims().
|
private |
Definition at line 147 of file TritonData.h.
Referenced by TritonData< IO >::fromServer(), and TritonData< IO >::setResult().
|
private |
Definition at line 133 of file TritonData.h.
Referenced by TritonData< IO >::allocate(), TritonData< IO >::reset(), TritonData< IO >::shape(), and TritonData< IO >::sizeShape().
|
private |
Definition at line 128 of file TritonData.h.
|
private |
Definition at line 139 of file TritonData.h.
Referenced by TritonData< IO >::allocate(), and TritonData< IO >::fromServer().
|
private |
Definition at line 141 of file TritonData.h.
Referenced by TritonData< IO >::prepare(), and TritonData< IO >::toServer().
|
private |
Definition at line 127 of file TritonData.h.
|
private |
Definition at line 134 of file TritonData.h.
Referenced by TritonData< IO >::reset(), TritonData< IO >::sizeShape(), and TritonData< IO >::variableDims().