caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: <RABIH.ELCHAAR@sgam.com>
To: <matsen@berkeley.edu>, <caml-list@inria.fr>
Subject: RE: [Caml-list] speeding up matrix multiplication (newbie question)
Date: Fri, 20 Feb 2009 16:45:44 +0100	[thread overview]
Message-ID: <0172C3AE3A0E964797AF43E206C1048F015DD99D@FRCOR-EXMB06.europe.am.socgen> (raw)
In-Reply-To: <243054520902200740j1d1874adib27645f6e090b073@mail.gmail.com>

I don't think you can do better than calling some C functions (bound checking, ... ).
Why not have a look on ocaml bindings of C libraries (using bigarrays), 
like ocamlgsl (O Andrieu) http://oandrieu.nerim.net/ocaml/gsl/
or lacaml http://caml.inria.fr/cgi-bin/hump.fr.cgi?contrib=255

Hope this helps

Rabih

-----Message d'origine-----
De : caml-list-bounces@yquem.inria.fr [mailto:caml-list-bounces@yquem.inria.fr] De la part de Erick Matsen
Envoyé : vendredi 20 février 2009 16:40
À : caml-list@inria.fr
Objet : [Caml-list] speeding up matrix multiplication (newbie question)

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?


Thank you,

Erick



--------   profiling information --------

%      cumulative  self     self       total
time   seconds     seconds  calls      s/call  s/call  name
30.27  7.44        7.44     836419     0.00    0.00    camlMat__mul_vec_263
15.42  11.23       3.79     335237785  0.00    0.00    camlMat__get_447
14.65  14.83       3.60     334624076  0.00    0.00    camlNumber__mul_185
13.75  18.21       3.38     682814594  0.00    0.00    caml_apply2
11.31  20.99       2.78     334624076  0.00    0.00    camlNumber__add_183
6.02   22.47       1.48     335724401  0.00    0.00    caml_apply3
1.14   22.75       0.28     480860     0.00    0.00    camlDiagd__fun_304
1.06   23.01       0.26     159338     0.00    0.00    caml_oldify_local_roots
1.06   23.27       0.26     79634      0.00    0.00    sweep_slice
0.90   23.49       0.22     79828      0.00    0.00    mark_slice
0.65   23.65       0.16     10455018   0.00    0.00    camlQtree__code_begin
0.61   23.80       0.15     1517329    0.00    0.00    caml_oldify_one
0.57   23.94       0.14     17592082   0.00    0.00    camlMat__n_cols_458
0.57   24.08       0.14     13102569   0.00    0.00    caml_modify
0.57   24.22       0.14     522761     0.00    0.00    camlArray__mapi_142
...

_______________________________________________
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs
This message and any attachments (the "message") are confidential, intended solely for the addressee(s), and may contain legally privileged information. 
Any unauthorised use or dissemination is prohibited. 
E-mails are susceptible to alteration. 
Neither Societe Generale Asset Management nor any of its subsidiaries or affiliates shall be liable for the message if altered, changed or falsified. 
  
Find out more about Societe Generale Asset Management's proposal on www.sgam.com
  
                                ******** 
  
Ce message et toutes les pieces jointes (ci-apres le "message") sont confidentiels et susceptibles de contenir des informations couvertes par le secret professionnel.
Ce message est etabli a l'intention exclusive de ses destinataires.
Toute utilisation ou diffusion non autorisee est interdite. 
Tout message electronique est susceptible d'alteration. Societe Generale Asset Management et ses filiales declinent toute responsabilite au titre de ce message s'il a ete altere, deforme ou falsifie. 

Decouvrez l'offre et les services de Societe Generale Asset Management sur le site www.sgam.fr


  reply	other threads:[~2009-02-20 15:45 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-20 15:40 Erick Matsen
2009-02-20 15:45 ` RABIH.ELCHAAR [this message]
2009-02-20 17:46 ` [Caml-list] " Jon Harrop
2009-02-20 18:46 ` Xavier Leroy
2009-02-20 19:53   ` Erick Matsen
2009-02-20 21:21     ` Will M. Farr
2009-02-20 21:37     ` Martin Jambon
2009-02-20 22:23     ` Mike Lin
2009-02-20 22:30       ` Will M. Farr
2009-02-20 22:43         ` Markus Mottl
2009-02-23 22:59           ` Erick Matsen
2009-02-20 22:43         ` Mike Lin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0172C3AE3A0E964797AF43E206C1048F015DD99D@FRCOR-EXMB06.europe.am.socgen \
    --to=rabih.elchaar@sgam.com \
    --cc=caml-list@inria.fr \
    --cc=matsen@berkeley.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).