public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com>
To: Alexander Monakov <amonakov@ispras.ru>
Cc: "H.J. Lu" <hjl.tools@gmail.com>,
	GNU C Library <libc-alpha@sourceware.org>
Subject: Re: [PATCH v2] x86-64: Optimize strcmp/wcscmp with AVX2
Date: Tue, 05 Jun 2018 14:02:00 -0000	[thread overview]
Message-ID: <5cac325af2cd4af04e1665475690ba96b5058fc8.camel@linux.intel.com> (raw)
In-Reply-To: <alpine.LNX.2.20.13.1806051235260.10950@monopod.intra.ispras.ru>

On Tue, 2018-06-05 at 13:13 +0300, Alexander Monakov wrote:
> On Mon, 4 Jun 2018, Leonardo Sandoval wrote:
> > 
> > right, perhaps microbenchmarks does not tell us much on this case
> > because AVX and non-AVX is not mixed. Also, if you look at the
> > patch,
> > upper ymm bits are cleared (vzeroupper) before returning from
> > strcmp,
> > thus there is no perf penalty in storing these and then restoring
> > when
> > other AVX code is called again.
> 
> Agreed, but I don't understand why you're bringing up the vzeroupper
> aspect, my concern was about frequency limits only.
> 
> > As I said before, using strcmp wont hurt performance at all
> > (internal
> > HW perf team confirmed what I said) because we are not using any
> > opcode
> > that that may drop frequency.
> 
> Okay. I didn't manage to find confirmations on the Internet though.
> In my previous mail I gave a link to an Intel whitepaper that makes
> no such indications. 

I read the paper you share (thanks for the link), and there are
indications there. 

Read the last part, the FAQ area:

Q: Will workloads not using Intel AVX instructions also 
operate at a reduced frequency?
A: Workloads not using Intel AVX instructions will continue to operate
at or above the 
TDP frequency.

Q: Will running a small number of Intel AVX instructions 
reduce frequency below the regular marked frequency?
A:
No, frequency will be reduced below the regular marked frequency only
if a real power 
or thermal constraint is reached, not just due to the presence of Intel
AVX instructions. 
Some workloads that utilize Intel AVX instructions could still achieve
turbo above the 
marked TDP frequency


> Also there's a presentation from CERN saying,
> 
>     "Compiling with AVX, or even just using a handful of AVX-256 
>      instructions at runtime, will most probably make your program
>      globally slower"
> 
> (in context of using AVX on Haswell)
> URL: https://indico.cern.ch/event/327306/contributions/760669/attachm
> ents/635800/875267/HaswellConundrum.pdf
> 

will look at it.

> > if you have a test scenario to prove the 5% drop, I would like to  
> > test it and discuss it further.
> 
> I don't have access to a range of Haswell/Broadwell/Skylake CPUs to
> test.
> If the PDFs I've referenced are in fact incomplete or in error w.r.t.
> AVX frequency limits, and you have links to more accurate documents,
> can
> you please share them?
> 
> FWIW, on one Haswell CPU I was able to reproduce turbo limits
> appearing
> with non-FMA FP AVX usage, but not INT AVX2. This indicates that on
> Haswell
> the situation is different than what you said initially ("partially
> true for
> AVX2 FMA and AVX512").
> 
> Alexander

      reply	other threads:[~2018-06-05 14:02 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-29 18:53 leonardo.sandoval.gonzalez
2018-06-01 14:46 ` H.J. Lu
2018-06-01 15:30   ` Alexander Monakov
2018-06-01 20:23     ` Leonardo Sandoval
2018-06-02  7:46       ` Alexander Monakov
2018-06-02 11:37         ` Florian Weimer
2018-06-04 14:14         ` Leonardo Sandoval
2018-06-05 10:14           ` Alexander Monakov
2018-06-05 14:02             ` Leonardo Sandoval [this message]

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

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

  git send-email \
    --in-reply-to=5cac325af2cd4af04e1665475690ba96b5058fc8.camel@linux.intel.com \
    --to=leonardo.sandoval.gonzalez@linux.intel.com \
    --cc=amonakov@ispras.ru \
    --cc=hjl.tools@gmail.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).