You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I notice that the performance of DCOPY for copying large vectors with stride 1 (size 1000000) is considerably slower than that of memcpy. Is this a known issue?
I notice that the performance of DCOPY for copying large vectors with
stride 1 (size 1000000) is considerably slower than that of memcpy. Is this
a known issue?
Reply to this email directly or view it on GitHub: #45
I notice that the performance of DCOPY for copying large vectors with
stride 1 (size 1000000) is considerably slower than that of memcpy. Is this
a known issue?
Reply to this email directly or view it on GitHub: #45
Reply to this email directly or view it on GitHub: #45 (comment)
I notice that the performance of DCOPY for copying large vectors with
stride 1 (size 1000000) is considerably slower than that of memcpy. Is this
a known issue?
Reply to this email directly or view it on GitHub: #45
Reply to this email directly or view it on GitHub: #45 (comment)
I notice that the performance of DCOPY for copying large vectors with
stride 1 (size 1000000) is considerably slower than that of memcpy. Is this
a known issue?
Reply to this email directly or view it on GitHub: #45
Reply to this email directly or view it on GitHub: #45 (comment)
Thank you for the report.Could you give me the performance result on your
platform?
I didn't modify the codes in dcopy function. I wonder the copy kernel has
some optimizing rooms with stride 1 case.
In addition, I knew a staff from Intel optimized memcpy function in glibc on
Intel CPU.
I notice that the performance of DCOPY for copying large vectors with
stride 1 (size 1000000) is considerably slower than that of memcpy. Is
this
a known issue?
Reply to this email directly or view it on GitHub: #45
Reply to this email directly or view it on GitHub: #45 (comment)
Reply to this email directly or view it on GitHub: #45 (comment)
I notice that the performance of DCOPY for copying large vectors with
stride 1 (size 1000000) is considerably slower than that of memcpy. Is
this
a known issue?
Reply to this email directly or view it on GitHub: #45
Reply to this email directly or view it on GitHub: #45 (comment)
Reply to this email directly or view it on GitHub: #45 (comment)
I notice that the performance of DCOPY for copying large vectors with
stride 1 (size 1000000) is considerably slower than that of memcpy. Is
this
a known issue?
Reply to this email directly or view it on GitHub: #45
Reply to this email directly or view it on GitHub: #45 (comment)
Reply to this email directly or view it on GitHub: #45 (comment)
Reply to this email directly or view it on GitHub: #45 (comment)
If I'm correct that this is implemented in dcopyf.f, then it may fix the problem just to call memcpy at line 33 instead of trying to do the fancy unrolled copy. Seems like optimized system memcpy's are beating the Fortran code here.
On Opteron Linux, dcopy beats system memcpy in all cases.
-viral
On Jul 17, 2011, at 12:01 AM, StefanKarpinski wrote:
If I'm correct that this is implemented in dcopyf.f, then it may fix the problem just to call memcpy at line 33 instead of trying to do the fancy unrolled copy. Seems like optimized system memcpy's are beating the Fortran code here.
Reply to this email directly or view it on GitHub: #45 (comment)
If I'm correct that this is implemented in dcopyf.f, then
it may fix the problem just to call memcpy at line 33
instead of trying to do the fancy unrolled copy. Seems like optimized system
memcpy's are beating the Fortran code here.
Reply to this email directly or view it on GitHub: #45 (comment)
If I'm correct that this is implemented in dcopyf.f, then
it may fix the problem just to call memcpy at line 33
instead of trying to do the fancy unrolled copy. Seems like optimized system
memcpy's are beating the Fortran code here.
Reply to this email directly or view it on GitHub: #45 (comment)
Reply to this email directly or view it on GitHub: #45 (comment)
If I'm correct that this is implemented in dcopyf.f, then
it may fix the problem just to call memcpy at line 33
instead of trying to do the fancy unrolled copy. Seems like optimized system
memcpy's are beating the Fortran code here.
Reply to this email directly or view it on GitHub: #45 (comment)
Reply to this email directly or view it on GitHub: #45 (comment)
If I'm correct that this is implemented in dcopyf.f, then
it may fix the problem just to call memcpy at line 33
instead of trying to do the fancy unrolled copy. Seems like optimized system
memcpy's are beating the Fortran code here.
Reply to this email directly or view it on GitHub: #45 (comment)
Reply to this email directly or view it on GitHub: #45 (comment)
Reply to this email directly or view it on GitHub: #45 (comment)
If I'm correct that this is implemented in dcopyf.f, then
it may fix the problem just to call memcpy at line 33
instead of trying to do the fancy unrolled copy. Seems like optimized system
memcpy's are beating the Fortran code here.
Reply to this email directly or view it on GitHub: #45 (comment)
Reply to this email directly or view it on GitHub: #45 (comment)
Reply to this email directly or view it on GitHub: #45 (comment)
If I'm correct that this is implemented in dcopyf.f, then
it may fix the problem just to call memcpy at line 33
instead of trying to do the fancy unrolled copy. Seems like optimized system
memcpy's are beating the Fortran code here.
Reply to this email directly or view it on GitHub: #45 (comment)
Reply to this email directly or view it on GitHub: #45 (comment)
Reply to this email directly or view it on GitHub: #45 (comment)
The thing is that it is very good on large inputs, but on small inputs, openblas dcopy is very fast. Would be great if we can have the best of both worlds. Or just copy the memcpy source code from BSD into openblas.
-viral
On Jul 20, 2011, at 8:14 AM, xianyi wrote:
Hi viral,
I didn't test dcopy of atlas or MKL new version. I think the performance of memcpy is very good.
Xianyi
Reply to this email directly or view it on GitHub: #45 (comment)
@xianyi cool!
Since I used BLAS and LAPACK always indirectly via numpy/scipy and now julia, I am not an expert.
I know as much as level 1 and 2 refers to vector x vector and vector x matrix operations.
I can build openblas on my sandybridge i7 Mac perfectly (with clang and gfortran-4.7). The question I have is: Are all the passing tests at the end of the build process thorough enough to trust the build I did? I know there is some c and some fortran part, though I don't know which is the critical part, performance wise.
Doesn't clang normally spit out AVX using code, only if I pass -march=corei7-avx or -march=native or with the explicit -mavx (guessed, was someling like this) switch? I don't see openblas adding these. Homebrew adds -march=native to the CFLAGS. Are you enabling these instruction per defining constants?
Yes, passing the tests means that OpenBLAS is built OK.
The kernel part is assembly language. We implement the kernel by AVX assembly language on Intel Sandy Bridge. Thus, you don't need to enable "-mavx" on command line.
Activity
xianyi commentedon Jul 16, 2011
Hi
What's your platform?
Thanks
Xianyi
2011/7/16 ViralBShah <
reply@reply.github.com>
ViralBShah commentedon Jul 16, 2011
Mac, Intel Core 2 Duo.
-viral
On Jul 16, 2011, at 2:14 PM, xianyi wrote:
ViralBShah commentedon Jul 16, 2011
BTW, I observe the same on Opteron+Linux also.
-viral
On Jul 16, 2011, at 2:14 PM, xianyi wrote:
ViralBShah commentedon Jul 16, 2011
Would it help if I provide a standalone C program?
Currently, I have noticed this in a matlab-like programming environment that we are developing.
-viral
On Jul 16, 2011, at 2:14 PM, xianyi wrote:
xianyi commentedon Jul 16, 2011
Hi viral,
Thank you for the report.Could you give me the performance result on your
platform?
I didn't modify the codes in dcopy function. I wonder the copy kernel has
some optimizing rooms with stride 1 case.
In addition, I knew a staff from Intel optimized memcpy function in glibc on
Intel CPU.
Thank you again.
Xianyi
2011/7/16 ViralBShah <
reply@reply.github.com>
xianyi commentedon Jul 16, 2011
It's great to provide the C program. :)
We need it to reproduce the problem.
Thanks
Xianyi Zhang
2011/7/16 ViralBShah <
reply@reply.github.com>
ViralBShah commentedon Jul 16, 2011
Hi,
On Mac OS X with Intel Core 2 Duo 2.1GHz (penryn), dcopy is much slower:
$ ./copy
memcpy: 3.531213 seconds
dcopy: 5.212013 seconds
On Linux with Opteron 2.4GHz, dcopy is much faster than glibc memcpy:
$ ./copy
memcpy: 5.210000 seconds
dcopy: 3.730000 seconds
Here is how to reproduce:
#include <stdio.h>
#include <string.h>
#include <time.h>
#define N 1000000
#define NITER 1000
int main(int ac, char*av[])
{
double *src;
double *dest;
double t_memcpy, t_dcopy;
clock_t start, stop;
int i, n=N, one=1;
}
-viral
On Jul 16, 2011, at 2:34 PM, xianyi wrote:
StefanKarpinski commentedon Jul 16, 2011
If I'm correct that this is implemented in dcopyf.f, then it may fix the problem just to call memcpy at line 33 instead of trying to do the fancy unrolled copy. Seems like optimized system memcpy's are beating the Fortran code here.
ViralBShah commentedon Jul 17, 2011
On Opteron Linux, dcopy beats system memcpy in all cases.
-viral
On Jul 17, 2011, at 12:01 AM, StefanKarpinski wrote:
xianyi commentedon Jul 18, 2011
Hi Stefan,
dcopyf.f is only reference implementation.
The kernel codes are kernel/x86_64/copy_sse2.S and kernel/x86_64/copy_sse.S
Thanks
Xianyi
2011/7/17 StefanKarpinski <
reply@reply.github.com>
ViralBShah commentedon Jul 18, 2011
Which is why I was all the more puzzled why the memcpy was beating dcopy on Mac, even though on linux, dcopy seems to be faster.
-viral
On Jul 18, 2011, at 11:18 AM, xianyi wrote:
xianyi commentedon Jul 18, 2011
Hi Viral,
Could you give me your glibc version ?
My testbox is Intel X5470 (penryn), Ubuntu 10.10, glibc 2.12.1.
The outputs of your codes are
memcpy: 0.880000
dcopy: 2.540000
Thanks
Xianyi
ViralBShah commentedon Jul 18, 2011
Ok, so dcopy is much slower on your computer as well. I wonder what's going on.
On mac, I have 10.8.0 Darwin Kernel. The libc used in there is probably this one:
http://www.opensource.apple.com/source/Libc/Libc-594.9.5/
On the linux machine I reported, the glibc is 2.5.
-viral
On Jul 18, 2011, at 12:45 PM, xianyi wrote:
ViralBShah commentedon Jul 18, 2011
I should mention that while my Mac experiment was on a macbook, the Opteron experiment is on a 32-core NUMA box, running Centos 5.6.
-viral
On Jul 18, 2011, at 12:45 PM, xianyi wrote:
ViralBShah commentedon Jul 18, 2011
Do you have an idea of MKL performance on dcopy, and how it compares?
-viral
On Jul 18, 2011, at 12:45 PM, xianyi wrote:
xianyi commentedon Jul 19, 2011
Hi viral,
Intel MKL 10.1.1
./test_copy_mkl
memcpy: 0.870000
dcopy: 2.550000
Thanks
Xianyi
ViralBShah commentedon Jul 19, 2011
Is it the case that dcopy is not used much, and hence nobody has spent time improving its performance?
-viral
On Jul 19, 2011, at 1:40 PM, xianyi wrote:
xianyi commentedon Jul 20, 2011
Hi viral,
I didn't test dcopy of atlas or MKL new version. I think the performance of memcpy is very good.
Xianyi
ViralBShah commentedon Jul 20, 2011
Hi Xianyi,
The thing is that it is very good on large inputs, but on small inputs, openblas dcopy is very fast. Would be great if we can have the best of both worlds. Or just copy the memcpy source code from BSD into openblas.
-viral
On Jul 20, 2011, at 8:14 AM, xianyi wrote:
samueljohn commentedon Aug 24, 2012
Interesting thread to read. Any updates on this matter?
xianyi commentedon Aug 24, 2012
Hi @samueljohn ,
We are doing some BLAS level 1 and 2 optimizations on Intel Sandy Bridge. For example, we try to improve the performance with Intel AVX instructions.
Xianyi
samueljohn commentedon Aug 24, 2012
@xianyi cool!
Since I used BLAS and LAPACK always indirectly via numpy/scipy and now julia, I am not an expert.
I know as much as level 1 and 2 refers to vector x vector and vector x matrix operations.
I can build openblas on my sandybridge i7 Mac perfectly (with clang and gfortran-4.7). The question I have is: Are all the passing tests at the end of the build process thorough enough to trust the build I did? I know there is some c and some fortran part, though I don't know which is the critical part, performance wise.
Doesn't clang normally spit out AVX using code, only if I pass
-march=corei7-avxor-march=nativeor with the explicit-mavx(guessed, was someling like this) switch? I don't see openblas adding these. Homebrew adds-march=nativeto the CFLAGS. Are you enabling these instruction per defining constants?xianyi commentedon Aug 26, 2012
Hi @samueljohn ,
Yes, passing the tests means that OpenBLAS is built OK.
The kernel part is assembly language. We implement the kernel by AVX assembly language on Intel Sandy Bridge. Thus, you don't need to enable "-mavx" on command line.
Xianyi
samueljohn commentedon Aug 26, 2012
Thanks!
Merge pull request #45 from xianyi/develop