From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.5 required=5.0 tests=AWL,NO_REAL_NAME,SPF_NEUTRAL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id BE865BBC4 for ; Fri, 20 Feb 2009 16:45:50 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AjQBAJBenknPLfmtkWdsb2JhbACNC4YkIoEGAQEBAQkLCgcRBapulQeCU4E8BoYk X-IronPort-AV: E=Sophos;i="4.38,242,1233529200"; d="scan'208";a="35525243" Received: from parmail02.sgcib.com ([207.45.249.173]) by mail4-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 20 Feb 2009 16:45:50 +0100 X-IronPort-AV: E=Sophos;i="4.38,242,1233529200"; d="scan'208";a="13612101" Content-class: urn:content-classes:message MIME-Version: 1.0 Subject: RE: [Caml-list] speeding up matrix multiplication (newbie question) X-MimeOLE: Produced By Microsoft Exchange V6.5 Date: Fri, 20 Feb 2009 16:45:44 +0100 Message-ID: <0172C3AE3A0E964797AF43E206C1048F015DD99D@FRCOR-EXMB06.europe.am.socgen> In-Reply-To: <243054520902200740j1d1874adib27645f6e090b073@mail.gmail.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [Caml-list] speeding up matrix multiplication (newbie question) Thread-Index: AcmTcYM8OczN+7NfTMuKmKrbDEBGCgAABoJg References: <243054520902200740j1d1874adib27645f6e090b073@mail.gmail.com> From: To: , X-OriginalArrivalTime: 20 Feb 2009 15:45:44.0327 (UTC) FILETIME=[4A8FE970:01C99372] X-NAI-Spam-Score: 0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Spam: no; 0.00; ocaml:01 bindings:01 bigarrays:01 andrieu:01 oandrieu:01 ocaml:01 gsl:01 lacaml:01 contrib:01 multiplying:01 matrices:01 arrays:01 bigarrays:01 oldify:01 oldify:01 I don't think you can do better than calling some C functions (bound checki= ng, ... ). Why not have a look on ocaml bindings of C libraries (using bigarrays),=20 like ocamlgsl (O Andrieu) http://oandrieu.nerim.net/ocaml/gsl/ or lacaml http://caml.inria.fr/cgi-bin/hump.fr.cgi?contrib=3D255 Hope this helps Rabih -----Message d'origine----- De=A0: caml-list-bounces@yquem.inria.fr [mailto:caml-list-bounces@yquem.inr= ia.fr] De la part de Erick Matsen Envoy=E9=A0: vendredi 20 f=E9vrier 2009 16:40 =C0=A0: caml-list@inria.fr Objet=A0: [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 relati= vely small matrices. Precision is of course important but not an incredibly cruc= ial issue, as the most important thing is relative comparison between things wh= ich *should* be pretty different. Currently I'm just using native (double-precision) ocaml floats and the native ocaml arrays for a first pas= s on the problem. Now I'm thinking about moving to using float32 bigarrays, and I'm hoping th= at the code will double in speed. I'd like to know: is that realistic? Any oth= er 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_ro= ots 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 informatio= n.=20 Any unauthorised use or dissemination is prohibited.=20 E-mails are susceptible to alteration.=20 Neither Societe Generale Asset Management nor any of its subsidiaries or af= filiates shall be liable for the message if altered, changed or falsified.=20 =20 Find out more about Societe Generale Asset Management's proposal on www.sga= m.com =20 ********=20 =20 Ce message et toutes les pieces jointes (ci-apres le "message") sont confid= entiels et susceptibles de contenir des informations couvertes par le secre= t professionnel. Ce message est etabli a l'intention exclusive de ses destinataires. Toute utilisation ou diffusion non autorisee est interdite.=20 Tout message electronique est susceptible d'alteration. Societe Generale As= set Management et ses filiales declinent toute responsabilite au titre de c= e message s'il a ete altere, deforme ou falsifie.=20 Decouvrez l'offre et les services de Societe Generale Asset Management sur = le site www.sgam.fr