This bugzilla service is closed. All entries have been migrated to https://gitlab.com/libeigen/eigen
Bug 1627 - Slow Tensor shuffle vs Matrix transpose
Summary: Slow Tensor shuffle vs Matrix transpose
Status: NEW
Alias: None
Product: Eigen
Classification: Unclassified
Component: Tensor (show other bugs)
Version: 3.4 (development)
Hardware: x86 - 64-bit Linux
: Normal Performance Problem
Assignee: Nobody
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-11-21 21:33 UTC by william.tambellini
Modified: 2019-12-04 18:08 UTC (History)
4 users (show)



Attachments
bench_matrix_vs_tensor.cpp (5.32 KB, text/x-c++src)
2018-11-21 21:33 UTC, william.tambellini
no flags Details

Description william.tambellini 2018-11-21 21:33:57 UTC
Created attachment 897 [details]
bench_matrix_vs_tensor.cpp

2D Tensor shuffle seems to be pretty slow vs Matrix transpose at least for 'small' sizes : 
 
Bench Eigen Matrix vs Tensor
Repeat: 100
GCC: 6.1.0
Eigen version: 3.3.90
Simd: SSE, SSE2
Eigen::nbThreads: 4
EIGEN_NO_DEBUG
EIGEN_VECTORIZE
EIGEN_HAS_OPENMP: 201511
omp_get_num_threads: 1

Transpose:
           NRows           NCols         EMatrix         ETensor
              64              64     0.000266868      0.00114404
             128             128       0.0016177       0.0029307
             256             256      0.00869799       0.0217909
             512             512       0.0464435       0.0839111
            1024            1024        0.421983        0.475269
            2048            2048         4.14158          1.9522
Comment 1 Christoph Hertzberg 2018-11-22 10:56:46 UTC
I guess it should be possible for "simple" shuffles to reduce them to the same code as Transpose, more general shuffles will be more complicated.

The Matrix-Transpose is not as efficient as it can be, though -- this could probably benefit from vectorization and better cache-ing.
Comment 2 Nobody 2019-12-04 18:08:45 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to gitlab.com'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: https://gitlab.com/libeigen/eigen/issues/1627.

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