English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
speeding up matrix multiplication (newbie question)
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2009-02-20 (17:41)
From: Jon Harrop <jon@f...>
Subject: Re: [Caml-list] speeding up matrix multiplication (newbie question)
On Friday 20 February 2009 15:40:00 Erick Matsen wrote:
> Hello Ocaml community---
> I'm working on speeding up some code, and I wanted to check with
> someone before implementation.
> As you can see below, the code primarily spends its time multiplying
> relatively small matrices. Precision is of course important but not an
> incredibly crucial issue, as the most important thing is relative
> comparison between things which *should* be pretty different. Currently I'm
> just using native
> (double-precision) ocaml floats and the native ocaml arrays for a first
> pass on the problem.
> Now I'm thinking about moving to using float32 bigarrays, and I'm hoping
> that the code will double in speed. I'd like to know: is that realistic?
> Any other suggestions?

What exactly are you doing? Exactly how big are the matrices? What is your 
exact code? What is the higher-level algorithm using the matrix multiply? Are 
you doing a loop just over many matrix multiplies? What platform and 
architecture are you using? Is the code parallelized?

Depending upon the answers to the above questions, you may be able to achieve 
huge performance improvements using tools like LLVM to generate SSE code 
whilst still acting upon OCaml's data structures.

Dr Jon Harrop, Flying Frog Consultancy Ltd.