Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Speed up MPC multiplication #15744

Closed
jdemeyer opened this issue Jan 27, 2014 · 14 comments
Closed

Speed up MPC multiplication #15744

jdemeyer opened this issue Jan 27, 2014 · 14 comments

Comments

@jdemeyer
Copy link

Add a patch from Paul Zimmermann which significantly speeds up MPC multiplication (although it is still noticably slower than ComplexField which is based on MPFR).

Timings (time in microseconds for 1 multiplication on an Intel(R) Core(TM) i7-2640M CPU @ 2.80GHz):

Prec (bits) ComplexField MPComplexField (old) MPComplexField (new)
53 0.53 1.09 0.81
128 0.56 1.18 0.90
360 0.77 1.47 1.12
1024 1.74 3.98 3.39

Depends on #15697

CC: @zimmermann6 @jpflori

Component: packages: standard

Author: Jeroen Demeyer

Branch: c86f678

Reviewer: Jean-Pierre Flori

Issue created by migration from https://trac.sagemath.org/ticket/15744

@jdemeyer

This comment has been minimized.

@jdemeyer

This comment has been minimized.

@jdemeyer
Copy link
Author

Branch: u/jdemeyer/ticket/15744

@jdemeyer
Copy link
Author

Dependencies: #15697

@jdemeyer
Copy link
Author

Commit: c86f678

@jdemeyer
Copy link
Author

New commits:

00a5937Upgrade MPC to version 1.0.2
c86f678Speed up MPC multiplication

@jdemeyer

This comment has been minimized.

@sagetrac-vbraun-spam sagetrac-vbraun-spam mannequin modified the milestones: sage-6.1, sage-6.2 Jan 30, 2014
@jpflori
Copy link

jpflori commented Feb 19, 2014

comment:8

For future ref, patch taken from upstream commit r1439 (https://gforge.inria.fr/scm/viewvc.php/trunk/src/mul.c?root=mpc&r1=1298&r2=1439).

@jpflori
Copy link

jpflori commented Feb 19, 2014

comment:9

Everything looks fine and multiplication is indeed sped up.

@jpflori
Copy link

jpflori commented Feb 19, 2014

Reviewer: Jean-Pierre Flori

@vbraun
Copy link
Member

vbraun commented Feb 22, 2014

Changed branch from u/jdemeyer/ticket/15744 to c86f678

@zimmermann6
Copy link

comment:11

I have added a new function mpfr_fmma (and its companion mpfr_fmms) in the development version of MPFR. This function is now used in the development version of MPC. Those functions should be faster than the patch used in this ticket. Please could someone update the timings with those new functions?

  1. Get the development (svn) version of MPFR.
  2. Get the development (git) version of MPC, and check that configure finds mpfr_fmma and it is used in mpc_mul.
  3. Rebuild Sage with those version of MPFR and MPC.

Paul

PS: the 1.74ms for ComplexField in 1024 bits looks dubious to me, if you compare to 0.77ms for 360 bits. What is the command used for those timings?

@zimmermann6
Copy link

Changed commit from c86f678 to none

@zimmermann6
Copy link

comment:12

Jeroen, please could you redo the timings with the new mpfr_fmma from the development version of MPFR (as indicated in comment [comment:11]), and publish the code you used in the description so that we can reproduce your timings?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants