illegal instruction on intel python2 when importing caffe

illegal instruction on intel python2 when importing caffe

Hi,

I am trying to use caffe with intel python2.7 v2017.3, but executing "import caffe" results in crashing the interpreter with "Illegal instruction". (The same error was seen on v2017.2.)

My cpu is i5-3570 (which has sse4_2), os is debian-8 jessie. The /proc/cpuinfo file is attached.

Thank you for looking into this!

AttachmentSize
Downloadtext/plain cpuinfo.txt3.73 KB

Thread Topic: 

Bug Report
7 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Hi Ellak,

Thanks for reporting this.

I believe this may be linked to an issue in Pandas.  Can you reproduce the error by running the following command?

python -c 'import pandas'

Chris

Hi Chris,

thank you response. Pandas is imported fine (and works fine), for the moment I only got into problems with caffe. With bash:

$ /opt/intel/intelpython2/bin/python -c 'import caffe; print "ok"' ; echo $?
Illegal instruction
132

$ /opt/intel/intelpython2/bin/python -c 'import pandas; print "ok"' ; echo $?
ok
0

Cheers,
-Ellak

Hi Ellak,

Can you try importing pytables?

$ python -c 'import tables'

Thanks for your patience,

Chris

Hi Chris,

importing tables works fine (as well as numpy, scipy, h5py, theano).

In /opt/intel/intelpython2/bin there are some caffe related binaries, those crash as well:

$ /opt/intel/intelpython2/bin/caffe ; echo $?
Illegal instruction
132

Same for /opt/intel/intelpython2/bin/classification . 

Everything runs fine on the newer i5-7500 (including python -c 'import caffe', the caffe binary etc), but not on the i5-3570.  Is there a chance some exclusive architecture specific optimization was invoked when compiling caffe, which works with new cpus like i5-7500, but not with somewhat older ones like i5-3570 ?

Cheers,
-Ellak

Hi Ellak,

Thanks for troubleshooting.  The optimizations done to Intel Caffe rely on the presence of AVX2. I'm working on a Caffe build that will work on all architectures that Intel Python supports so people will not encounter the illegal instruction error if they don't have AVX2, but AVX2 is still necessary to take advantage of the performance enhancements provided by Intel Caffe. 

Chris

Hi Chris,

I checked, and indeed the i5-3570 does not have avx2. I would greatly appreciate if you could provide a compiled caffe binary which works without avx2. I understand this means performace dip, but at least it would run on the avx2-less cpus.

Thank you in advance!

-Ellak

Leave a Comment

Please sign in to add a comment. Not a member? Join today