This bugzilla service is closed. All entries have been migrated to
Bug 1648 - Slow Tensor gemv vs Matrix
Summary: Slow Tensor gemv vs Matrix
Status: NEW
Alias: None
Product: Eigen
Classification: Unclassified
Component: Tensor (show other bugs)
Version: 3.5 (future version)
Hardware: x86 - 64-bit Linux
: Normal Optimization
Assignee: Nobody
Depends on:
Reported: 2018-12-18 02:25 UTC by william.tambellini
Modified: 2019-12-04 18:17 UTC (History)
4 users (show)

bench_matrix_vs_tensor.cpp (dec 17) (8.52 KB, text/x-c++src)
2018-12-18 02:25 UTC, william.tambellini
no flags Details

Description william.tambellini 2018-12-18 02:25:36 UTC
Created attachment 909 [details]
bench_matrix_vs_tensor.cpp (dec 17)

Unless I did something unfair for Tensors, Tensor gemv is significantly slower than Vector-Matrix gemv:

$ ./ 
Bench Eigen Matrix vs Tensor
Usage: program numberOfEigenThreads (default to 1)
GCC: 6.1.0
Eigen version: 3.3.90
Simd: SSE, SSE2
Eigen::nbThreads: 1
omp_get_num_threads: 1

Repeat: 200
               N         EMatrix         ETensor
             256      0.00156261      0.00443656
             512      0.00572028       0.0179982
            1024        0.035893       0.0818175
            2048        0.329064        0.455825
            4096        0.906102         1.96649

That seems to be confirmed by TensorFlow which is today casting tensors to Matrix/VectorMap in order to do faster gemv :
Comment 1 Nobody 2019-12-04 18:17:57 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance:

Note You need to log in before you can comment on or make changes to this bug.