Skip to content
Snippets Groups Projects
Commit 1e9c7b89 authored by Hashim Sharif's avatar Hashim Sharif
Browse files

Compiling AlexNet with INT8 -- pushing calib values shared by Shubham

parent efda3996
No related branches found
No related tags found
No related merge requests found
...@@ -392,8 +392,8 @@ int main(int argc, char *argv[]) { ...@@ -392,8 +392,8 @@ int main(int argc, char *argv[]) {
} }
std::string dir_prefix = std::string(MODEL_PARAMS_DIR_STR) + "/alexnet_cifar10/"; std::string dir_prefix = std::string(MODEL_PARAMS_DIR_STR) + "/alexnet_cifar10/";
std::string input_path = dir_prefix + std::string("test_input.bin"); std::string input_path = dir_prefix + std::string("test_input_fp16.bin");
std::string labels_path = dir_prefix + std::string("test_labels.bin"); std::string labels_path = dir_prefix + std::string("test_labels_fp16.bin");
uint8_t *labels = readLabels(labels_path.c_str(), 5000); uint8_t *labels = readLabels(labels_path.c_str(), 5000);
//--std::string conv2d_1_w_path = dir_prefix + std::string("conv2d_1_w.bin"); //--std::string conv2d_1_w_path = dir_prefix + std::string("conv2d_1_w.bin");
...@@ -401,40 +401,40 @@ int main(int argc, char *argv[]) { ...@@ -401,40 +401,40 @@ int main(int argc, char *argv[]) {
//-- readTrainedWeights(conv2d_1_w_path.c_str(), 0, 64, 3, 11, 11); //-- readTrainedWeights(conv2d_1_w_path.c_str(), 0, 64, 3, 11, 11);
void *conv2d_1_w = void *conv2d_1_w =
readTrainedWeights(MODEL_PARAMS_DIR_STR "/alexnet_cifar10/conv2d_1_w.bin", 0, 64, 3, 11, 11); readTrainedWeights(MODEL_PARAMS_DIR_STR "/alexnet_cifar10/conv2d_1_w_fp16.bin", 0, 64, 3, 11, 11);
//---std::string conv2d_1_b_path = dir_prefix + std::string("conv2d_1_b.bin"); //---std::string conv2d_1_b_path = dir_prefix + std::string("conv2d_1_b.bin");
void *conv2d_1_b = void *conv2d_1_b =
readTrainedWeights(MODEL_PARAMS_DIR_STR "/alexnet_cifar10/conv2d_1_b.bin", 0, 1, 64, 1, 1); readTrainedWeights(MODEL_PARAMS_DIR_STR "/alexnet_cifar10/conv2d_1_b_fp16.bin", 0, 1, 64, 1, 1);
//std::string conv2d_2_w_path = dir_prefix + std::string("conv2d_2_w.bin"); //std::string conv2d_2_w_path = dir_prefix + std::string("conv2d_2_w.bin");
void *conv2d_2_w = void *conv2d_2_w =
readTrainedWeights(MODEL_PARAMS_DIR_STR "/alexnet_cifar10/conv2d_2_w.bin", 0, 192, 64, 5, 5); readTrainedWeights(MODEL_PARAMS_DIR_STR "/alexnet_cifar10/conv2d_2_w_fp16.bin", 0, 192, 64, 5, 5);
//std::string conv2d_2_b_path = dir_prefix + std::string("conv2d_2_b.bin"); //std::string conv2d_2_b_path = dir_prefix + std::string("conv2d_2_b.bin");
void *conv2d_2_b = void *conv2d_2_b =
readTrainedWeights(MODEL_PARAMS_DIR_STR "/alexnet_cifar10/conv2d_2_b.bin", 0, 1, 192, 1, 1); readTrainedWeights(MODEL_PARAMS_DIR_STR "/alexnet_cifar10/conv2d_2_b_fp16.bin", 0, 1, 192, 1, 1);
//std::string conv2d_3_w_path = dir_prefix + std::string("conv2d_3_w.bin"); //std::string conv2d_3_w_path = dir_prefix + std::string("conv2d_3_w.bin");
void *conv2d_3_w = void *conv2d_3_w =
readTrainedWeights(MODEL_PARAMS_DIR_STR "/alexnet_cifar10/conv2d_3_w.bin", 0, 384, 192, 3, 3); readTrainedWeights(MODEL_PARAMS_DIR_STR "/alexnet_cifar10/conv2d_3_w_fp16.bin", 0, 384, 192, 3, 3);
//std::string conv2d_3_b_path = dir_prefix + std::string("conv2d_3_b.bin"); //std::string conv2d_3_b_path = dir_prefix + std::string("conv2d_3_b.bin");
void *conv2d_3_b = void *conv2d_3_b =
readTrainedWeights(MODEL_PARAMS_DIR_STR "/alexnet_cifar10/conv2d_3_b.bin", 0, 1, 384, 1, 1); readTrainedWeights(MODEL_PARAMS_DIR_STR "/alexnet_cifar10/conv2d_3_b_fp16.bin", 0, 1, 384, 1, 1);
//std::string conv2d_4_w_path = dir_prefix + std::string("conv2d_4_w.bin"); //std::string conv2d_4_w_path = dir_prefix + std::string("conv2d_4_w.bin");
void *conv2d_4_w = void *conv2d_4_w =
readTrainedWeights(MODEL_PARAMS_DIR_STR "/alexnet_cifar10/conv2d_4_w.bin", 0, 256, 384, 3, 3); readTrainedWeights(MODEL_PARAMS_DIR_STR "/alexnet_cifar10/conv2d_4_w_fp16.bin", 0, 256, 384, 3, 3);
//std::string conv2d_4_b_path = dir_prefix + std::string("conv2d_4_b.bin"); //std::string conv2d_4_b_path = dir_prefix + std::string("conv2d_4_b.bin");
void *conv2d_4_b = void *conv2d_4_b =
readTrainedWeights(MODEL_PARAMS_DIR_STR "/alexnet_cifar10/conv2d_4_b.bin", 0, 1, 256, 1, 1); readTrainedWeights(MODEL_PARAMS_DIR_STR "/alexnet_cifar10/conv2d_4_b_fp16.bin", 0, 1, 256, 1, 1);
///std::string conv2d_5_w_path = dir_prefix + std::string("conv2d_5_w.bin"); ///std::string conv2d_5_w_path = dir_prefix + std::string("conv2d_5_w.bin");
void *conv2d_5_w = void *conv2d_5_w =
readTrainedWeights(MODEL_PARAMS_DIR_STR "/alexnet_cifar10/conv2d_5_w.bin", 0, 256, 256, 3, 3); readTrainedWeights(MODEL_PARAMS_DIR_STR "/alexnet_cifar10/conv2d_5_w_fp16.bin", 0, 256, 256, 3, 3);
///std::string conv2d_5_b_path = dir_prefix + std::string("conv2d_5_b.bin"); ///std::string conv2d_5_b_path = dir_prefix + std::string("conv2d_5_b.bin");
void *conv2d_5_b = void *conv2d_5_b =
readTrainedWeights(MODEL_PARAMS_DIR_STR "/alexnet_cifar10/conv2d_5_b.bin", 0, 1, 256, 1, 1); readTrainedWeights(MODEL_PARAMS_DIR_STR "/alexnet_cifar10/conv2d_5_b_fp16.bin", 0, 1, 256, 1, 1);
//std::string dense_1_w_path = dir_prefix + std::string("dense_1_w.bin"); //std::string dense_1_w_path = dir_prefix + std::string("dense_1_w.bin");
void *dense_1_w = void *dense_1_w =
readTrainedWeights(MODEL_PARAMS_DIR_STR "/alexnet_cifar10/dense_1_w.bin", 0, 1, 1, 4096, 10); readTrainedWeights(MODEL_PARAMS_DIR_STR "/alexnet_cifar10/dense_1_w_fp16.bin", 0, 1, 1, 4096, 10);
///std::string dense_1_b_path = dir_prefix + std::string("dense_1_b.bin"); ///std::string dense_1_b_path = dir_prefix + std::string("dense_1_b.bin");
void *dense_1_b = readTrainedWeights(MODEL_PARAMS_DIR_STR "/alexnet_cifar10/dense_1_b.bin", 0, 1, 10, 1, 1); void *dense_1_b = readTrainedWeights(MODEL_PARAMS_DIR_STR "/alexnet_cifar10/dense_1_b_fp16.bin", 0, 1, 10, 1, 1);
RootIn *args = static_cast<RootIn *>(malloc(sizeof(RootIn))); RootIn *args = static_cast<RootIn *>(malloc(sizeof(RootIn)));
......
input: 0.021688217297196388
conv1: 0.1280621439218521
add1: 0.1280621439218521
tanh1: 0.007875937968492508
pool1: 0.007875937968492508
conv2: 0.15858858823776245
add2: 0.15858858823776245
tanh2: 0.007875937968492508
pool2: 0.007875937968492508
conv3: 0.12322093546390533
add3: 0.12322093546390533
tanh3: 0.007875937968492508
conv4: 0.166531503200531
add4: 0.166531503200531
tanh4: 0.007875937968492508
conv5: 0.1268610805273056
add5: 0.1268610805273056
tanh5: 0.007875937968492508
pool3: 0.007875937968492508
gemm1: 0.30668970942497253
add6: 0.30668970942497253
softmax1: 0.30668970942497253
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment