GNU bug report logs - #53121
[PATCH] gnu: ceres: Update to 2.0.0.

Previous Next

Package: guix-patches;

Reported by: Felix Gruber <felgru <at> posteo.net>

Date: Fri, 7 Jan 2022 22:03:01 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 53121 in the body.
You can then email your comments to 53121 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#53121; Package guix-patches. (Fri, 07 Jan 2022 22:03:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Felix Gruber <felgru <at> posteo.net>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Fri, 07 Jan 2022 22:03:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Felix Gruber <felgru <at> posteo.net>
To: guix-patches <at> gnu.org
Cc: Felix Gruber <felgru <at> posteo.net>
Subject: [PATCH] gnu: ceres: Update to 2.0.0.
Date: Fri,  7 Jan 2022 22:02:17 +0000
* gnu/packages/maths.scm (ceres): Update to 2.0.0.
  [inputs]: Use simplified format.
  (ceres-solver-benchmarks)[phases]: Add schur_eliminator_benchmark.
  Replace autodiff_cost_function_benchmark with new autodiff_benchmarks.
---
 gnu/packages/maths.scm | 41 ++++++++++++++++++++++-------------------
 1 file changed, 22 insertions(+), 19 deletions(-)

diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index b0944f307b..a8fd8a65fa 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -2437,7 +2437,7 @@ satisfiability checking (SAT).")
 (define-public ceres
   (package
     (name "ceres-solver")
-    (version "1.14.0")
+    (version "2.0.0")
     (home-page "http://ceres-solver.org/")
     (source (origin
               (method url-fetch)
@@ -2445,7 +2445,7 @@ satisfiability checking (SAT).")
                                   version ".tar.gz"))
               (sha256
                (base32
-                "13lfxy8x58w8vprr0nkbzziaijlh0vvqshgahvcgw0mrqdgh0i27"))))
+                "00vng9vnmdb1qga01m0why90m0041w7bn6kxa2h4m26aflfqla8h"))))
     (build-system cmake-build-system)
     (arguments
      ;; TODO: Build HTML user documentation and install separately.
@@ -2464,11 +2464,11 @@ satisfiability checking (SAT).")
     (propagated-inputs
      (list glog))                           ;for #include <glog/glog.h>
     (inputs
-     `(("eigen" ,eigen)
-       ("blas" ,openblas)
-       ("lapack" ,lapack)
-       ("suitesparse" ,suitesparse)
-       ("gflags" ,gflags)))
+     (list eigen
+           openblas
+           lapack
+           suitesparse
+           gflags))
     (synopsis "C++ library for solving large optimization problems")
     (description
      "Ceres Solver is a C++ library for modeling and solving large,
@@ -2506,21 +2506,24 @@ can solve two kinds of problems:
                                                   "pkg-config" "eigen3"
                                                   "--cflags"))))
 
-                        (define (compile-file file)
-                          (let ((source (string-append file ".cc")))
-                            (format #t "building '~a'...~%" file)
-                            (apply invoke "c++" "-fopenmp" "-O2" "-g" "-DNDEBUG"
-                                   source "-lceres" "-lbenchmark" "-lglog"
-                                   "-pthread"
-                                   "-o" (string-append bin "/" file)
-                                   "-I" ".." flags)))
+                        (define (compile-file top-dir)
+                          (lambda (file)
+                            (let ((source (string-append file ".cc")))
+                              (format #t "building '~a'...~%" file)
+                              (apply invoke "c++" "-fopenmp" "-O2" "-g" "-DNDEBUG"
+                                     source "-lceres" "-lbenchmark" "-lglog"
+                                     "-pthread"
+                                     "-o" (string-append bin "/" file)
+                                     "-I" top-dir flags))))
 
                         (mkdir-p bin)
                         (with-directory-excursion "internal/ceres"
-                          (for-each compile-file
-                                    '("small_blas_gemm_benchmark"
-                                      "small_blas_gemv_benchmark"
-                                      "autodiff_cost_function_benchmark"))))))
+                          (for-each (compile-file "..")
+                                    '("schur_eliminator_benchmark"
+                                      "small_blas_gemm_benchmark"
+                                      "small_blas_gemv_benchmark"))
+                          (with-directory-excursion "autodiff_benchmarks"
+                            ((compile-file "../..") "autodiff_benchmarks"))))))
                   (delete 'check)
                   (delete 'install))))
     (inputs (modify-inputs (package-inputs ceres)
-- 
2.30.2





Reply sent to Ludovic Courtès <ludo <at> gnu.org>:
You have taken responsibility. (Tue, 11 Jan 2022 19:11:02 GMT) Full text and rfc822 format available.

Notification sent to Felix Gruber <felgru <at> posteo.net>:
bug acknowledged by developer. (Tue, 11 Jan 2022 19:11:02 GMT) Full text and rfc822 format available.

Message #10 received at 53121-done <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Felix Gruber <felgru <at> posteo.net>
Cc: 53121-done <at> debbugs.gnu.org
Subject: Re: bug#53121: [PATCH] gnu: ceres: Update to 2.0.0.
Date: Tue, 11 Jan 2022 20:10:11 +0100
Hi,

Felix Gruber <felgru <at> posteo.net> skribis:

> * gnu/packages/maths.scm (ceres): Update to 2.0.0.
>   [inputs]: Use simplified format.
>   (ceres-solver-benchmarks)[phases]: Add schur_eliminator_benchmark.
>   Replace autodiff_cost_function_benchmark with new autodiff_benchmarks.

Applied, thanks!

Since you’re looking at benchmarks, I’d be curious to see how those you
added compare when passing ‘--tune’:

  https://hpc.guix.info/blog/2022/01/tuning-packages-for-a-cpu-micro-architecture/

Ludo’.




Information forwarded to guix-patches <at> gnu.org:
bug#53121; Package guix-patches. (Tue, 18 Jan 2022 12:40:02 GMT) Full text and rfc822 format available.

Message #13 received at 53121-done <at> debbugs.gnu.org (full text, mbox):

From: Felix Gruber <felgru <at> posteo.net>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 53121-done <at> debbugs.gnu.org
Subject: Re: bug#53121: [PATCH] gnu: ceres: Update to 2.0.0.
Date: Tue, 18 Jan 2022 12:39:42 +0000
[Message part 1 (text/plain, inline)]
Hi Ludo’,

On 1/11/22 20:10, Ludovic Courtès wrote:
> Hi,
> 
> Felix Gruber <felgru <at> posteo.net> skribis:
> 
>> * gnu/packages/maths.scm (ceres): Update to 2.0.0.
>>    [inputs]: Use simplified format.
>>    (ceres-solver-benchmarks)[phases]: Add schur_eliminator_benchmark.
>>    Replace autodiff_cost_function_benchmark with new autodiff_benchmarks.
> 
> Applied, thanks!
> 
> Since you’re looking at benchmarks, I’d be curious to see how those you
> added compare when passing ‘--tune’:
> 
>    https://hpc.guix.info/blog/2022/01/tuning-packages-for-a-cpu-micro-architecture/

Unfortunately, I'm getting mixed results for the benchmarks. In most 
cases, I got slight (<10%) improvements in runtime, but there are also 
some benchmarks that were worse with the --tune flag. I'm wondering 
whether the compiler flags set by the --tune option are correctly used 
by the custom 'build phase of the ceres-solver-benchmarks package. I 
didn't have the time to look closer into it as I'm currently in the 
middle of moving to another country.

Anyways, I've attached the results of benchmark runs that I've generated 
using guix commit 7f779286df7e8636d901f4734501902cc934a72f once untuned 
and once tuned for broadwell CPUs.
My laptop on which I ran the tests has a Quad Core AMD Ryzen 7 PRO 2700U 
CPU with 2200 MHz.

In the attachments you find
* a script run_benchmarks.sh used to run the benchmarks in tuned and 
untuned guix shells,
* text files ending in `-tuned` or `-untuned` which contain the results 
of those benchmark runs,
* a script compare.sh which calls a Python script compare-results.py to 
generate files ending in `-diff` that contain the relative change 
between untuned and tuned benchmarks (negative time and CPU percentages 
mean the tuned benchmark was faster, while for the number of iterations, 
positive percentages mean the tuned benchmark had run more iterations).

Best regards,
Felix
[run_benchmarks.sh (application/x-shellscript, attachment)]
[compare.sh (application/x-shellscript, attachment)]
[compare-results.py (text/x-python, attachment)]
[autodiff_benchmarks-diff (text/plain, attachment)]
[autodiff_benchmarks-tuned (text/plain, attachment)]
[autodiff_benchmarks-untuned (text/plain, attachment)]
[schur_eliminator_benchmark-diff (text/plain, attachment)]
[schur_eliminator_benchmark-tuned (text/plain, attachment)]
[schur_eliminator_benchmark-untuned (text/plain, attachment)]
[small_blas_gemm_benchmark-diff (text/plain, attachment)]
[small_blas_gemm_benchmark-tuned (text/plain, attachment)]
[small_blas_gemm_benchmark-untuned (text/plain, attachment)]
[small_blas_gemv_benchmark-diff (text/plain, attachment)]
[small_blas_gemv_benchmark-tuned (text/plain, attachment)]
[small_blas_gemv_benchmark-untuned (text/plain, attachment)]

Information forwarded to guix-patches <at> gnu.org:
bug#53121; Package guix-patches. (Wed, 19 Jan 2022 10:28:01 GMT) Full text and rfc822 format available.

Message #16 received at 53121-done <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Felix Gruber <felgru <at> posteo.net>
Cc: 53121-done <at> debbugs.gnu.org
Subject: Re: bug#53121: [PATCH] gnu: ceres: Update to 2.0.0.
Date: Wed, 19 Jan 2022 11:26:54 +0100
Hi,

Felix Gruber <felgru <at> posteo.net> skribis:

> Unfortunately, I'm getting mixed results for the benchmarks. In most
> cases, I got slight (<10%) improvements in runtime, but there are also 
> some benchmarks that were worse with the --tune flag. I'm wondering
> whether the compiler flags set by the --tune option are correctly used 
> by the custom 'build phase of the ceres-solver-benchmarks package. I
> didn't have the time to look closer into it as I'm currently in the 
> middle of moving to another country.

OK.

> Anyways, I've attached the results of benchmark runs that I've
> generated using guix commit 7f779286df7e8636d901f4734501902cc934a72f
> once untuned and once tuned for broadwell CPUs.
> My laptop on which I ran the tests has a Quad Core AMD Ryzen 7 PRO
> 2700U CPU with 2200 MHz.

Could it be that ‘znver3’ or something works better on those CPUs?

> In the attachments you find
> * a script run_benchmarks.sh used to run the benchmarks in tuned and
>   untuned guix shells,
> * text files ending in `-tuned` or `-untuned` which contain the
>   results of those benchmark runs,
> * a script compare.sh which calls a Python script compare-results.py
>   to generate files ending in `-diff` that contain the relative change 
> between untuned and tuned benchmarks (negative time and CPU
> percentages mean the tuned benchmark was faster, while for the number
> of iterations, positive percentages mean the tuned benchmark had run
> more iterations).

Interesting, thanks for taking the time to run these benchmarks.

It’s hard to draw conclusions.  I wonder how noisy these measurements
are and whether the differences we’re seeing are significant.  Food for
thoughts!

Ludo’.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 16 Feb 2022 12:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 41 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.