unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: naohirot--- via Libc-alpha <libc-alpha@sourceware.org>
To: Noah Goldstein <goldstein.w.n@gmail.com>,
	Wilco Dijkstra <Wilco.Dijkstra@arm.com>,
	"Lucas A. M. Magalhaes" <lamm@linux.ibm.com>
Cc: GNU C Library <libc-alpha@sourceware.org>
Subject: RE: [PATCH] benchtests: Add memset zero fill benchmark tests
Date: Tue, 20 Jul 2021 08:51:16 +0000	[thread overview]
Message-ID: <TYAPR01MB602543F7E0835D3A4B00DA56DFE29@TYAPR01MB6025.jpnprd01.prod.outlook.com> (raw)
In-Reply-To: <TYAPR01MB60256498874B9DF1A0021E0CDF129@TYAPR01MB6025.jpnprd01.prod.outlook.com>

Hi Lucas, Wilco, Noah,

> From: Tamura, Naohiro/田村 直広 <naohirot@fujitsu.com>
> Sent: Thursday, July 15, 2021 5:16 PM

> > [1] https://travisdowns.github.io/blog/2020/05/13/intel-zero-opt.html
> 
> I throughly read the blog, it's very interesting.
> It seems that Skylake-S microarchitcture has some zero-over-zero
> optimization in the size range of L3 and RAM.
> 
> So why don't we proceed like this?
> - create a new benchtest file, ex. memset-zerofill.c.
>   it measures zero-over-zero and zero-over-one from 32KB(L1), through
>   L2 and L3, to 64MB(RAM)
> - create a script to extract some part of data such as zero-over-zero
>   or zero-over-one from JSON bench result to CSV in the first place in
>   order to create graph in spreadsheet
> - update benchtests/scripts/plot_strings.py later so that it can draw
>   zero-over-zero and zero-over-one separately

Here is a result of the memset zero fill patch v2 [1] using the source code A64FX memset patch v2 [2].

The first graph [3] is the zero-over-zero result by typing the command:

$ cat bench-memset-zerofill.out | jq -r '.functions.memset."bench-variant"="zerofill-0o0" | del(.functions.memset.results[] | select(.char1 != 0))' | plot_strings.py -l -p thru -v -

The second graph [4] is the zero-over-one result by typing the command:

$ cat bench-memset-zerofill.out | jq -r '.functions.memset."bench-variant"="zerofill-0o1" | del(.functions.memset.results[] | select(.char1 != 1))' | plot_strings.py -l -p thru -v -

In case of zero-over-zero, it's very interesting that memset_generic is faster than memset_a64fx.
On the other hand, however, in case of zero-over-one, memset_a64fx is faster is faster than memset_generic.
It may be due to SVE code.
Comparing the memset_generic performance, that is non SVE code, between zero-over-zero and zero-over-one, 
it seems that a64fx micro-architecture has some zero-over-zero optimization?.

[1] https://sourceware.org/pipermail/libc-alpha/2021-July/129290.html
[2] https://sourceware.org/pipermail/libc-alpha/2021-July/128857.html
[3] https://drive.google.com/file/d/1iNlp-srAq-p9fr7PuRh62TRj-V2eJi0U/view?usp=sharing
[4] https://drive.google.com/file/d/1UipGRHUWU8WJ1-EbV6YzoTcOtxtOhAy0/view?usp=sharing

Thanks.
Naohiro


  reply	other threads:[~2021-07-20  8:51 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-13 15:57 [PATCH] benchtests: Add memset zero fill benchmark tests Wilco Dijkstra via Libc-alpha
2021-07-13 18:47 ` Noah Goldstein via Libc-alpha
2021-07-15  8:15   ` naohirot--- via Libc-alpha
2021-07-20  8:51     ` naohirot--- via Libc-alpha [this message]
2021-07-20 10:29       ` Wilco Dijkstra via Libc-alpha
  -- strict thread matches above, loose matches on Subject: below --
2021-07-13  8:22 Naohiro Tamura via Libc-alpha
2021-07-13 13:50 ` Lucas A. M. Magalhaes 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=TYAPR01MB602543F7E0835D3A4B00DA56DFE29@TYAPR01MB6025.jpnprd01.prod.outlook.com \
    --to=libc-alpha@sourceware.org \
    --cc=Wilco.Dijkstra@arm.com \
    --cc=goldstein.w.n@gmail.com \
    --cc=lamm@linux.ibm.com \
    --cc=naohirot@fujitsu.com \
    /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).