From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id qPZUG1aZlGQ3ywAASxT56A (envelope-from ) for ; Thu, 22 Jun 2023 20:56:22 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id wDs0G1aZlGS3CwAAauVa8A (envelope-from ) for ; Thu, 22 Jun 2023 20:56:22 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 2A4351352A for ; Thu, 22 Jun 2023 20:56:22 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qCPTV-0004ZV-JS; Thu, 22 Jun 2023 14:56:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qCPTP-0004ZM-0X for bug-guix@gnu.org; Thu, 22 Jun 2023 14:56:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qCPTO-000701-Nu for bug-guix@gnu.org; Thu, 22 Jun 2023 14:56:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qCPTO-0008VF-Ir for bug-guix@gnu.org; Thu, 22 Jun 2023 14:56:02 -0400 X-Loop: help-debbugs@gnu.org Subject: bug#63986: Julia is very slow Resent-From: Efraim Flashner Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Thu, 22 Jun 2023 18:56:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63986 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Simon Tournier Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= , 63986@debbugs.gnu.org, Nicolas Graves , csantosb@inventati.org Received: via spool by 63986-submit@debbugs.gnu.org id=B63986.168746012732635 (code B ref 63986); Thu, 22 Jun 2023 18:56:02 +0000 Received: (at 63986) by debbugs.gnu.org; 22 Jun 2023 18:55:27 +0000 Received: from localhost ([127.0.0.1]:36742 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qCPSp-0008UJ-8N for submit@debbugs.gnu.org; Thu, 22 Jun 2023 14:55:27 -0400 Received: from mail-wm1-f46.google.com ([209.85.128.46]:58811) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qCPSl-0008U2-OQ for 63986@debbugs.gnu.org; Thu, 22 Jun 2023 14:55:25 -0400 Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-3f9b4a71623so42172655e9.1 for <63986@debbugs.gnu.org>; Thu, 22 Jun 2023 11:55:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687460118; x=1690052118; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date:sender:from:to :cc:subject:date:message-id:reply-to; bh=ANqVlzFUPFGBCFGLmuLmlp52BrGF8o/ek7tSUgBWEO8=; b=o0iO8M6Ow0mtyGUhOqmu0MosKKQh3uWAj5KOiCqVjQIgSVlbSQTHVp5xgdBg3/z0Ec 1hTJPsZCgm1vIz9ZblE5pq/pW4TWTSqIVcfvPSLhBZl3JE67/jvCa6d0STpRvY5qcGN0 PArrRrpZP0gmd9VLCCv1ut6bVBHlCdq+hRdRxOskKWMR4puw9Lk7k2M1tDdyaCLtxRzQ 9kucEYcNygZxGeJqk5UQ9Uzrd5YtM5LTEmcs1VOKAo4NC10h1UinTjqdcroSo0OMMzwM YACwzYPT8YNG/T7tQL/MAZ4A7/90+0cZZs3qkz0pKXpvN1yZHAszs/kIya6776tmBt63 hLlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687460118; x=1690052118; h=in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date:sender :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ANqVlzFUPFGBCFGLmuLmlp52BrGF8o/ek7tSUgBWEO8=; b=TI6XhdwhK12cwIFh2STo0GHMQJFNrmF3SAjr0qDEmxESbdMs6ESg2bq1jF4SmQq5Fj Bv7eha5jFQR6CYoe+Ow7p9UFNLKwQ0qg1pcRpMEQ4G/sL9pmpypbJA0wrIzejcLPb2zV 3wCwuGZS88QHS4CkUBEmXIGAJZb8W44Vw2pXjgert52RndIx0lxqmJ+9p6ANhYBqP9Uw TxlwQqD8Sywq6wDPRzArvdUncyyUqWmP58AC1yML3kyYzfnoiGyZP1VZQoraag7tdFFu 7Le5z+P3SZ9y+e5fUkLQ78G0p6lMjKxvSOpR5JKCMUzTjV+4uZsQHthOtRIJ4oJoua5x mjew== X-Gm-Message-State: AC+VfDwd2WSR5wmqoVHsDS9QMFICb6WU2JIENvA8cuQzBkBOtd4JmVHJ JBhwYl2FMNkRIq1NX5t295I= X-Google-Smtp-Source: ACHHUZ6xAPBXU38/tJ7QgzTMP/v7AfycxSzkd550t6XcfGgipyHBaZPa4J9aZI8d3FBKDS6tDL81bw== X-Received: by 2002:a1c:4b08:0:b0:3f7:b1dd:954b with SMTP id y8-20020a1c4b08000000b003f7b1dd954bmr2203107wma.31.1687460117612; Thu, 22 Jun 2023 11:55:17 -0700 (PDT) Received: from localhost ([188.120.129.124]) by smtp.gmail.com with ESMTPSA id n10-20020a7bc5ca000000b003f42314832fsm244466wmk.18.2023.06.22.11.55.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Jun 2023 11:55:17 -0700 (PDT) Date: Thu, 22 Jun 2023 21:55:15 +0300 From: Efraim Flashner Message-ID: Mail-Followup-To: Efraim Flashner , Simon Tournier , Ludovic =?UTF-8?Q?Court=C3=A8s?= , 63986@debbugs.gnu.org, Nicolas Graves , csantosb@inventati.org References: <87legsl3cm.fsf@inventati.org> <87jzw6rq48.fsf@gnu.org> <871qi7a0qr.fsf@gmail.com> <87pm5o7uh9.fsf@gnu.org> <87ttv0mth3.fsf@inventati.org> <87wmzvmxt8.fsf@inventati.org> <87h6qz8pg0.fsf@gmail.com> <875y7f8hbf.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="gEMngYjU58n67i/L" Content-Disposition: inline In-Reply-To: <875y7f8hbf.fsf@gmail.com> X-PGP-Key-ID: 0x41AAE7DCCA3D8351 X-PGP-Key: https://flashner.co.il/~efraim/efraim_flashner.asc X-PGP-Fingerprint: A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: bug-guix-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1687460182; a=rsa-sha256; cv=none; b=c4cI5hYkJ8Jsuyxd1guneoIiw4OrzSEyg2uRFJ8h7i6udPn3riSPkHrz0oiBWTxf+Dh7rW nxIuT9f1PCyPeJBMEkWKnmwtW/Z+G7F5UhdT/QlNqL3bt23yvnTGDi+dcBgNn5GZt926X/ FWKQCK0nS7ItuocFgYcYH+sk4WTthtqODfSYzEy+/f26JHoEF1tWDzal9yK9L1X5N0T5Ff SavZ7nRqjiDNXl5AysQD8epneOKs30NkWPn+CsxBW42l35Or6drXeZxDTTH0VS63F9LQ2j xqn7B/kTXMADeks0F194H8l2GJTz8BtysEX8hHqyKJEVG2yH1akjQnZ4r0bHKg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20221208 header.b=o0iO8M6O; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1687460182; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:resent-cc:resent-from:resent-sender: resent-message-id:in-reply-to:in-reply-to:references:references: list-id:list-help:list-unsubscribe:list-subscribe:list-post: dkim-signature; bh=ANqVlzFUPFGBCFGLmuLmlp52BrGF8o/ek7tSUgBWEO8=; b=FsWq+WFOeiPZ871k0cPeaNs6it27Uzxw4e+kvXECXHgd7paLICOTVCM/3rwQlI0laCFvDF ewsxr8P0g/Gf5u/Lv+YhuKn1py45YP7qUgK5FwOxKTUYXEHFR4IQZplLuB5bVz3kwhy35T KE7pXgixbZ/oFg75ERzd0OmHx6Km/Itkohe23EQHk/02viB3NSVbl0EnsNlbYM0g4xWATp za3excdC/Fm+U+uitfxxRFW9EwZaE0ugJZQNCXopys2OUbGKlqHsD+7XZZfkpagK3hnMLU ZocaNUhg3O/h5K6JtVFCsnnXl+w54CWVk2uwNytMldRb5iOc+Q0ZISJx1mo2Hw== Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20221208 header.b=o0iO8M6O; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "bug-guix-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="bug-guix-bounces+larch=yhetil.org@gnu.org" X-Migadu-Scanner: scn0.migadu.com X-Migadu-Spam-Score: -1.15 X-Spam-Score: -1.15 X-Migadu-Queue-Id: 2A4351352A X-TUID: KTK9xK/zQXvk --gEMngYjU58n67i/L Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jun 22, 2023 at 08:47:48PM +0200, Simon Tournier wrote: > Hi, >=20 > On Thu, 22 Jun 2023 at 19:25, Efraim Flashner wro= te: >=20 > > (ins)efraim@3900XT ~/workspace/guix$ cat /gnu/store/v6z5ykkjfzbc72x1x90= 0xflspqc5wd5r-openblas-ilp64-0.3.20/lib/pkgconfig/openblas.pc > > libdir=3D/gnu/store/v6z5ykkjfzbc72x1x900xflspqc5wd5r-openblas-ilp64-0.3= =2E20/lib > > includedir=3D/gnu/store/v6z5ykkjfzbc72x1x900xflspqc5wd5r-openblas-ilp64= -0.3.20/include > > openblas_config=3D USE_64BITINT=3D DYNAMIC_ARCH=3D1 DYNAMIC_OLDER=3D1 N= O_CBLAS=3D NO_LAPACK=3D NO_LAPACKE=3D NO_AFFINITY=3D1 USE_OPENMP=3D generic= MAX_THREADS=3D128 > > version=3D0.3.20 > > extralib=3D-lm -lpthread -lgfortran -lm -lpthread -lgfortran > > Name: openblas > > Description: OpenBLAS is an optimized BLAS library based on GotoBLAS2 1= =2E13 BSD version > > Version: ${version} > > URL: https://github.com/xianyi/OpenBLAS > > Libs: -L${libdir} -lopenblas > > Libs.private: ${extralib} > > Cflags: -I${includedir} > > > > Looks like it should be "LIBBLAS=3D-lopenblas" >=20 > I propose to tweak openblas-ilp64. Currently it looks like: >=20 > --8<---------------cut here---------------start------------->8--- > $ tree $(guix build openblas-ilp64)/lib > /gnu/store/v6z5ykkjfzbc72x1x900xflspqc5wd5r-openblas-ilp64-0.3.20/lib > =E2=94=9C=E2=94=80=E2=94=80 cmake > =E2=94=82=C2=A0=C2=A0 =E2=94=94=E2=94=80=E2=94=80 openblas > =E2=94=82=C2=A0=C2=A0 =E2=94=9C=E2=94=80=E2=94=80 OpenBLASConfig.cmake > =E2=94=82=C2=A0=C2=A0 =E2=94=94=E2=94=80=E2=94=80 OpenBLASConfigVersi= on.cmake > =E2=94=9C=E2=94=80=E2=94=80 libopenblas_ilp64p-r0.3.20.so > =E2=94=9C=E2=94=80=E2=94=80 libopenblas_ilp64.so -> libopenblas_ilp64p-r0= =2E3.20.so > =E2=94=9C=E2=94=80=E2=94=80 libopenblas_ilp64.so.0 -> libopenblas_ilp64p-= r0.3.20.so > =E2=94=94=E2=94=80=E2=94=80 pkgconfig > =E2=94=94=E2=94=80=E2=94=80 openblas.pc > --8<---------------cut here---------------end--------------->8--- >=20 > which is inconsistent with pkgconfig as you noticed above. Therefore, I > am proposing the addition of a symlink of libopenblas_ilp64p.so to > libopenblas.so. For instance this attached patch. If we drop the "LIBNAMESUFFIX=3Dilp64" from openblas-ilp64 then we get libopenblas.so by default without needing to also symlink it into place. One benefit of this is we'd be able to easily do some package transformations between openblas and openblas-ilp64. Currently I'm looking around online to see what the consensus seems to be with naming openblas-ilp64, and there seems to be a lot of options. > From 0c8c7e9371d11972f4a6012ef503ef3057c91364 Mon Sep 17 00:00:00 2001 > Message-Id: <0c8c7e9371d11972f4a6012ef503ef3057c91364.1687459454.git.zimo= n.toutoune@gmail.com> > From: Simon Tournier > Date: Thu, 22 Jun 2023 20:31:26 +0200 > Subject: [PATCH v3 1/2] gnu: openblas-ilp64: Install symlink to libopenbl= as. >=20 > * gnu/packages/maths.scm (openblas-ilp64)[arguments]: Add phases for > installing symlink to libopenblas. > --- > gnu/packages/maths.scm | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) >=20 > diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm > index f5a2181905..5c39ab8b94 100644 > --- a/gnu/packages/maths.scm > +++ b/gnu/packages/maths.scm > @@ -4646,7 +4646,13 @@ (define-public openblas-ilp64 > (substitute-keyword-arguments (package-arguments openblas) > ((#:make-flags flags #~'()) > #~(append (list "INTERFACE64=3D1" "LIBNAMESUFFIX=3Dilp64") > - #$flags)))) > + #$flags)) > + ((#:phases phases) > + #~(modify-phases #$phases > + (add-after 'install 'install-symlink > + (lambda _ > + (symlink "libopenblas_ilp64.so" > + (string-append #$output "/lib/libopenblas.so"))= )))))) > (synopsis "Optimized BLAS library based on GotoBLAS (ILP64 version)") > (license license:bsd-3))) > =20 >=20 > base-commit: 37c2e94cec6cb8b5e0e93e7b6c712c3b187ca5db > --=20 > 2.38.1 >=20 >=20 > Then, the patch for Julia looks like the other attached patch. >=20 > From 8563a738703d133b44ae05b91b7448ca56d280b5 Mon Sep 17 00:00:00 2001 > Message-Id: <8563a738703d133b44ae05b91b7448ca56d280b5.1687459454.git.zimo= n.toutoune@gmail.com> > In-Reply-To: <0c8c7e9371d11972f4a6012ef503ef3057c91364.1687459454.git.zim= on.toutoune@gmail.com> > References: <0c8c7e9371d11972f4a6012ef503ef3057c91364.1687459454.git.zimo= n.toutoune@gmail.com> > From: Simon Tournier > Date: Thu, 22 Jun 2023 17:45:50 +0200 > Subject: [PATCH v3 2/2] gnu: julia: Conditionally use openblas with ILP64 > support. >=20 > Fixes . > Reported by Cayetano Santos . >=20 > * gnu/packages/julia.scm (julia)[arguments]<#:make-flags>: Conditionally = use > 64-bit BLAS for x86-64 target. > [inputs]: Conditionally replace openblas by openblas-ilp64 for x86-64 tar= get. > --- > gnu/packages/julia.scm | 10 ++++++---- > 1 file changed, 6 insertions(+), 4 deletions(-) >=20 > diff --git a/gnu/packages/julia.scm b/gnu/packages/julia.scm > index ba54175822..17a27f4928 100644 > --- a/gnu/packages/julia.scm > +++ b/gnu/packages/julia.scm > @@ -479,9 +479,9 @@ (define-public julia > "NO_GIT=3D1" ; build from release tarball. > "USE_GPL_LIBS=3D1" ; proudly > =20 > - ,@(if (target-aarch64?) > - `("USE_BLAS64=3D0") > - '()) > + ,@(if (target-x86-64?) > + `("USE_BLAS64=3D1") > + '()) > =20 > "LIBBLAS=3D-lopenblas" > "LIBBLASNAME=3Dlibopenblas" > @@ -513,7 +513,9 @@ (define-public julia > ("llvm" ,llvm-julia) > ("mbedtls-apache" ,mbedtls-apache) > ("mpfr" ,mpfr) > - ("openblas" ,openblas) > + ,@(if (target-x86-64?) > + `(("openblas" ,openblas-ilp64)) > + `(("openblas" ,openblas))) > ("openlibm" ,openlibm) > ("p7zip" ,p7zip) > ("pcre2" ,pcre2) > --=20 > 2.38.1 >=20 >=20 > WDYT? >=20 > Well, I am running all the testsuite for checking if all is correct. > Somehow, I think this is direction. Otherwise, what would you suggest? >=20 > Cheers, > simon >=20 >=20 >=20 --=20 Efraim Flashner =D7=A8=D7=A0=D7=A9=D7=9C=D7=A4 = =D7=9D=D7=99=D7=A8=D7=A4=D7=90 GPG key =3D A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Confidentiality cannot be guaranteed on emails sent or received unencrypted --gEMngYjU58n67i/L Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAmSUmQ8ACgkQQarn3Mo9 g1HAzBAApzwRY8knjwQjcNMckKOnvm3ijPtcg/obG60V/rc8Lt0FSoR6vQItN1Yx /lyf+WMkSntOt3BbCUa47GI+BzHBgoUvlhh9oxUyIiNDYKceVdTCXk8EqxT8woLb Tx6jYWJyqun/v/ToyOr0m+MHyljoER93/TlRt2zWHwRvC+d6OdDos1GvRM4/dtEp nlsI5R7pcjLsCb97+wLc9nfzxOLHvVykDNMqWHVFCdRdNPO9PxJoN9TFtL/h0Btp 7RHgVBBl16ljHi82qvVJp2vrMEObTkaL4UIe0fbYmZfylJIiKWfFL+JSdM5sX8oi 6+7uNev3x7lzn+bxWj3pi/ZR9m5l3lXPa1+HKUbAtz2SR1zTJFqQgtuT/E50jFzd wgcL64tXaIo7FkRYvXexsSJVkFIxs/ZTCOV7R65m4haXVsF37B9pylrCrYDmvt9J 26IoWZazmex1G2WjUQ8rrn9EKiLkzLURwSqwtABRZ+6CMYNd5eEQZ5/oQ+WYJMKY rgqeuLe44Uz4ozysP7BNbcsuF/C6z8oFg8Nd7xAhiW+y9l5Ux6uKrOKFtuqjcJMT 5nyAN8CuX7zbr1MKe7K154T0QyerIkW2lWCrcPfLa7gMEcalzmk/bUQON03kUHhP pcI5orfVRWH5a27E/mZ6ee36w31gfKOfe1z3Eb03gg8OyeTqhZI= =jfnB -----END PGP SIGNATURE----- --gEMngYjU58n67i/L--