Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.forth > #59714

Re: ANN: matmul package available

From anton@mips.complang.tuwien.ac.at (Anton Ertl)
Newsgroups comp.lang.forth
Subject Re: ANN: matmul package available
Date 2017-05-22 09:50 +0000
Organization Institut fuer Computersprachen, Technische Universitaet Wien
Message-ID <2017May22.115008@mips.complang.tuwien.ac.at> (permalink)
References (4 earlier) <957871d0-1b59-4846-991d-5a127a4e9dac@googlegroups.com> <2017May21.095205@mips.complang.tuwien.ac.at> <655b323d-90ac-4de0-8b05-593b5b2a3171@googlegroups.com> <2017May21.155236@mips.complang.tuwien.ac.at> <c3561bad-f27f-4f38-ac7f-302abf03aa13@googlegroups.com>

Show all headers | View raw


mhx@iae.nl writes:
>> *) That's why I consider auto-vectorization the wrong way to go: you
>> have to express vectorization to the compiler anyway, so express it
>> directly, instead of by writing scalar code in an "auto-vectorizable"
>> style and hoping that the compiler actually manages to auto-vectorize
>> it.
>
>Indeed. But people with a >2000 file dusty deck probably
>see some benefit in the auto route. I don't blame them.

Many people with an incurable disease see some benefit in snake oil,
and they find people willing to sell it to them.  The problem arises
when the snake oil industry or its modern equivalent is marketing
their stuff so successfully that patients prefer it to evidence-based
medicine for curable diseases.

For problems where vectorization helps, there is a cure: identify the
hot code (typically relatively little), and let programmers rework it
into vectorized code.  This will often involve some other
reorganizations, such as replacing linked lists with something else,
and these reorganizations cannot be done by compilers.

Letting programmers vectorize means having vector features in the
programming language, and GNU C actually has such vector features, but
they are sorely neglected (the produced code is horribly inefficient).
They rather preferred to invest their effort in auto-vectorization.

Why?  My explanation is that the "relevant benchmarks" don't use the
vector features, so investing effort in them does not make gcc
"better" (in the metrics they use for evaluating their performance),
while you can tune the auto-vectorizer to actually perform some
auto-vectorization of the benchmarks.

And of course auto-vectorization looks attractive to managers with
lots of existing code.  It promises speedups for free, while the real
cure requires an investment in programmers who know how to vectorize.

>> You can find my thoughts on vector computing in Forth in a video in
>> German in
>>
>> <https://wiki.forth-ev.de/doku.php/events:tagung-2016:simd>
>
>It was really nice to see the faces (I checked some other videos
>too), but i.c. the vector computing a paper would be better for
>me.

Maybe I will write a paper for EuroForth 2017.

>IIUC, you propose a vector wordset to work on 8 (?) float-ops at
>a time?

No, the basic idea is to have arbitrary-length vectors on a vector
stack.

>It looked a bit verbose, still... Given my experience with
>AXPY I'd rather not work on a too low level, all of the time. 
>The BLAS spec. should have distilled all useful operations by 
>now, and we could use these as a kind of super-instructions?

BLAS is for linear algebra, and for that it's probably better than a
general vector wordset, but if you do something vectorizable that's
not linear algebra (e.g., TeX paragraph formatting), you need
something else.

- anton
-- 
M. Anton Ertl  http://www.complang.tuwien.ac.at/anton/home.html
comp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html
     New standard: http://www.forth200x.org/forth200x.html
   EuroForth 2017: http://www.euroforth.org/ef17/

Back to comp.lang.forth | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

ANN: matmul package available anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2017-05-19 10:43 +0000
  Re: ANN: matmul package available krishna.myneni@ccreweb.org - 2017-05-19 05:20 -0700
    Re: ANN: matmul package available anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2017-05-19 14:16 +0000
      Re: ANN: matmul package available pahihu <pahihu@gmail.com> - 2017-05-19 08:28 -0700
        Re: ANN: matmul package available pahihu <pahihu@gmail.com> - 2017-05-20 05:25 -0700
        Re: ANN: matmul package available anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2017-05-20 13:23 +0000
          Re: ANN: matmul package available pahihu <pahihu@gmail.com> - 2017-05-20 08:43 -0700
            Re: ANN: matmul package available anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2017-05-20 16:02 +0000
              Re: ANN: matmul package available pahihu <pahihu@gmail.com> - 2017-05-20 11:36 -0700
                Re: ANN: matmul package available anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2017-05-21 07:52 +0000
                Re: ANN: matmul package available mhx@iae.nl - 2017-05-21 03:28 -0700
                Re: ANN: matmul package available pahihu <pahihu@gmail.com> - 2017-05-21 05:32 -0700
                Re: ANN: matmul package available mhx@iae.nl - 2017-05-21 05:52 -0700
                Re: ANN: matmul package available pahihu <pahihu@gmail.com> - 2017-05-21 07:54 -0700
                Re: ANN: matmul package available mhx@iae.nl - 2017-05-21 08:32 -0700
                Re: ANN: matmul package available pahihu <pahihu@gmail.com> - 2017-05-21 11:24 -0700
                Re: ANN: matmul package available anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2017-05-21 13:52 +0000
                Re: ANN: matmul package available mhx@iae.nl - 2017-05-21 08:47 -0700
                Re: ANN: matmul package available anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2017-05-22 09:50 +0000
                Re: ANN: matmul package available pahihu <pahihu@gmail.com> - 2017-05-22 07:14 -0700
                Re: ANN: matmul package available mhx@iae.nl - 2017-05-22 07:39 -0700
                Re: ANN: matmul package available anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2017-05-23 10:06 +0000
  Re: ANN: matmul package available albert@cherry.spenarnc.xs4all.nl (Albert van der Horst) - 2017-05-19 17:00 +0200
    Re: ANN: matmul package available anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2017-05-20 13:59 +0000

csiph-web