diff options
author | Nikolay Bogoychev <nheart@gmail.com> | 2021-03-24 00:32:01 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-24 00:32:01 +0300 |
commit | ffd997e36015e1022a122095ebb8e147c5b59650 (patch) | |
tree | 2119738a8f2edfbb1328be39205d00475fb9a286 | |
parent | b36d0bbbab1fa4d435e517c974c3fde96e3145fe (diff) |
Properly copy the entire vector in the int16_t case (#845)
Fixes #842 #843 #844
-rw-r--r-- | CHANGELOG.md | 1 | ||||
-rw-r--r-- | VERSION | 2 | ||||
-rw-r--r-- | src/tensors/cpu/integer_common.h | 2 |
3 files changed, 3 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 496de92c..d300bb69 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Fix compilation with OMP ### Fixed +- Fixed an issue when loading intgemm16 models from unaligned memory. - Fix building marian with gcc 9.3+ and FBGEMM - Find MKL installed under Ubuntu 20.04 via apt-get - Support for CUDA 11. @@ -1 +1 @@ -v1.10.12 +v1.10.13 diff --git a/src/tensors/cpu/integer_common.h b/src/tensors/cpu/integer_common.h index 6e96f8cd..cb372a74 100644 --- a/src/tensors/cpu/integer_common.h +++ b/src/tensors/cpu/integer_common.h @@ -198,7 +198,7 @@ void prepareAndTransposeB(io::Item& item, const char * input) { cols(item.shape)); //rows here returns the columns of the transposed input matrix, and cols -> the rows } else { Integer * aligned_input = reinterpret_cast<Integer *>(genericMalloc(512, rows(item.shape)*cols(item.shape)*sizeof(Integer))); - std::copy(input, input + rows(item.shape)*cols(item.shape), aligned_input); + std::copy(reinterpret_cast<const Integer *>(input), reinterpret_cast<const Integer *>(input) + rows(item.shape)*cols(item.shape), aligned_input); Integer * aligned_output = reinterpret_cast<Integer *>(genericMalloc(512, rows(item.shape)*cols(item.shape)*sizeof(Integer))); intgemm_<vtype>::width::PrepareBQuantizedTransposed(reinterpret_cast<const Integer *>(aligned_input), reinterpret_cast<Integer *>(aligned_output), |