unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Paul Zimmermann <Paul.Zimmermann@inria.fr>
To: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
Cc: libc-alpha@sourceware.org
Subject: Re: [PATCH] Improve hypot performance
Date: Wed, 01 Dec 2021 12:12:11 +0100	[thread overview]
Message-ID: <mwo86037g4.fsf@tomate.loria.fr> (raw)
In-Reply-To: <VE1PR08MB5599DFC6FA620B3B3AFA212B83679@VE1PR08MB5599.eurprd08.prod.outlook.com> (message from Wilco Dijkstra via Libc-alpha on Tue, 30 Nov 2021 13:04:27 +0000)

       Dear Wilco,

> Improve hypot performance significantly by using fma when available. The fma
> version has twice the throughput of the previous version and 70% of the latency.
> The non-fma version has 30% higher throughput and 10% higher latency.

I cannot reproduce these figures. On a x86_64 for the fma version I get almost
identical throughput, and only 88% of the previous latency. For the non-fma
version I get 24% smaller throughput (31% larger *reciprocal* throughput),
and 51% higher latency.

With fma:

before:
  "hypot": {
   "workload-random": {
    "duration": 3.31399e+09,
    "iterations": 7.4e+07,
    "reciprocal-throughput": 32.4478,
    "latency": 57.1194,
    "max-throughput": 3.08188e+07,
    "min-throughput": 1.75072e+07
   }

with patch:
  "hypot": {
   "workload-random": {
    "duration": 3.33618e+09,
    "iterations": 8.2e+07,
    "reciprocal-throughput": 31.205,
    "latency": 50.1653,
    "max-throughput": 3.20462e+07,
    "min-throughput": 1.99341e+07
   }

Without fma:

before:
  "hypot": {
   "workload-random": {
    "duration": 3.34724e+09,
    "iterations": 7.4e+07,
    "reciprocal-throughput": 32.9285,
    "latency": 57.5374,
    "max-throughput": 3.03689e+07,
    "min-throughput": 1.738e+07
   }

with patch:
  "hypot": {
   "workload-random": {
    "duration": 3.38571e+09,
    "iterations": 5.2e+07,
    "reciprocal-throughput": 43.1054,
    "latency": 87.1141,
    "max-throughput": 2.31989e+07,
    "min-throughput": 1.14792e+07
   }

> Max ULP error is 0.949 with fma and 0.792 without fma.

I confirm this. More precisely here are the largest errors I find with
corresponding inputs:

Without fma:
hypot 0x0.603e52daf0bfdp-1022,-0x0.a622d0a9a433bp-1022 0.791664

With fma:
hypot -0x0.5a22c27a3893p-1022,0x0.9cfea180c00dap-1022 0.948811

(compared to 0.986776 for the current version, with inputs
-0x0.5a934b7eac967p-1022,-0x0.b5265a7e06b82p-1022).

Best regards,
Paul


  parent reply	other threads:[~2021-12-01 11:12 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-30 13:04 [PATCH] Improve hypot performance Wilco Dijkstra via Libc-alpha
2021-11-30 16:27 ` Adhemerval Zanella via Libc-alpha
2021-11-30 18:19 ` Adhemerval Zanella via Libc-alpha
2021-12-01 11:12 ` Paul Zimmermann [this message]
2021-12-01 12:06   ` Adhemerval Zanella via Libc-alpha
2021-12-01 13:20     ` Wilco Dijkstra via Libc-alpha
2021-12-01 13:26     ` Paul Zimmermann
2021-12-01 14:08       ` Wilco Dijkstra via Libc-alpha
2021-12-01 17:14     ` Wilco Dijkstra via Libc-alpha

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

  List information: https://www.gnu.org/software/libc/involved.html

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

  git send-email \
    --in-reply-to=mwo86037g4.fsf@tomate.loria.fr \
    --to=paul.zimmermann@inria.fr \
    --cc=Wilco.Dijkstra@arm.com \
    --cc=libc-alpha@sourceware.org \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).