File size: 1,058 Bytes
25e8424
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
gte-encoder-neuron-kernels -- NKI kernels for NewBERT (gte) encoders on AWS Trainium2
Licensed under the Apache License, Version 2.0 (see LICENSE).

All kernels in build/torch-neuron/ are new code. They use the following ideas and components:

* Lane-permuted Q/K projection layout, so rotate-half RoPE is elementwise with no transposes:
  idea from the V-JEPA2 encoder kernels published at huggingface.co/kernels/jburtoft/vjepa2-neuron-kernels
  (Apache-2.0, developed by Antonio Mena), as generalised in
  huggingface.co/kernels/jburtoft/vit-encoder-neuron-kernels (Apache-2.0).

* Long-sequence attention (L >= 768) calls attention_cte from the AWS Neuron NKI library
  (nkilib, https://github.com/aws-neuron/nki-library), Copyright Amazon.com, Inc. or its affiliates,
  Apache-2.0. nkilib is not redistributed here; it is imported at run time from the Neuron environment.

* Target architecture: the NewBERT ("new-impl") modeling code by Alibaba-NLP used by the gte model
  family on the Hugging Face Hub (Apache-2.0). No modeling code is redistributed.