8000 Merge pull request #847 from benoitsteiner/master. · evdevdev/tensorflow@4e10c31 · GitHub
[go: up one dir, main page]

Skip to content

Commit 4e10c31

Browse files
author
Vijay Vasudevan
committed
Merge pull request tensorflow#847 from benoitsteiner/master.
2 parents 2c1ab21 + 19b3606 commit 4e10c31

File tree

8 files changed

+42
-31
lines changed

8 files changed

+42
-31
lines changed

WORKSPACE

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ new_http_archive(
2121

2222
new_http_archive(
2323
name = "eigen_archive",
24-
url = "https://bitbucket.org/eigen/eigen/get/fb2fa05.tar.gz",
25-
sha256 = "8aacd8065d52528af1a22d6b72925dbb6b9fb8f25e46769481dd06d3edf63bbd",
24+
url = "https://bitbucket.org/eigen/eigen/get/c8e5d09.tar.gz",
25+
sha256 = "be61d1ce686e950d9a3a61b2aa83562ba4582ce1813e475869146e0a05915857",
2626
build_file = "eigen.BUILD",
2727
)
2828

eigen.BUILD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package(default_visibility = ["//visibility:public"])
22

3-
archive_dir = "eigen-eigen-fb2fa0527077"
3+
archive_dir = "eigen-eigen-c8e5d094f3a9"
44

55
cc_library(
66
name = "eigen",

third_party/eigen3/Eigen/Cholesky

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
#include "external/eigen_archive/eigen-eigen-fb2fa0527077/Eigen/Cholesky"
1+
#include "external/eigen_archive/eigen-eigen-c8e5d094f3a9/Eigen/Cholesky"

third_party/eigen3/Eigen/Core

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
#include "external/eigen_archive/eigen-eigen-fb2fa0527077/Eigen/Core"
1+
#include "external/eigen_archive/eigen-eigen-c8e5d094f3a9/Eigen/Core"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
#include "external/eigen_archive/eigen-eigen-fb2fa0527077/Eigen/Eigenvalues"
1+
#include "external/eigen_archive/eigen-eigen-c8e5d094f3a9/Eigen/Eigenvalues"

third_party/eigen3/Eigen/LU

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
#include "external/eigen_archive/eigen-eigen-fb2fa0527077/Eigen/LU"
1+
#include "external/eigen_archive/eigen-eigen-c8e5d094f3a9/Eigen/LU"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
#include "external/eigen_archive/eigen-eigen-fb2fa0527077/unsupported/Eigen/CXX11/Tensor"
1+
#include "external/eigen_archive/eigen-eigen-c8e5d094f3a9/unsupported/Eigen/CXX11/Tensor"

third_party/eigen3/unsupported/Eigen/CXX11/src/FixedPoint/MatMatProductAVX2.h

Lines changed: 34 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -42,39 +42,50 @@ class gebp_traits<QInt8, QUInt8, _ConjLhs, _ConjRhs>
4242
// Specialized blocking for quantized implementations.
4343
// Used by TensorContractionThreadPool, inputs must have dimensions that are
4444
// multiples of 32.
45-
template<int KcFactor, typename Index>
46-
struct ComputeGemmByColBlockingSizes<QInt8, QUInt8, KcFactor, Index> {
47-
void operator()(Index& k, Index& m, Index& n, Index num_threads)
45+
template<typename Index,
46+
typename LeftTensor,
47+
typename left_nocontract_t, typename left_contract_t,
48+
bool left_inner_dim_contiguous, bool left_inner_dim_reordered, int LeftAlignment,
49+
typename RightTensor,
50+
typename right_nocontract_t, typename right_contract_t,
51+
bool right_inner_dim_contiguous, bool right_inner_dim_reordered, int RightAlignment, int ShardingType>
52+
class TensorContractionBlocking<TensorContractionInputMapper<QInt8, Index, Lhs, LeftTensor, left_nocontract_t, left_contract_t, 32, left_inner_dim_contiguous, left_inner_dim_reordered, LeftAlignment>, TensorContractionInputMapper<QUInt8, Index, Rhs, RightTensor, right_nocontract_t, right_contract_t, 32, right_inner_dim_contiguous, right_inner_dim_reordered, RightAlignment>, Index, ShardingType> {
53+
public:
54+
55+
typedef QInt8 LhsScalar;
56+
typedef QUInt8 RhsScalar;
57+
58+
TensorContractionBlocking(Index k, Index m, Index n, Index num_threads = 1) :
59+
kc_(k), mc_(m), nc_(n)
4860
{
4961
eigen_assert(m % 32 == 0);
50-
eigen_assert(n % 32 == 0);
5162
eigen_assert(k % 32 == 0);
5263
if (!k || !m || !n) {
5364
return;
5465
}
55-
n = (((n / num_threads) + 31) / 32) * 32;
56-
}
57-
};
5866

59-
// Specialized blocking for quantized implementations.
60-
// Used by TensorContractionThreadPool, inputs must have dimensions that are
61-
// multiples of 32.
62-
template<int KcFactor, typename Index>
63-
struct ComputeGemmByRowBlockingSizes<QInt8, QUInt8, KcFactor, Index> {
64-
void operator()(Index& k, Index& m, Index& n, Index num_threads)
65-
{
66-
eigen_assert(m % 32 == 0);
67-
eigen_assert(n % 32 == 0 || n == 1);
68-
eigen_assert(k % 32 == 0);
69-
if (!k || !m || !n) {
70-
return;
67+
if (ShardingType == ShardByCol) {
68+
eigen_assert(n % 32 == 0);
69+
nc_ = (((n / num_threads) + 31) / 32) * 32;
7170
}
72-
// Special case to avoid breaking the unimplemented matrix-vector case
73-
if (n == 1) {
74-
n = 32;
71+
else {
72+
eigen_assert(n % 32 == 0 || n == 1);
73+
// Special case to avoid breaking the unimplemented matrix-vector case
74+
if (n == 1) {
75+
nc_ = 32;
76+
}
77+
mc_ = (((m / num_threads) + 31) / 32) * 32;
7578
}
76-
m = (((m / num_threads) + 31) / 32) * 32;
7779
}
80+
81+
EIGEN_ALWAYS_INLINE Index kc() const { return kc_; }
82+
EIGEN_ALWAYS_INLINE Index mc() const { return mc_; }
83+
EIGEN_ALWAYS_INLINE Index nc() const { return nc_; }
84+
85+
private:
86+
Index kc_;
87+
Index mc_;
88+
Index nc_;
7889
};
7990

8091
// Specialized blocking for quantized implementations.

0 commit comments

Comments
 (0)
0