(tkDNN): Make Resnet-101-AP-GeM work with TRT

Signed-off-by: Micaela Verucchi <micaelaverucchi@gmail.com>
This commit is contained in:
Micaela Verucchi
2022-09-25 11:30:53 +02:00
parent 56da10df64
commit a503f0010b
3 changed files with 5 additions and 9 deletions
-4
View File
@@ -73,11 +73,7 @@ void GeneralizedMeanPoolingP(dnnType* srcData, dnnType* dstData, int n, int c, i
int blocks = (tot_size+255)/256;
int threads = 256;
std::cerr<<"Calling forward_gen_avgpool_p_layer_kernel "<<n<< " "<< c<<" "<<h<< " "<< w<< "\n";
forward_gen_avgpool_p_layer_kernel<<<blocks, threads, 0, stream>>>(n*c, h, w, c, p, srcData, dstData);
}
void MaxPoolingForward(dnnType* srcData, dnnType* dstData, int n, int c, int h, int w, int stride_x, int stride_y, int size, int padding, cudaStream_t stream)
+1 -1
View File
@@ -77,7 +77,7 @@ int32_t GeneralizedMeanPoolingPRT::enqueue(int32_t batchSize, const void *const
size_t GeneralizedMeanPoolingPRT::getSerializationSize() const NOEXCEPT {
return 8*sizeof(int);
return 8*sizeof(int) + sizeof(float);
}
void GeneralizedMeanPoolingPRT::serialize(void *buffer) const NOEXCEPT {
@@ -154,8 +154,8 @@ const char *layer4_bin[]={
const char *fc_bin = "Resnet-101-AP-GeM/layers/module-fc.bin";
// const char *output_bin = "Resnet-101-AP-GeM/debug/module-layer4-2-bn3.bin";
const char *output_bin = "Resnet-101-AP-GeM/debug/module-adpool.bin";
// const char *output_bin = "Resnet-101-AP-GeM/debug/module-fc.bin";
// const char *output_bin = "Resnet-101-AP-GeM/debug/module-adpool.bin";
const char *output_bin = "Resnet-101-AP-GeM/debug/module-fc.bin";
int main()
{
@@ -285,7 +285,7 @@ int main()
//final
tk::dnn::Pooling avgpool(&net, 24, 32, 24, 32, 0, 0, tk::dnn::POOLING_GENERALIZED_MEAN_P, 2.9963f);
// tk::dnn::Dense fc(&net, 2048, fc_bin);
tk::dnn::Dense fc(&net, 2048, fc_bin);
// Load input
dnnType *data;
@@ -324,7 +324,7 @@ int main()
TKDNN_TSTOP
dim2.print();
}
rt_out = (dnnType *)netRT.buffersRT[1];
rt_out = (dnnType *)netRT.buffersRT[2];
printCenteredTitle(std::string(" RESNET CHECK RESULTS ").c_str(), '=', 30);