numpy on multicore hardware

前端 未结 1 1913
孤城傲影
孤城傲影 2020-12-15 20:02

What\'s the state of the art with regards to getting numpy to use mutliple cores (on Intel hardware) for things like inner and outer vector products, vector-mat

1条回答
  •  离开以前
    2020-12-15 20:54

    You should probably start by checking whether the Atlas build that numpy is using has been built with multi-threading. You can build and run this to inspect the Atlas configuration (straight from the Atlas FAQ):

    main()
    /*
     * Compile, link and run with something like:
     *    gcc -o xprint_buildinfo -L[ATLAS lib dir] -latlas ; ./xprint_buildinfo
     * if link fails, you are using ATLAS version older than 3.3.6.
     */
    {
       void ATL_buildinfo(void);
       ATL_buildinfo();
       exit(0);
    }
    

    If you have don't have a multithreaded version of Atlas: "there's your problem". If it is multithreaded, then you need to exercise one of the multithreaded BLAS3 routines (probably dgemm), with a suitably large matrix-matrix product and see whether threading is used. I think I am right in saying that neither BLAS 2 and BLAS 1 routines in Atlas support multithreading (and with good reason because there is no performance advantage except at truly enormous problem sizes).

    0 讨论(0)
提交回复
热议问题