<?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 Could you explain how you in Software Archive</title>
    <link>https://community.intel.com/t5/Software-Archive/Problem-with-DGEMM-in-offload/m-p/1064217#M55477</link>
    <description>&lt;P&gt;Could you explain how you concluded that startA, dB and startC have new memory allocated for them?&lt;/P&gt;</description>
    <pubDate>Mon, 18 Jul 2016 16:47:46 GMT</pubDate>
    <dc:creator>Rajiv_D_Intel</dc:creator>
    <dc:date>2016-07-18T16:47:46Z</dc:date>
    <item>
      <title>Problem with DGEMM in offload</title>
      <link>https://community.intel.com/t5/Software-Archive/Problem-with-DGEMM-in-offload/m-p/1064216#M55476</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;

&lt;P&gt;I called DGEMM function in offload to perform matrix multiplication.&lt;/P&gt;

&lt;P&gt;#pragma offload target (mic) in(tempH, tempW, idx, buf: ALLOC FREE)\&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;in (TransA, TransB, K, alpha, beta: REUSE RETAIN) \&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;in(startA : length(0) REUSE RETAIN) \&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;in(dB : length(0) REUSE RETAIN) \&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;in(startC : length(0) REUSE RETAIN) \&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;stream(handle[idx]) wait(&amp;amp;ready_b&lt;J&gt;,&amp;amp;ready_a[idx],&amp;amp;ready_c[idx]) signal(&amp;amp;event_a[idx])&lt;/J&gt;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;{ &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp;dgemm(&amp;amp;TransA, &amp;amp;TransB,&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;amp;tempH, &amp;amp;tempW, &amp;amp;K, &amp;amp;alpha, startA, &amp;amp;tempH,&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; dB, &amp;amp;K, &amp;amp;beta, startC, &amp;amp;tempH);&lt;BR /&gt;
	}&lt;/P&gt;

&lt;P&gt;startA, dB and startC are three arrays transferred to the mic with offlload_transfer(REUSE RETAIN) previously.&lt;/P&gt;

&lt;P&gt;Although the buffers are loaded, the aforementioned buffer reloads buffers and allocates new memory to them on mic.&lt;/P&gt;

&lt;P&gt;I wrote a simple matrix multiplication function and replace dgemm with this function. It is noteworthy that memory reallocation problem did not occur with this function.&lt;/P&gt;

&lt;P&gt;I would appreciate it if someone could explain why running the offload with DGEMM result in memory reallocation and how the problem can be resolved.&lt;/P&gt;

&lt;P&gt;Regards,&lt;/P&gt;

&lt;P&gt;Hamidreza&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jul 2016 12:00:11 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Problem-with-DGEMM-in-offload/m-p/1064216#M55476</guid>
      <dc:creator>Hamidreza_K_</dc:creator>
      <dc:date>2016-07-18T12:00:11Z</dc:date>
    </item>
    <item>
      <title>Could you explain how you</title>
      <link>https://community.intel.com/t5/Software-Archive/Problem-with-DGEMM-in-offload/m-p/1064217#M55477</link>
      <description>&lt;P&gt;Could you explain how you concluded that startA, dB and startC have new memory allocated for them?&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jul 2016 16:47:46 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Problem-with-DGEMM-in-offload/m-p/1064217#M55477</guid>
      <dc:creator>Rajiv_D_Intel</dc:creator>
      <dc:date>2016-07-18T16:47:46Z</dc:date>
    </item>
    <item>
      <title>Quote:Rajiv Deodhar (Intel)</title>
      <link>https://community.intel.com/t5/Software-Archive/Problem-with-DGEMM-in-offload/m-p/1064218#M55478</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;Rajiv Deodhar (Intel) wrote:&lt;BR /&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;Could you explain how you concluded that startA, dB and startC have new memory allocated for them?&lt;/P&gt;

&lt;P&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;

&lt;P&gt;&amp;nbsp;&lt;/P&gt;

&lt;P dir="ltr" style="unicode-bidi: isolate; color: rgb(33, 33, 33); font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 13px; line-height: 19.5px;"&gt;Hi Mr. Rajiv Deodhar,&lt;/P&gt;

&lt;P dir="ltr" style="unicode-bidi: isolate; color: rgb(33, 33, 33); font-family: &amp;quot;Helvetica Neue&amp;quot;, Helvetica, Arial, sans-serif; font-size: 13px; line-height: 19.5px;"&gt;I found that this is Dgemm kernel wasting Xeon phi's memory. I set offload-report environment variable and found that the program did not allocate new memory to the buffers. However, it is dgemm kernel using memory more and more each time which is called.&lt;BR /&gt;
	I cannot explain the strange behavior of dgemm. I would appreciate it if you could help me to understand why it happens.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jul 2016 08:39:23 GMT</pubDate>
      <guid>https://community.intel.com/t5/Software-Archive/Problem-with-DGEMM-in-offload/m-p/1064218#M55478</guid>
      <dc:creator>Hamidreza_K_</dc:creator>
      <dc:date>2016-07-19T08:39:23Z</dc:date>
    </item>
  </channel>
</rss>

