I have just been contacted off list by a very experienced assembly expert
who would like to help develop Broadwell assembly optimisations, guided by
your experiments (as far as I know, he doesn't actually have a Broadwell
machine).

If you are ok with it, I could share your email with him so that he can
communicate with you off list. Would you be up for working with him on this?

Bill.

On 21 February 2017 at 09:05, Bill Hart <goodwillh...@googlemail.com> wrote:

>
>
> On 21 February 2017 at 00:35, <wrai...@morpheus.net> wrote:
>
>> Hello Bill,
>>
>> I can report that both of my systems are now correctly detected.  Thank
>> you for the fix!
>>
>> I also noticed that there were a couple of other missing processor models
>> when compared with GMP mpn/x86_64/fat/fat.c: (the * star values are missing
>> in MPIR)
>> Broadwell:
>> 0x3d=61
>> 0x47=71 *
>> 0x4f=79
>> 0x56=86 *
>> Skylake:
>> 0x4e=78
>> 0x55=85 *
>> 0x5e=94
>> Kabylake:
>> 0x8e=142 *
>> 0x9e=158 *
>> There was a word of warning in the GMP source about some Haswell's not
>> supporting BMI2, and so they treated those as Sandybridges.  I'm not sure
>> how you want to handle this, but I wanted to make sure I passed the warning
>> on to you.
>>
>
> Thanks, I will look into the models we are missing. We have no support for
> Kaby Lake at this point. We are aware of the crippled Haswells and handle
> those I believe.
>
>
>>
>> I ran the speed program, but I do not see how to "choose different
>> assembly files".  Do I have to build different speed programs with
>> different assembly files linked in?
>
>
> It only uses the assembly files currently linked into MPIR. You have to
> put different files in and rebuild.
>
>
>>   Is this an option passed to "make speed"?  Do various gmp-mparam.h
>> files need to be copied to a specific location before "make speed" to
>> create a different speed binary?
>
>
> gmp-mparam.h has no effect on speed.
>
>
>> Once I'm past this step, I believe I can figure out the rest by writing a
>> script to automate the data gathering.
>>
>> What sizes are of interest when running these tests? 1-100, 1-1000,
>> 1-10000, etc?
>
>
> Typically 1-100 or 1-1000 is of interest.
>
>
>> Can a given test be faster with one assembly file at one size, but be
>> faster with a different assembly file at a larger size?
>
>
> Yes, sometimes a stall can slow down the processor from some size on.
> Anything can happen. The only way to get it optimal is to wrote new
> assembly for that particular CPU after analysing stalls and performance
> counters.
>
>
>> When I gather this data, would you like a copy of it?
>
>
> No. I don't have time to do anything with it.
>
>
>> Perhaps in a csv file?
>>
>> BTW, when I run the speed program as is, right now, it gives results
>> similar to the following:
>>
>> $ ./speed -s 10-20 -t 5 mpz_add
>> overhead 0.000000004 secs, precision 1000000 units of 8.33e-10 secs, CPU
>> freq 1200.00 MHz
>>               mpz_add
>> 10        0.000000025
>> 15        0.000000031
>> 20        0.000000033
>>
>> $ ./speed -s 10-20 -t 5 mpn_sqrtrem
>> overhead 0.000000004 secs, precision 1000000 units of 8.33e-10 secs, CPU
>> freq 1200.00 MHz
>>           mpn_sqrtrem
>> 10        0.000000717
>> 15        0.000000900
>> 20        0.000001129
>>
>> Are there any specific options you would like me to use when running
>> these speed tests and gathering results?
>>
>
> No. But typically I use -t 1 because I want to be able to analyse all the
> data.
>
> You might also find mpir_bench_two useful (see our website). Note that
> you'll need to run speed multiple times, and keep an eye on the reported
> CPU frequency. Timings vary a lot.
>
> Also, please only use these tools on Linux. Windows is not stable enough
> to get meaningful timings. Good luck!
>
> Bill.
>
>
>>
>> -David C.
>>
>> On 2/20/2017 10:09 AM, 'Bill Hart' via mpir-devel wrote:
>>
>>> I have issued an alpha3 which supports your particular Broadwell chip,
>>> which was
>>> a Family we weren't aware of. Can you verify that it is now detected
>>> correctly.
>>>
>>> As for optimising for Broadwell, if you are interested, we'd be happy to
>>> have
>>> the help. I've added details to the relevant ticket [1] to explain what
>>> would
>>> need to be done. But it's not for the faint hearted!
>>>
>>> The speed program mentioned that can be built by checking out MPIR from
>>> GitHub,
>>> configuring MPIR and then doing make speed. To run the speed program,
>>> type
>>> ./speed. It explains how to use itself. This is not something automatic;
>>> there's
>>> considerable work involved.
>>>
>>> Bill.
>>>
>>> [1] https://github.com/wbhart/mpir/issues/198
>>>
>>> On 18 February 2017 at 20:24, <wrai...@morpheus.net
>>> <mailto:wrai...@morpheus.net>> wrote:
>>>
>>>     Hello Bill,
>>>
>>>     I have two identical Broadwell computers, except that one runs
>>> Windows 7 Pro
>>>     x64 and the other runs Linux x64 (based on CentOS 6.7).  The
>>> processor in
>>>     both is an Intel Xeon E5-2687W v4.  I did 3 different
>>> configures/tunes on
>>>     each system, in 3 different directories so there would be no cross
>>>     contamination.  Configure originally chose k8 for both systems.  The
>>>     commands I ran were:
>>>     ===================
>>>     On Windows:
>>>     ./configure --enable-gmpcompat --disable-shared
>>>     ./configure --enable-gmpcompat --disable-shared
>>> --build=haswell-w64-mingw32
>>>     ./configure --enable-gmpcompat --disable-shared
>>> --build=broadwell-w64-mingw32
>>>     make -j4
>>>     make check
>>>     cd tune
>>>     make tune
>>>
>>>     Both make and make check completed successfully for all 3 builds.
>>> However,
>>>     all 3 tune programs ended up crashing.  I'm not sure why, but I'm
>>> including
>>>     the screen output in case you can see what the problem was.
>>>
>>>     ===================
>>>     On Linux:
>>>     ./configure --enable-gmpcompat --disable-shared
>>>     ./configure --enable-gmpcompat --disable-shared
>>>     --build=haswell-unknown-linux-gnu
>>>     ./configure --enable-gmpcompat --disable-shared
>>>     --build=broadwell-unknown-linux-gnu
>>>     make -j4
>>>     make check
>>>     cd tune
>>>     make tune
>>>
>>>     Both make and make check completed successfully for all 3 builds.
>>> On Linux
>>>     all 3 tune programs completed successfully.
>>>     ===================
>>>
>>>     All together I'm including 13 text files, the 6 config.log files,
>>> the 6 tune
>>>     screen outputs, and the "cat /proc/cpuinfo" from my Linux computer.
>>> I'm
>>>     putting them in a zip file, but if this doesn't make it to the
>>> mailing list,
>>>     I can resend with all 13 text files directly attached.
>>>
>>>     Also, I see that you mentioned you would like some tests run on
>>> different
>>>     assembly files to see which will run faster on Broadwell.  Could you
>>> let me
>>>     know what tests you would like me to run, and also how to run these
>>> tests.
>>>     I'd be happy to help if I can.  I would personally like to see
>>> Broadwell
>>>     supported in this release, but I know that will take a lot of work.
>>> Let me
>>>     know if I can help or if there is any other information I can
>>> provide.
>>>
>>>     -David C.
>>>
>>>     On 2/14/2017 4:16 AM, 'Bill Hart' via mpir-devel wrote:
>>>
>>>         It looks like you configured your broadwell as a generic x86_64
>>> instead
>>>         of as a
>>>         haswell (as per your patch). This means that it wasn't using
>>> anything
>>>         other than
>>>         generic assembly for the build, and hence the tuning values will
>>> be way off.
>>>
>>>         Perhaps you can force it to build as a haswell and then run tune
>>> again.
>>>
>>>         On 14 February 2017 at 10:24, Isuru Fernando <isu...@gmail.com
>>>         <mailto:isu...@gmail.com>
>>>         <mailto:isu...@gmail.com <mailto:isu...@gmail.com>>> wrote:
>>>
>>>              Attached are tuning values for nehalem, ivybridge,
>>> broadwell and
>>>         skylake.
>>>              (Also cpuinfo for the broadwell one)
>>>
>>>              Isuru Fernado
>>>
>>>              On Tue, Feb 14, 2017 at 1:29 PM, 'Bill Hart' via mpir-devel
>>>              <mpir-devel@googlegroups.com <mailto:mpir-devel@googlegroup
>>> s.com>
>>>         <mailto:mpir-devel@googlegroups.com
>>>         <mailto:mpir-devel@googlegroups.com>>> wrote:
>>>
>>>                  Apparently if you have a very recent machine, yasm may
>>> fail to
>>>         build the
>>>                  assembly files for your architecture. To get around
>>> this,
>>>         install the
>>>                  latest yasm [1] and use MPIR's --with-system-yasm
>>> option.
>>>
>>>                  If your system is recent and detects as core2 or k8 or
>>> simply
>>>         x86_64 or
>>>                  something else obviously out-of-date, when tuning,
>>> please also
>>>         send us a
>>>                  copy of cat /proc/cpuinfo so we can add support for your
>>>         processor to MPIR.
>>>
>>>                  Bill.
>>>
>>>                  [1] http://yasm.tortall.net/
>>>
>>>                  On 13 February 2017 at 18:41, Bill Hart
>>>         <goodwillh...@googlemail.com <mailto:goodwillh...@googlemail.com
>>> >
>>>                  <mailto:goodwillh...@googlemail.com
>>>
>>>         <mailto:goodwillh...@googlemail.com>>> wrote:
>>>
>>>                      Hi all,
>>>
>>>                      MPIR has been modified recently, and new tuning
>>> crossovers
>>>         have been
>>>                      added.
>>>
>>>                      If you have a machine that you want MPIR to run
>>> fast on, we
>>>         would
>>>                      really appreciate help getting tuning values for
>>> your
>>>         machine. Here
>>>                      is how.
>>>
>>>                      git clone https://github.com/wbhart/mpir
>>>                      <https://github.com/wbhart/mpir
>>>         <https://github.com/wbhart/mpir>>
>>>                      cd mpir
>>>                      ./configure --enable-gmpcompat
>>>                      make -j4
>>>                      make check
>>>                      cd tune
>>>                      make tune
>>>
>>>                      Please attach the tuning values that are printed to
>>> this post.
>>>                      Please ensure that the first line is not missing,
>>> e.g.
>>>
>>>                          Parameters for ./mpn/x86_64/k8/k10/k102/gmp-m
>>> param.h
>>>
>>>                      as this tells us what machine the values are for.
>>>
>>>                      If the tuning program crashes, or starts to take
>>> too long,
>>>         just send
>>>                      us the values you have.
>>>
>>>                      Any help that people can provide is really
>>> appreciated.
>>>
>>>                      Note that we DON'T require tuning values for the
>>> following
>>>         arches:
>>>
>>>                      mpn/x86_64/k8/k10/k102
>>>                      mpn/x86_64/haswell
>>>
>>>                      If someone already attached values for your arch,
>>> no need
>>>         to supply
>>>                      them again.
>>>
>>>                      Bill.
>>>
>>>
>>>                  --
>>>                  You received this message because you are subscribed to
>>> the Google
>>>                  Groups "mpir-devel" group.
>>>                  To unsubscribe from this group and stop receiving
>>> emails from
>>>         it, send
>>>                  an email to mpir-devel+unsubscr...@googlegroups.com
>>>         <mailto:mpir-devel%2bunsubscr...@googlegroups.com>
>>>                  <mailto:mpir-devel+unsubscr...@googlegroups.com
>>>         <mailto:mpir-devel%2bunsubscr...@googlegroups.com>>.
>>>                  To post to this group, send email to
>>>         mpir-devel@googlegroups.com <mailto:mpir-devel@googlegroups.com>
>>>                  <mailto:mpir-devel@googlegroups.com
>>>         <mailto:mpir-devel@googlegroups.com>>.
>>>                  Visit this group at https://groups.google.com/grou
>>> p/mpir-devel
>>>         <https://groups.google.com/group/mpir-devel>
>>>                  <https://groups.google.com/group/mpir-devel
>>>         <https://groups.google.com/group/mpir-devel>>.
>>>                  For more options, visit https://groups.google.com/d/op
>>> tout
>>>         <https://groups.google.com/d/optout>
>>>                  <https://groups.google.com/d/optout
>>>         <https://groups.google.com/d/optout>>.
>>>
>>>
>>>              --
>>>              You received this message because you are subscribed to the
>>> Google
>>>         Groups
>>>              "mpir-devel" group.
>>>              To unsubscribe from this group and stop receiving emails
>>> from it,
>>>         send an
>>>              email to mpir-devel+unsubscr...@googlegroups.com
>>>         <mailto:mpir-devel%2bunsubscr...@googlegroups.com>
>>>              <mailto:mpir-devel+unsubscr...@googlegroups.com
>>>         <mailto:mpir-devel%2bunsubscr...@googlegroups.com>>.
>>>              To post to this group, send email to
>>> mpir-devel@googlegroups.com
>>>         <mailto:mpir-devel@googlegroups.com>
>>>              <mailto:mpir-devel@googlegroups.com
>>>         <mailto:mpir-devel@googlegroups.com>>.
>>>              Visit this group at https://groups.google.com/grou
>>> p/mpir-devel
>>>         <https://groups.google.com/group/mpir-devel>
>>>              <https://groups.google.com/group/mpir-devel
>>>         <https://groups.google.com/group/mpir-devel>>.
>>>              For more options, visit https://groups.google.com/d/optout
>>>         <https://groups.google.com/d/optout>
>>>              <https://groups.google.com/d/optout
>>>         <https://groups.google.com/d/optout>>.
>>>
>>>
>>>         --
>>>         You received this message because you are subscribed to the
>>> Google Groups
>>>         "mpir-devel" group.
>>>         To unsubscribe from this group and stop receiving emails from
>>> it, send
>>>         an email
>>>         to mpir-devel+unsubscr...@googlegroups.com
>>>         <mailto:mpir-devel%2bunsubscr...@googlegroups.com>
>>>         <mailto:mpir-devel+unsubscr...@googlegroups.com
>>>         <mailto:mpir-devel%2bunsubscr...@googlegroups.com>>.
>>>         To post to this group, send email to mpir-devel@googlegroups.com
>>>         <mailto:mpir-devel@googlegroups.com>
>>>         <mailto:mpir-devel@googlegroups.com <mailto:
>>> mpir-devel@googlegroups.com>>.
>>>         Visit this group at https://groups.google.com/group/mpir-devel
>>>         <https://groups.google.com/group/mpir-devel>.
>>>         For more options, visit https://groups.google.com/d/optout
>>>         <https://groups.google.com/d/optout>.
>>>
>>>
>>>     --
>>>     You received this message because you are subscribed to the Google
>>> Groups
>>>     "mpir-devel" group.
>>>     To unsubscribe from this group and stop receiving emails from it,
>>> send an
>>>     email to mpir-devel+unsubscr...@googlegroups.com
>>>     <mailto:mpir-devel%2bunsubscr...@googlegroups.com>.
>>>     To post to this group, send email to mpir-devel@googlegroups.com
>>>     <mailto:mpir-devel@googlegroups.com>.
>>>     Visit this group at https://groups.google.com/group/mpir-devel
>>>     <https://groups.google.com/group/mpir-devel>.
>>>     For more options, visit https://groups.google.com/d/optout
>>>     <https://groups.google.com/d/optout>.
>>>
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups
>>> "mpir-devel" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email
>>> to mpir-devel+unsubscr...@googlegroups.com
>>> <mailto:mpir-devel+unsubscr...@googlegroups.com>.
>>> To post to this group, send email to mpir-devel@googlegroups.com
>>> <mailto:mpir-devel@googlegroups.com>.
>>> Visit this group at https://groups.google.com/group/mpir-devel.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "mpir-devel" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to mpir-devel+unsubscr...@googlegroups.com.
>> To post to this group, send email to mpir-devel@googlegroups.com.
>> Visit this group at https://groups.google.com/group/mpir-devel.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"mpir-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mpir-devel+unsubscr...@googlegroups.com.
To post to this group, send email to mpir-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/mpir-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to