{"action":"created","issue":{"url":"https://api.github.com/repos/ARM-software/ComputeLibrary/issues/23","repository_url":"https://api.github.com/repos/ARM-software/ComputeLibrary","labels_url":"https://api.github.com/repos/ARM-software/ComputeLibrary/issues/23/labels{/name}","comments_url":"https://api.github.com/repos/ARM-software/ComputeLibrary/issues/23/comments","events_url":"https://api.github.com/repos/ARM-software/ComputeLibrary/issues/23/events","html_url":"https://github.com/ARM-software/ComputeLibrary/issues/23","id":219467783,"number":23,"title":"Problem with GEMM (NEGEMMLowp function, 8-bit) -  very low performance","user":{"login":"atrah22","id":26916352,"avatar_url":"https://avatars3.githubusercontent.com/u/26916352?v=3","gravatar_id":"","url":"https://api.github.com/users/atrah22","html_url":"https://github.com/atrah22","followers_url":"https://api.github.com/users/atrah22/followers","following_url":"https://api.github.com/users/atrah22/following{/other_user}","gists_url":"https://api.github.com/users/atrah22/gists{/gist_id}","starred_url":"https://api.github.com/users/atrah22/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atrah22/subscriptions","organizations_url":"https://api.github.com/users/atrah22/orgs","repos_url":"https://api.github.com/users/atrah22/repos","events_url":"https://api.github.com/users/atrah22/events{/privacy}","received_events_url":"https://api.github.com/users/atrah22/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-04-05T04:49:16Z","updated_at":"2017-04-05T08:16:51Z","closed_at":null,"body":"Hello,\r\nI tried to benchmark NEGEMMLowp (8-bit) for different Matrix parameters on Xiaomi Redmi Pro (10 cores). The performance is very low compared to Google's gemmlowp optimzied for ARM NEON. Can anyone provide an example code showing the way to efficiently use NEGEMMLowp function? I provided my code below. Please, suggest me if there is any issue with the code, and/or gemm function, and/or optimziation.\r\n\r\nI ran the \"benchmark_meta_gemm.cc (21.8ms)\" and \"benchmark.cc (9.95ms)\" from \"https://github.com/google/gemmlowp\" for Matrix size M=3136; N=192; K=576. Whereas, it takes 2575.92 ms when NEGEMMLowp is used for the same matrix size.\r\n\r\n`\r\ndouble time() {\r\n    timespec t;\r\n    clock_gettime(CLOCK_REALTIME, &t);\r\n    return t.tv_sec + 1e-9 * t.tv_nsec;\r\n}\r\n\r\nvoid main_neon_gemm(int argc, const  char **argv)\r\n{\r\n    \r\n    Tensor    src1, src2, out1;\r\n\r\n   constexpr  uint16_t M[] = {  49, 128, 160, 196, 196,  196, 3136, 12544, 1000, 1000, 1000, 1000};\r\n   constexpr  uint16_t N[] = { 256, 508, 832, 160, 204,  256,  192,    64, 1000, 1000, 1000, 1000};\r\n   constexpr  uint16_t K[] = {  832,   1,  49, 528, 864, 1152,  576,   147,   1,    10, 100, 1000};\r\n\r\n    int pointer =0;\r\n\r\n    if (argc > 1) {\r\n      pointer= atoi(argv[1]);\r\n      std::cout << \"Argv(int)=\" << pointer <<\"\\n\\n\";\r\n    }\r\n    else {\r\n        pointer=2;  \r\n        std:: cout << \"Argv(int) Default=\" << pointer << \"\\n\\n\";\r\n    }\r\n   \r\n    const TensorShape src1_shape(M[pointer],K[pointer]);\r\n    const TensorShape src2_shape(K[pointer],N[pointer]);\r\n    const TensorShape out1_shape(M[pointer],N[pointer]);\r\n\r\n    src1.allocator()->init(TensorInfo(src1_shape, Format::U8));\r\n    src2.allocator()->init(TensorInfo(src2_shape, Format::U8));\r\n    out1.allocator()->init(TensorInfo(out1_shape, Format::U8));\r\n    \r\n    // Initialize just the dimensions and format of the temporary and destination images:\r\n    NEGEMMLowp gemm;\r\n\r\n    gemm.configure(&src2, &src1, &out1, 0, 0, 0, 1, 24);\r\n\r\n    // Now that the padding requirements are known we can allocate the images:\r\n    src1.allocator()->allocate();\r\n    src2.allocator()->allocate();\r\n    out1.allocator()->allocate();\r\n    \r\n    float avg =3;\r\n    double totalTime = 0.0;\r\n    for ( int i=0; i<avg; i++)\r\n    {\r\n        double st = time();\r\n        gemm.run();\r\n        double totalTemp = (time() - st);\r\n        totalTime = totalTime + totalTemp;\r\n    }\r\n    \r\n    double tT= totalTime*1000;\r\n    tT = tT/avg;\r\n    std::cout << \"Matrix size= \" << M[pointer] << \" * \" << N[pointer] << \" * \" << K[pointer] << \"\\t\" << tT << \"ms\\n\\n\";\r\n  \r\n}\r\n\r\nint main(int argc, const char **argv)\r\n{\r\n    return test_helpers::run_example(argc, argv, main_neon_gemm);\r\n}\r\n`\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/ARM-software/ComputeLibrary/issues/comments/291788168","html_url":"https://github.com/ARM-software/ComputeLibrary/issues/23#issuecomment-291788168","issue_url":"https://api.github.com/repos/ARM-software/ComputeLibrary/issues/23","id":291788168,"user":{"login":"sundw2014","id":12440834,"avatar_url":"https://avatars2.githubusercontent.com/u/12440834?v=3","gravatar_id":"","url":"https://api.github.com/users/sundw2014","html_url":"https://github.com/sundw2014","followers_url":"https://api.github.com/users/sundw2014/followers","following_url":"https://api.github.com/users/sundw2014/following{/other_user}","gists_url":"https://api.github.com/users/sundw2014/gists{/gist_id}","starred_url":"https://api.github.com/users/sundw2014/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sundw2014/subscriptions","organizations_url":"https://api.github.com/users/sundw2014/orgs","repos_url":"https://api.github.com/users/sundw2014/repos","events_url":"https://api.github.com/users/sundw2014/events{/privacy}","received_events_url":"https://api.github.com/users/sundw2014/received_events","type":"User","site_admin":false},"created_at":"2017-04-05T08:16:51Z","updated_at":"2017-04-05T08:16:51Z","body":"Did you try to compile this library with ```debug=0 asserts=0```?"}}
{"actor":{"display_login":"sundw2014"}}