<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>The ILNumerics Blog &#187; F#</title>
	<atom:link href="https://ilnumerics.net/blog/tag/f/feed/" rel="self" type="application/rss+xml" />
	<link>https://ilnumerics.net/blog</link>
	<description>The Productivity Machine  &#124;  A fresh attempt for scientific computing  &#124;  http://ilnumerics.net</description>
	<lastBuildDate>Thu, 05 Dec 2024 09:09:24 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.1.41</generator>
	<item>
		<title>LLVM everywhere</title>
		<link>https://ilnumerics.net/blog/llvm-everywhere/</link>
		<comments>https://ilnumerics.net/blog/llvm-everywhere/#comments</comments>
		<pubDate>Sun, 04 Mar 2012 16:52:59 +0000</pubDate>
		<dc:creator><![CDATA[haymo]]></dc:creator>
				<category><![CDATA[Interesting/ useless]]></category>
		<category><![CDATA[F#]]></category>
		<category><![CDATA[library]]></category>
		<category><![CDATA[llvm]]></category>
		<category><![CDATA[OpenCL]]></category>
		<category><![CDATA[optimization]]></category>

		<guid isPermaLink="false">http://ilnumerics.net/blog/?p=146</guid>
		<description><![CDATA[<p>F#News today published some efforts to utilize the impressive power of the LLVM compiler suite from within F#. The attempts did not turn out to be mature nor stable yet &#8211; but it marks some potential of utilizing multi level compilation for runtime optimization: Use high level languages to formulate your algorithm and let lower &#8230; <a href="https://ilnumerics.net/blog/llvm-everywhere/" class="more-link">Continue reading <span class="screen-reader-text">LLVM everywhere</span> <span class="meta-nav">&#8594;</span></a></p>
<p>The post <a rel="nofollow" href="https://ilnumerics.net/blog/llvm-everywhere/">LLVM everywhere</a> appeared first on <a rel="nofollow" href="https://ilnumerics.net/blog">The ILNumerics Blog</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>F#News today published some <a href="http://fsharpnews.blogspot.com/2012/03/using-llvm-from-f-under-windows.html">efforts</a> to utilize the impressive power of the <a href="http://llvm.org/">LLVM </a>compiler suite from within F#. The attempts did not turn out to be mature nor stable yet &#8211; but it marks some potential of utilizing multi level compilation for runtime optimization: Use high level languages to formulate your algorithm and let lower level optimizations translate your algorithm into highly efficient (platform specific) code. The attempt demonstrated in the post mentioned above still does not sufficiently hide the internals of LLVM. A truely comfortable library would offer a switch to the user only: <code>UsePlatformOptimization </code>- <code>on/off</code>. It would then be the responsibility of the library to transform the high level algorithm into valuable input of the optimizing framework. </p>
<p>LLVM is not the only interesting target for such optimization scenario. Another target is OpenCL. However, most graphic card vendors and Intel (dont know about AMD?) rely on LLVM for their OpenCL implementations already. So it appears there is no way around LLVM &#8230; </p>
<p>The post <a rel="nofollow" href="https://ilnumerics.net/blog/llvm-everywhere/">LLVM everywhere</a> appeared first on <a rel="nofollow" href="https://ilnumerics.net/blog">The ILNumerics Blog</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://ilnumerics.net/blog/llvm-everywhere/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quick and dirty tests and misleading results</title>
		<link>https://ilnumerics.net/blog/quick-and-dirty-tests-and-misleading-results/</link>
		<comments>https://ilnumerics.net/blog/quick-and-dirty-tests-and-misleading-results/#comments</comments>
		<pubDate>Mon, 27 Feb 2012 17:36:56 +0000</pubDate>
		<dc:creator><![CDATA[haymo]]></dc:creator>
				<category><![CDATA[Comparison]]></category>
		<category><![CDATA[comparison]]></category>
		<category><![CDATA[F#]]></category>
		<category><![CDATA[memory bandwidth]]></category>
		<category><![CDATA[speed]]></category>
		<category><![CDATA[variance]]></category>

		<guid isPermaLink="false">http://ilnumerics.net/blog/?p=133</guid>
		<description><![CDATA[<p>Today this blog post popped up on my desktop. It describes a quick attempt to outperform the variance function of our friend library MathNet.Numerics by utilizing the Task Parallel Library from within F#. It obviously worked out &#8211; by a factor of 10! Since this seemed strange to me, I couldn&#8217;t resist to make my &#8230; <a href="https://ilnumerics.net/blog/quick-and-dirty-tests-and-misleading-results/" class="more-link">Continue reading <span class="screen-reader-text">Quick and dirty tests and misleading results</span> <span class="meta-nav">&#8594;</span></a></p>
<p>The post <a rel="nofollow" href="https://ilnumerics.net/blog/quick-and-dirty-tests-and-misleading-results/">Quick and dirty tests and misleading results</a> appeared first on <a rel="nofollow" href="https://ilnumerics.net/blog">The ILNumerics Blog</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>Today <a href="http://viralfsharp.com/2012/02/25/outperforming-mathnet-with-task-parallel-library/trackback/">this blog post</a> popped up on my desktop. It describes a quick attempt to outperform the variance function of our friend library MathNet.Numerics by utilizing the Task Parallel Library from within F#. It obviously worked out &#8211; by a factor of 10! Since this seemed strange to me, I couldn&#8217;t resist to make my own (very quick and dirty) comparison. </p>
<p>The code: </p>
<pre class="brush: csharp; title: ; notranslate">
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ILNumerics; 
using MathNet; 
using MathNet.Numerics.Statistics; 
using System.Diagnostics; 

namespace ConsoleApplication6 {
    class Program : ILMath {
        static void Main(string[] args) {
            long ms = 0; 
            int n = 10000000; 
            int it = 100; 

            ILArray&lt;double&gt; A = randn(1,n);
            Stopwatch sw = new Stopwatch(); 
            for (int i = 0; i &lt; it; i++) {
                sw.Restart(); 
                ILArray&lt;double&gt; B = var(A);
                sw.Stop(); 
                ms += sw.ElapsedMilliseconds; 
            }
            Console.WriteLine(&quot;ILNumerics needed: {0} ms&quot;,ms/(float)it); 
            
            double[] storage = A.ToArray();
            ms = 0; 
            for (int i = 0; i &lt; it; i++) {
                sw.Restart();
                double a = Statistics.Variance(storage); 
                sw.Stop();
                ms += sw.ElapsedMilliseconds;
            }
            Console.WriteLine(&quot;Mathnet.Numerics needed: {0} ms&quot;, ms / (float)it); 
            Console.ReadKey(); 
        }
    }
}
</pre>
<p>The result: </p>
<pre class="brush: csharp; title: ; notranslate">
ILNumerics needed: 101,87 ms
Mathnet.Numerics needed: 433,67 ms
</pre>
<p>So the performance of the MathNet implementation is actually not too bad. ILNumerics does parallelize the var() function (the test run on a dual core) and uses unsafe pointer optimized code for the iteration. So a factor of 4 over MathNet is reasonable. I suppose, the speedup of 10 in the referenced F# blog post is more a measure of memory bandwith. The test there have not been repeatedly run and so it appears, the given implementation is advantageous in terms of memory accesses. Possibly some prefetch of cachelines or similar is going on. </p>
<p>The post <a rel="nofollow" href="https://ilnumerics.net/blog/quick-and-dirty-tests-and-misleading-results/">Quick and dirty tests and misleading results</a> appeared first on <a rel="nofollow" href="https://ilnumerics.net/blog">The ILNumerics Blog</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://ilnumerics.net/blog/quick-and-dirty-tests-and-misleading-results/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
