From ffd997e36015e1022a122095ebb8e147c5b59650 Mon Sep 17 00:00:00 2001 From: Nikolay Bogoychev Date: Tue, 23 Mar 2021 21:32:01 +0000 Subject: [PATCH] Properly copy the entire vector in the int16_t case (#845) Fixes #842 #843 #844 --- CHANGELOG.md | 1 + VERSION | 2 +- src/tensors/cpu/integer_common.h | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 496de92c0..d300bb699 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. diff --git a/VERSION b/VERSION index c820106f6..f9ec16e15 100644 --- a/VERSION +++ b/VERSION @@ -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 6e96f8cdc..cb372a745 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(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(input), reinterpret_cast(input) + rows(item.shape)*cols(item.shape), aligned_input); Integer * aligned_output = reinterpret_cast(genericMalloc(512, rows(item.shape)*cols(item.shape)*sizeof(Integer))); intgemm_::width::PrepareBQuantizedTransposed(reinterpret_cast(aligned_input), reinterpret_cast(aligned_output),