SWA inference

This commit is contained in:
Daniel Han-Chen 2024-02-07 01:48:31 +11:00
commit 8e9d9c38b1
2 changed files with 1 additions and 2 deletions

View file

@ -11,7 +11,6 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
__version__ = "2024.1"
import os
import warnings
import importlib

View file

@ -184,7 +184,7 @@ def LlamaAttention_fast_forward_inference(
# Grouped query attention
if n_groups != 1:
_, _, cached_len, _ = Kn.shape
_, _, cached_len, _ = Knn.shape
Knn = Knn[:, :, None, :, :].expand(bsz, n_kv_heads, n_groups, cached_len, head_dim)
Vnn = Vnn[:, :, None, :, :].expand(bsz, n_kv_heads, n_groups, cached_len, head_dim)
Knn = Knn.reshape(bsz, n_heads, cached_len, head_dim)