<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Dear Jason,  in Intel® Distribution for Python*</title>
    <link>https://community.intel.com/t5/Intel-Distribution-for-Python/Python-SciPy-Compilation-Errors-still-with-MKL/m-p/1086506#M347</link>
    <description>&lt;P style="font-size: 13.008px;"&gt;Dear Jason,&amp;nbsp;&lt;/P&gt;

&lt;P style="font-size: 13.008px;"&gt;As Tim has said, it is best to determine the exact optimization causing test failures in ODR and address that specific issue directly, rather than lowering the optimization level altogether, which disables a battery of optimizations and code transformations altogether.&amp;nbsp;&lt;/P&gt;

&lt;P style="font-size: 13.008px;"&gt;&lt;SPAN style="font-size: 1em;"&gt;Unfortunately we have not made progress in identifying this specific Intel Fortran Compiler optimization/code-transformation step yet.&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="font-size: 13.008px;"&gt;However, while building SciPy for Intel (R) Distribution for Python*, we were able to use `-O3` instead of `-O1` for the entire SciPy, while lowering optimization level only for the odr module.&lt;/P&gt;

&lt;P style="font-size: 13.008px;"&gt;To see details, please download conda tar-ball of the SciPy from Intel channel,&amp;nbsp;https://anaconda.org/intel/scipy/files . The archive contains info/recipe folder, which includes our patches. In particular, in scipy/odr/setup.py, we added&amp;nbsp;&lt;/P&gt;

&lt;PRE class="brush:bash;"&gt;diff --git a/scipy/odr/setup.py b/scipy/odr/setup.py
index 9974dfa..aad4efe 100644
--- a/scipy/odr/setup.py
+++ b/scipy/odr/setup.py
@@ -22,7 +22,7 @@ def configuration(parent_package='', top_path=None):
         libodr_files.append('d_lpkbls.f')
 
     odrpack_src = [join('odrpack', x) for x in libodr_files]
-    config.add_library('odrpack', sources=odrpack_src)
+    config.add_library('odrpack', sources=odrpack_src, extra_f77_compile_args=['-O1'])
 
     sources = ['__odrpack.c']
     libraries = ['odrpack'] + blas_info.pop('libraries', [])&lt;/PRE&gt;

&lt;P&gt;while replacing `-O1` with `-O3` in NumPy's distutils for Intel (R) Fortran compiler.&lt;/P&gt;

&lt;P&gt;This made tests pass on Linux 64-bits, but on Mac OS and on Windows further reduction of optimization level were necessary. Specifically, in scipy/sparse/linalg/isolve for extention `_iterative` to `-O1`, and in `&lt;SPAN style="color: rgb(0, 134, 179); font-family: SFMono-Regular, Consolas, &amp;quot;Liberation Mono&amp;quot;, Menlo, Courier, monospace; font-size: 12px; white-space: pre;"&gt;scipy/linalg/setup.py` for extension `_fblas` to `-O2`.&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;While tests are not failing, while we use `-O3`, vectorization is still inhibited by use of `&lt;SPAN style="color: rgb(85, 165, 50); font-family: SFMono-Regular, Consolas, &amp;quot;Liberation Mono&amp;quot;, Menlo, Courier, monospace; font-size: 12px; white-space: pre; background-color: rgb(234, 255, 234);"&gt;-fp-model strict`.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 02 May 2018 12:49:54 GMT</pubDate>
    <dc:creator>Oleksandr_P_Intel</dc:creator>
    <dc:date>2018-05-02T12:49:54Z</dc:date>
    <item>
      <title>Python SciPy Compilation Errors (still) with MKL</title>
      <link>https://community.intel.com/t5/Intel-Distribution-for-Python/Python-SciPy-Compilation-Errors-still-with-MKL/m-p/1086501#M342</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;This has been an issue for years, are there&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;any&lt;/STRONG&gt;&lt;/EM&gt;&amp;nbsp;plans to address the&amp;nbsp;&lt;STRONG&gt;ifort&lt;/STRONG&gt;&amp;nbsp;bug mentioned here?:&lt;/P&gt;

&lt;P&gt;&lt;A href="https://github.com/scipy/scipy/issues/5621" target="_blank"&gt;https://github.com/scipy/scipy/issues/5621&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;This has been an ongoing issue for a few years. The only work-around to date has been to compile with less aggressive settings (-O1 instead of -O3). At the very least, can we get an idea of the performance hit we're taking (if any) by using the&amp;nbsp;&lt;STRONG&gt;-O1&lt;/STRONG&gt;&amp;nbsp;flag? Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 12 Apr 2016 18:53:06 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Distribution-for-Python/Python-SciPy-Compilation-Errors-still-with-MKL/m-p/1086501#M342</guid>
      <dc:creator>Jason_W_1</dc:creator>
      <dc:date>2016-04-12T18:53:06Z</dc:date>
    </item>
    <item>
      <title>from the performance point of</title>
      <link>https://community.intel.com/t5/Intel-Distribution-for-Python/Python-SciPy-Compilation-Errors-still-with-MKL/m-p/1086502#M343</link>
      <description>&lt;P&gt;from the performance point of view, MKL code doesn't depend on compiler's flags you are using while compiling your program.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Apr 2016 05:17:13 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Distribution-for-Python/Python-SciPy-Compilation-Errors-still-with-MKL/m-p/1086502#M343</guid>
      <dc:creator>Gennady_F_Intel</dc:creator>
      <dc:date>2016-04-13T05:17:13Z</dc:date>
    </item>
    <item>
      <title>Nor does mkl use -O1 to set</title>
      <link>https://community.intel.com/t5/Intel-Distribution-for-Python/Python-SciPy-Compilation-Errors-still-with-MKL/m-p/1086503#M344</link>
      <description>&lt;P&gt;Nor does mkl use -O1 to set conditional numerical reproducibility. &amp;nbsp;If you have numerical issues with aggressive vectorization in icc you should consider setting options more consistent with what you may use for gcc, such as -fp-model source &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Apr 2016 13:09:11 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Distribution-for-Python/Python-SciPy-Compilation-Errors-still-with-MKL/m-p/1086503#M344</guid>
      <dc:creator>TimP</dc:creator>
      <dc:date>2016-04-13T13:09:11Z</dc:date>
    </item>
    <item>
      <title>Gennady,</title>
      <link>https://community.intel.com/t5/Intel-Distribution-for-Python/Python-SciPy-Compilation-Errors-still-with-MKL/m-p/1086504#M345</link>
      <description>&lt;P&gt;&lt;SPAN style="color: rgb(0, 0, 0); font-family: monospace; font-size: 16px; line-height: normal;"&gt;Gennady,&lt;/SPAN&gt;&lt;BR style="color: rgb(0, 0, 0); font-family: monospace; font-size: 16px; line-height: normal;" /&gt;
	&lt;BR style="color: rgb(0, 0, 0); font-family: monospace; font-size: 16px; line-height: normal;" /&gt;
	&lt;SPAN style="color: rgb(0, 0, 0); font-family: monospace; font-size: 16px; line-height: normal;"&gt;Thanks for the quick reply! That makes sense, however I have a couple of follow up questions if you would oblige me (I'm a data scientist, not a software engineer, so I'm trying to understand the full scope of what I'm dealing with here). From strictly a performance point of view, let's say we have two distinct installations of MKL + NumPy + SciPy. The first has NumPy and SciPy compiled with the -O1 optimization and the second compiled with the -O3 optimization. If we run the same program on both setups, 1) will the -O3 compiled installation compile our program more efficiently, resulting in faster performance? and/or 2) greater numeric precision?&lt;/SPAN&gt;&lt;BR style="color: rgb(0, 0, 0); font-family: monospace; font-size: 16px; line-height: normal;" /&gt;
	&lt;BR style="color: rgb(0, 0, 0); font-family: monospace; font-size: 16px; line-height: normal;" /&gt;
	&lt;SPAN style="color: rgb(0, 0, 0); font-family: monospace; font-size: 16px; line-height: normal;"&gt;If so, what kind of difference are we talking here for both speed and precision?&lt;/SPAN&gt;&lt;BR style="color: rgb(0, 0, 0); font-family: monospace; font-size: 16px; line-height: normal;" /&gt;
	&lt;BR style="color: rgb(0, 0, 0); font-family: monospace; font-size: 16px; line-height: normal;" /&gt;
	&lt;SPAN style="color: rgb(0, 0, 0); font-family: monospace; font-size: 16px; line-height: normal;"&gt;Thanks again for your help!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Apr 2016 15:31:27 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Distribution-for-Python/Python-SciPy-Compilation-Errors-still-with-MKL/m-p/1086504#M345</guid>
      <dc:creator>Jason_W_1</dc:creator>
      <dc:date>2016-04-13T15:31:27Z</dc:date>
    </item>
    <item>
      <title>Tim,</title>
      <link>https://community.intel.com/t5/Intel-Distribution-for-Python/Python-SciPy-Compilation-Errors-still-with-MKL/m-p/1086505#M346</link>
      <description>&lt;P&gt;Tim,&lt;/P&gt;

&lt;P&gt;Thank you also for your reply. I did use --fp-model strict, but I'll try out your suggestion using source instead&lt;/P&gt;</description>
      <pubDate>Wed, 13 Apr 2016 15:35:05 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Distribution-for-Python/Python-SciPy-Compilation-Errors-still-with-MKL/m-p/1086505#M346</guid>
      <dc:creator>Jason_W_1</dc:creator>
      <dc:date>2016-04-13T15:35:05Z</dc:date>
    </item>
    <item>
      <title>Dear Jason, </title>
      <link>https://community.intel.com/t5/Intel-Distribution-for-Python/Python-SciPy-Compilation-Errors-still-with-MKL/m-p/1086506#M347</link>
      <description>&lt;P style="font-size: 13.008px;"&gt;Dear Jason,&amp;nbsp;&lt;/P&gt;

&lt;P style="font-size: 13.008px;"&gt;As Tim has said, it is best to determine the exact optimization causing test failures in ODR and address that specific issue directly, rather than lowering the optimization level altogether, which disables a battery of optimizations and code transformations altogether.&amp;nbsp;&lt;/P&gt;

&lt;P style="font-size: 13.008px;"&gt;&lt;SPAN style="font-size: 1em;"&gt;Unfortunately we have not made progress in identifying this specific Intel Fortran Compiler optimization/code-transformation step yet.&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="font-size: 13.008px;"&gt;However, while building SciPy for Intel (R) Distribution for Python*, we were able to use `-O3` instead of `-O1` for the entire SciPy, while lowering optimization level only for the odr module.&lt;/P&gt;

&lt;P style="font-size: 13.008px;"&gt;To see details, please download conda tar-ball of the SciPy from Intel channel,&amp;nbsp;https://anaconda.org/intel/scipy/files . The archive contains info/recipe folder, which includes our patches. In particular, in scipy/odr/setup.py, we added&amp;nbsp;&lt;/P&gt;

&lt;PRE class="brush:bash;"&gt;diff --git a/scipy/odr/setup.py b/scipy/odr/setup.py
index 9974dfa..aad4efe 100644
--- a/scipy/odr/setup.py
+++ b/scipy/odr/setup.py
@@ -22,7 +22,7 @@ def configuration(parent_package='', top_path=None):
         libodr_files.append('d_lpkbls.f')
 
     odrpack_src = [join('odrpack', x) for x in libodr_files]
-    config.add_library('odrpack', sources=odrpack_src)
+    config.add_library('odrpack', sources=odrpack_src, extra_f77_compile_args=['-O1'])
 
     sources = ['__odrpack.c']
     libraries = ['odrpack'] + blas_info.pop('libraries', [])&lt;/PRE&gt;

&lt;P&gt;while replacing `-O1` with `-O3` in NumPy's distutils for Intel (R) Fortran compiler.&lt;/P&gt;

&lt;P&gt;This made tests pass on Linux 64-bits, but on Mac OS and on Windows further reduction of optimization level were necessary. Specifically, in scipy/sparse/linalg/isolve for extention `_iterative` to `-O1`, and in `&lt;SPAN style="color: rgb(0, 134, 179); font-family: SFMono-Regular, Consolas, &amp;quot;Liberation Mono&amp;quot;, Menlo, Courier, monospace; font-size: 12px; white-space: pre;"&gt;scipy/linalg/setup.py` for extension `_fblas` to `-O2`.&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;While tests are not failing, while we use `-O3`, vectorization is still inhibited by use of `&lt;SPAN style="color: rgb(85, 165, 50); font-family: SFMono-Regular, Consolas, &amp;quot;Liberation Mono&amp;quot;, Menlo, Courier, monospace; font-size: 12px; white-space: pre; background-color: rgb(234, 255, 234);"&gt;-fp-model strict`.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 02 May 2018 12:49:54 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Distribution-for-Python/Python-SciPy-Compilation-Errors-still-with-MKL/m-p/1086506#M347</guid>
      <dc:creator>Oleksandr_P_Intel</dc:creator>
      <dc:date>2018-05-02T12:49:54Z</dc:date>
    </item>
  </channel>
</rss>

