#include <TritonData.h>
Classes | |
class | TritonDataEntry |
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) |
int64_t | byteSize () const |
const std::string & | dname () const |
template<typename DT > | |
TritonOutput< DT > | fromServer () const |
void | prepare () |
void | setShape (const ShapeType &newShape, unsigned entry=0) |
void | setShape (unsigned loc, int64_t val, unsigned entry=0) |
const ShapeView & | shape (unsigned entry=0) const |
int64_t | sizeDims () const |
int64_t | sizeShape (unsigned entry=0) 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 | |
void | addEntry (unsigned entry) |
void | addEntryImpl (unsigned entry) |
bool | anyNeg (const ShapeView &vec) const |
void | checkShm () |
template<typename DT > | |
void | checkType () const |
triton::client::InferenceServerGrpcClient * | client () |
void | computeSizes () |
IO * | data (unsigned entry=0) |
int64_t | dimProduct (const ShapeView &vec) const |
unsigned | fullLoc (unsigned loc) const |
void | reset () |
void | setResult (std::shared_ptr< Result > result, unsigned entry=0) |
unsigned | uid () const |
void | updateMem (size_t size) |
std::string | xput () const |
Private Attributes | |
int64_t | byteSize_ |
TritonClient * | client_ |
const ShapeType | dims_ |
std::string | dname_ |
bool | done_ {} |
inference::DataType | dtype_ |
std::vector< TritonDataEntry > | entries_ |
std::shared_ptr< void > | holder_ |
std::shared_ptr< TritonMemResource< IO > > | memResource_ |
std::string | name_ |
int64_t | productDims_ |
std::string | shmName_ |
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 >::addEntryImpl(), TritonData< IO >::anyNeg(), TritonData< IO >::checkShm(), TritonData< IO >::dimProduct(), TritonData< IO >::entries_, TritonData< IO >::productDims_, and TritonData< IO >::variableDims_.
|
private |
Definition at line 47 of file TritonData.cc.
References mps_splice::entry.
Referenced by TritonData< IO >::setShape().
|
private |
Definition at line 53 of file TritonData.cc.
References mps_splice::entry, and mps_fire::i.
Referenced by TritonData< IO >::reset(), and TritonData< IO >::TritonData().
TritonInputContainer< DT > TritonInputData::allocate | ( | bool | reserve = true | ) |
Definition at line 170 of file TritonData.cc.
References TritonData< IO >::anyNeg(), TritonClient::batchSize(), TritonData< IO >::client_, TritonData< IO >::computeSizes(), TritonData< IO >::entries_, and mps_splice::entry.
|
inlineprivate |
Definition at line 160 of file TritonData.h.
References edm::Span< T >::begin(), edm::Span< T >::end(), and mps_fire::i.
Referenced by TritonData< IO >::allocate(), and TritonData< IO >::TritonData().
|
inline |
Definition at line 72 of file TritonData.h.
References TritonData< IO >::byteSize_.
Referenced by TritonData< IO >::TritonDataEntry::computeSizes().
|
inlineprivate |
|
inlineprivate |
Definition at line 153 of file TritonData.h.
References TritonData< IO >::dname_, GeomDetEnumerators::DT, TritonData< IO >::dtype_, Exception, mergeVDriftHistosByStation::name, and TritonData< IO >::name_.
|
private |
Definition at line 87 of file TritonData.cc.
References TritonClient::client(), and TritonData< IO >::client_.
|
private |
Definition at line 128 of file TritonData.cc.
References TritonData< IO >::byteSize_, TritonData< IO >::client_, TritonData< IO >::entries_, mps_fire::i, TritonClient::outerDim(), TritonData< IO >::sizeShape(), and TritonData< IO >::totalByteSize_.
Referenced by TritonData< IO >::allocate(), TritonData< IO >::prepare(), and TritonData< IO >::toServer().
|
inlineprivate |
Definition at line 148 of file TritonData.h.
References TritonData< IO >::entries_, and mps_splice::entry.
Referenced by TritonData< IO >::toServer().
|
inlineprivate |
Definition at line 163 of file TritonData.h.
References edm::Span< T >::begin(), edm::Span< T >::end(), MainPageGenerator::l, and WZElectronSkims53X_cff::max.
Referenced by TritonData< IO >::sizeShape(), and TritonData< IO >::TritonData().
|
inline |
Definition at line 73 of file TritonData.h.
References TritonData< IO >::dname_.
Referenced by TritonData< IO >::TritonDataEntry::TritonDataEntry().
TritonOutput< DT > TritonOutputData::fromServer | ( | ) | const |
Definition at line 244 of file TritonData.cc.
References TritonClient::batchSize(), TritonData< IO >::client_, TritonData< IO >::done_, GeomDetEnumerators::DT, TritonData< IO >::entries_, mps_splice::entry, Exception, mps_fire::i, TritonData< IO >::memResource_, TritonData< IO >::name_, HLT_IsoTrack_cff::offset, TritonClient::outerDim(), and diffTwoXMLs::r1.
|
private |
Definition at line 286 of file TritonData.cc.
References TritonData< IO >::client_, isotrackTrainRegressor::loc, and TritonClient::noOuterDim().
Referenced by TritonData< IO >::setShape().
void TritonOutputData::prepare | ( | ) |
Definition at line 236 of file TritonData.cc.
References TritonData< IO >::computeSizes(), TritonData< IO >::memResource_, TritonData< IO >::totalByteSize_, and TritonData< IO >::updateMem().
|
private |
Definition at line 276 of file TritonData.cc.
References TritonData< IO >::addEntryImpl(), TritonData< IO >::done_, TritonData< IO >::entries_, TritonData< IO >::holder_, and TritonData< IO >::totalByteSize_.
|
inlineprivate |
Definition at line 147 of file TritonData.h.
References TritonData< IO >::entries_, mps_splice::entry, and mps_fire::result.
void TritonData< IO >::setShape | ( | const ShapeType & | newShape, |
unsigned | entry = 0 |
||
) |
void TritonData< IO >::setShape | ( | unsigned | loc, |
int64_t | val, | ||
unsigned | entry = 0 |
||
) |
Definition at line 101 of file TritonData.cc.
References TritonData< IO >::addEntry(), TritonData< IO >::dims_, TritonData< IO >::entries_, mps_splice::entry, Exception, TritonData< IO >::fullLoc(), isotrackTrainRegressor::loc, TritonData< IO >::name_, and heppy_batch::val.
|
inline |
Definition at line 71 of file TritonData.h.
References TritonData< IO >::entries_, and mps_splice::entry.
|
inline |
Definition at line 77 of file TritonData.h.
References TritonData< IO >::productDims_.
Referenced by TritonData< IO >::sizeShape().
|
inline |
Definition at line 79 of file TritonData.h.
References TritonData< IO >::dimProduct(), TritonData< IO >::entries_, mps_splice::entry, TritonData< IO >::sizeDims(), and TritonData< IO >::variableDims_.
Referenced by TritonData< IO >::computeSizes().
void TritonInputData::toServer | ( | TritonInputContainer< DT > | ptr | ) |
Definition at line 188 of file TritonData.cc.
References TritonClient::batchSize(), HLT_FULL_cff::batchSize, TritonData< IO >::client_, TritonData< IO >::computeSizes(), counter, TritonData< IO >::data(), TritonData< IO >::done_, TritonData< IO >::entries_, mps_splice::entry, Exception, TritonData< IO >::holder_, mps_fire::i, TritonData< IO >::memResource_, TritonData< IO >::name_, TritonClient::noOuterDim(), HLT_IsoTrack_cff::offset, TritonClient::outerDim(), TritonData< IO >::totalByteSize_, and TritonData< IO >::updateMem().
|
inlineprivate |
Definition at line 169 of file TritonData.h.
|
private |
Definition at line 141 of file TritonData.cc.
References TritonData< IO >::client_, LocalCPU, LocalGPU, TritonData< IO >::memResource_, or, TritonClient::serverType(), TritonData< IO >::shmName_, findQualityFiles::size, and TritonData< IO >::useShm_.
Referenced by TritonData< IO >::prepare(), and TritonData< IO >::toServer().
|
inline |
|
private |
Definition at line 77 of file TritonData.cc.
|
friend |
Definition at line 84 of file TritonData.h.
|
friend |
Definition at line 87 of file TritonData.h.
|
friend |
Definition at line 86 of file TritonData.h.
|
friend |
Definition at line 85 of file TritonData.h.
|
private |
Definition at line 187 of file TritonData.h.
Referenced by TritonData< IO >::byteSize(), and TritonData< IO >::computeSizes().
|
private |
Definition at line 179 of file TritonData.h.
Referenced by TritonData< IO >::allocate(), TritonData< IO >::client(), TritonData< IO >::computeSizes(), TritonData< IO >::fromServer(), TritonData< IO >::fullLoc(), TritonData< IO >::toServer(), and TritonData< IO >::updateMem().
|
private |
Definition at line 182 of file TritonData.h.
Referenced by TritonData< IO >::setShape().
|
private |
Definition at line 185 of file TritonData.h.
Referenced by TritonData< IO >::checkType(), and TritonData< IO >::dname().
|
mutableprivate |
Definition at line 196 of file TritonData.h.
Referenced by TritonData< IO >::fromServer(), TritonData< IO >::reset(), and TritonData< IO >::toServer().
|
private |
Definition at line 186 of file TritonData.h.
Referenced by TritonData< IO >::checkType().
|
private |
Definition at line 188 of file TritonData.h.
Referenced by TritonData< IO >::allocate(), TritonData< IO >::computeSizes(), TritonData< IO >::data(), TritonData< IO >::fromServer(), TritonData< IO >::reset(), TritonData< IO >::setResult(), TritonData< IO >::setShape(), TritonData< IO >::shape(), TritonData< IO >::sizeShape(), TritonData< IO >::toServer(), and TritonData< IO >::TritonData().
|
private |
Definition at line 193 of file TritonData.h.
Referenced by TritonData< IO >::reset(), and TritonData< IO >::toServer().
|
private |
Definition at line 194 of file TritonData.h.
Referenced by TritonData< IO >::fromServer(), TritonData< IO >::prepare(), TritonData< IO >::toServer(), and TritonData< IO >::updateMem().
|
private |
Definition at line 178 of file TritonData.h.
Referenced by TritonData< IO >::checkType(), TritonData< IO >::fromServer(), TritonData< IO >::setShape(), and TritonData< IO >::toServer().
|
private |
Definition at line 184 of file TritonData.h.
Referenced by TritonData< IO >::sizeDims(), and TritonData< IO >::TritonData().
|
private |
Definition at line 181 of file TritonData.h.
Referenced by TritonData< IO >::updateMem().
|
private |
Definition at line 189 of file TritonData.h.
Referenced by TritonData< IO >::TritonDataEntry::computeSizes(), TritonData< IO >::computeSizes(), TritonData< IO >::prepare(), TritonData< IO >::reset(), and TritonData< IO >::toServer().
|
private |
Definition at line 180 of file TritonData.h.
Referenced by TritonData< IO >::updateMem().
|
private |
Definition at line 183 of file TritonData.h.
Referenced by TritonData< IO >::sizeShape(), TritonData< IO >::TritonData(), and TritonData< IO >::variableDims().