Skip to content

Commit

Permalink
[Performance] Improving speed by splitting kernels (pytorch#97)
Browse files Browse the repository at this point in the history
With this patch, kernels can be splitted into odd and even parts in order to make computation faster.

If the processor is powerful enough, these two parts can be executed in parallel by out-of-order execution.
However, there is some overhead that is required to split the original kernel into two.
The degree of speed-up depends on the micro architecture, and the split kernels may be slower on some micro architectures.
This feature is enabled by SPLIT_KERNEL macro, and currently, it is enabled only for AVX2 and AVX512F.
This change affects computation speed of many functions, but for example,
the ratio of execution time between the previous version and the new version of asind4_u35 is 2.08.
  • Loading branch information
shibatch committed Nov 1, 2017
1 parent da68d0d commit 3f80098
Show file tree
Hide file tree
Showing 5 changed files with 292 additions and 14 deletions.
1 change: 1 addition & 0 deletions src/arch/helperavx2.h
Expand Up @@ -24,6 +24,7 @@
#define ENABLE_FMA_SP

#define FULL_FP_ROUNDING
#define SPLIT_KERNEL

#if defined(_MSC_VER)
#include <intrin.h>
Expand Down
1 change: 1 addition & 0 deletions src/arch/helperavx2_128.h
Expand Up @@ -24,6 +24,7 @@
#define ENABLE_FMA_SP

#define FULL_FP_ROUNDING
#define SPLIT_KERNEL

#if defined(_MSC_VER)
#include <intrin.h>
Expand Down
1 change: 1 addition & 0 deletions src/arch/helperavx512f.h
Expand Up @@ -24,6 +24,7 @@
#define ENABLE_FMA_SP

#define FULL_FP_ROUNDING
#define SPLIT_KERNEL

#if defined(_MSC_VER)
#include <intrin.h>
Expand Down

0 comments on commit 3f80098

Please sign in to comment.