How to set FFLAS::MMHelper?

10 views
Skip to first unread message

Shunsuke Tsuchioka

unread,
Aug 8, 2017, 1:44:42 AM8/8/17
to ffpack-devel
Hi,

I want to get a matrix-vector product y=Ax
where A is cnt*cnt matrix (now cnt is around 80000)
and x,y are cnt-dimensional vectors in positive characteristic around 2^15
via fflas-ffpack-2.2.2.

I checked the following code gives the correct product in 11 seconds on
Intel(R) Xeon(R) CPU E5-2690 0 @ 2.90GHz.

FFLAS::MMHelper<Field,FFLAS::MMHelperAlgo::Auto,typename FFLAS::ModeTraits<Field>::value> WH(F,-1,FFLAS::ParSeqHelper::Sequential());
FFLAS::fgemm(F, FFLAS::FflasNoTrans, FFLAS::FflasNoTrans,cnt,1,cnt,one, A,cnt, x,1, zero,y,1,WH);

But I don't know how to set WH nicely.
I would appreciate it if you would give me some advice.

Sincerely,
Shunsuke

Clement Pernet

unread,
Aug 20, 2017, 4:08:19 PM8/20/17
to ffpack...@googlegroups.com, Shunsuke Tsuchioka
Dear Shunsuke,

First, the routine for matrix vector product is fgemv (you'll find it's signature in
fflas/fflas_level2.h). Of course calling fgemm as you do is also valid as a matrix vector product is
a certain matrix-matrix product.

Now regarding the helper system:
- you, as an end user do not need to deal with this machinery. The same call to fgemm, without the
last WH argument will automatically choose the right helper and perform similarly. If you experience
that it is not the case, then it's a bug and we would be pleased to investigate it with your code.
- you can however, as an expert user, give a specific helper to the routine in order to force some
parameters like:
- run a parallel code and specify the number of threads
- force a given number of recursive levels for the Strassen-Winograd algorithm
- ...

Let us know if you have specific needs, and we could see how to specify this helper. Other just
don't bother using them.

Best
Clément

Le 08/08/2017 à 07:44, Shunsuke Tsuchioka a écrit :
> Hi,
>
> I want to get a matrix-vector product y=Ax
> where A is cnt*cnt matrix (now cnt is around 80000)
> and x,y are cnt-dimensional vectors in positive characteristic around 2^15
> via fflas-ffpack-2.2.2.
> <https://github.com/linbox-team/fflas-ffpack/releases/tag/v2.2.2>
> I checked the following code gives the correct product in 11 seconds on
> Intel(R) Xeon(R) CPU E5-2690 0 @ 2.90GHz.
>
> FFLAS::MMHelper<Field,FFLAS::MMHelperAlgo::Auto,typename FFLAS::ModeTraits<Field>::value>
> WH(F,-1,FFLAS::ParSeqHelper::Sequential());
> FFLAS::fgemm(F, FFLAS::FflasNoTrans, FFLAS::FflasNoTrans,cnt,1,cnt,one, A,cnt, x,1, zero,y,1,WH);
>
> But I don't know how to set WH nicely.
> I would appreciate it if you would give me some advice.
>
> Sincerely,
> Shunsuke
>
> --
> You received this message because you are subscribed to the Google Groups "ffpack-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
> ffpack-devel...@googlegroups.com <mailto:ffpack-devel...@googlegroups.com>.
> To post to this group, send email to ffpack...@googlegroups.com
> <mailto:ffpack...@googlegroups.com>.
> Visit this group at https://groups.google.com/group/ffpack-devel.
> For more options, visit https://groups.google.com/d/optout.

Shunsuke Tsuchioka

unread,
Aug 22, 2017, 12:31:02 PM8/22/17
to ffpack-devel, ts...@kurims.kyoto-u.ac.jp
Dear Clément,

Thank you very much.
I asked just by my curiosity and I will call without the last argument (or call fgemv).

Best,
Shunsuke

2017年8月21日月曜日 5時08分19秒 UTC+9 Clement Pernet:
Reply all
Reply to author
Forward
0 new messages