Skip to content

Instantly share code, notes, and snippets.

@gregtatum
Last active July 18, 2024 15:22
Show Gist options
  • Save gregtatum/573021bf5e7cc8aa53dea832eec2d1df to your computer and use it in GitHub Desktop.
Save gregtatum/573021bf5e7cc8aa53dea832eec2d1df to your computer and use it in GitHub Desktop.
import argparse
import gzip
import numpy as np
import yaml
import struct
"""
This script takes in a Marian model, either of the npz format or the bin format, and
outputs information about the weights encoded in the file.
Usage:
python analyze-model.py en-ca/model.enca.intgemm.alphas.bin
python analyze-model.py en-it/teacher-1/model.npz
"""
def analyze_npz_file(model_path: str):
if model_path.endswith('.gz'):
with gzip.open(model_path, 'rb') as f:
model = np.load(f)
else:
model = np.load(model_path)
print("Contents of the NPZ file:")
for array_name in model.files:
print(array_name)
for array_name in model.files:
array = model[array_name]
print(f"\nArray name: {array_name}")
print(f"Shape: {array.shape}")
print(f"Data type: {array.dtype}")
# print(f"Contents: \n{array}")
# The yaml is encoded
yaml_bytes = model.get('special:model.yml')
if yaml_bytes:
print_yaml(yaml_bytes)
else:
print("No model.yml was found.")
class Header:
def __init__(self, name_length, data_type, shape_length, data_length):
self.name_length: int = name_length
self.data_type: int = data_type
self.shape_length: int = shape_length
self.data_length: int = data_length
class TypeClass:
signed_type = 0x0100
unsigned_type = 0x0200
float_type = 0x0400
packed_type = 0x0800
avx2_type = 0x1000
avx512_type = 0x2000
intgemm_type = 0x4000
ssse3_type = 0x0010 # Not in browsermt/marian-dev
sse2_type = 0x0020 # Not in browsermt/marian-dev
# https://github.com/marian-nmt/marian-dev/blob/2d067afb9ce5e3a0b6c32585706affc6e7295920/src/common/types.h#L298
type_mapping = {
TypeClass.signed_type + 1: "int8",
TypeClass.signed_type + 2: "int16",
TypeClass.signed_type + 4: "int32",
TypeClass.signed_type + 8: "int64",
TypeClass.unsigned_type + 1: "uint8",
TypeClass.unsigned_type + 2: "uint16",
TypeClass.unsigned_type + 4: "uint32",
TypeClass.unsigned_type + 8: "uint64",
TypeClass.float_type + 2: "float16",
TypeClass.float_type + 4: "float32",
TypeClass.float_type + 8: "float64",
TypeClass.packed_type + 2: "packed16",
TypeClass.packed_type + 1 + TypeClass.avx2_type: "packed8avx2",
TypeClass.packed_type + 1 + TypeClass.avx512_type: "packed8avx512",
TypeClass.intgemm_type + 1: "intgemm8",
TypeClass.intgemm_type + 2: "intgemm16",
# The following is not in browsermt/marian-dev
TypeClass.intgemm_type + 1 + TypeClass.ssse3_type: "intgemm8ssse3",
TypeClass.intgemm_type + 1 + TypeClass.avx2_type: "intgemm8avx2",
TypeClass.intgemm_type + 1 + TypeClass.avx512_type: "intgemm8avx512",
TypeClass.intgemm_type + 1 + TypeClass.avx512_type + 4096: "intgemm8avx512vnni",
TypeClass.intgemm_type + 2 + TypeClass.sse2_type: "intgemm16sse2",
TypeClass.intgemm_type + 2 + TypeClass.avx2_type: "intgemm16avx2",
TypeClass.intgemm_type + 2 + TypeClass.avx512_type: "intgemm16avx512"
}
def analyze_bin_file(model_path: str):
if model_path.endswith('.gz'):
with gzip.open(model_path, 'rb') as file:
print("gzip open")
analyze_bin_file_impl(file)
else:
with open(model_path, 'rb') as file:
analyze_bin_file_impl(file)
def print_yaml(data):
bytes = bytearray(data)
yaml_str = bytes.replace(b'\x00', b'').decode('utf-8')
yaml_content = yaml.safe_load(yaml_str)
# Display the YAML content
print("\nYAML:\n")
print(yaml.dump(yaml_content, default_flow_style=False))
def analyze_bin_file_impl(file):
# Read the binary file version
# The format character for Q is: "unsigned long long"
# https://docs.python.org/3/library/struct.html#format-characters
binary_file_version = struct.unpack('Q', file.read(struct.calcsize('Q')))[0]
print(f'Binary File Version: {binary_file_version}')
# Read the number of headers
header_size = struct.unpack('Q', file.read(struct.calcsize('Q')))[0]
headers: list[Header] = []
for _ in range(header_size):
header_data = file.read(struct.calcsize('QQQQ'))
header = Header(*struct.unpack('QQQQ', header_data))
headers.append(header)
# Read all names
names: list[str] = []
for header in headers:
name = file.read(header.name_length).decode('utf-8').strip('\x00')
names.append(name)
# Read all shapes
shapes = []
for header in headers:
shape = struct.unpack(f'{header.shape_length}i', file.read(header.shape_length * struct.calcsize('i')))
shapes.append(shape)
# TODO - This could be incorrect, as it was ChatGPT generated. The next value
# could be read to determine the offset amount. The data is padded to a 256 offset.
current_pos = file.tell()
next_pos = ((current_pos + struct.calcsize('Q')) // 256 + 1) * 256
offset = next_pos - current_pos - struct.calcsize('Q')
file.seek(offset + struct.calcsize('Q'), 1)
data = []
for header in headers:
data.append(file.read(header.data_length))
print("Data:\n")
for header, name, shape, vector in zip(headers, names, shapes, data):
data_sample = " ".join([f"{n:02x}" for n in vector[:20]])
type_name = type_mapping.get(header.data_type, "unknown")
print(
name.ljust(35), type_name.ljust(20), f"{shape}".ljust(15), data_sample,)
if name.startswith("special:") and name.endswith(".yml"):
print_yaml(vector)
def main() -> None:
parser = argparse.ArgumentParser(
description=__doc__,
# Preserves whitespace in the help text.
formatter_class=argparse.RawTextHelpFormatter,
)
parser.add_argument("model")
args = parser.parse_args()
model_path: str = args.model
if model_path.endswith(".bin") or model_path.endswith(".bin.gz"):
print("Analyzing the file as a Marian bin file")
analyze_bin_file(model_path)
else:
print("Analyzing the file as a numpy npz file")
analyze_npz_file(model_path)
if __name__ == "__main__":
main()
➤ python analyze-model.py en-it/bicleaner-fix/exported/model.enit.intgemm.alphas.bin.gz
Analyzing the file as a Marian bin file
gzip open
Binary File Version: 1
Data:
Wemb intgemm8 (32000, 256) 07 03 fb fe 05 07 06 f9 04 04 04 fb 03 fd 01 0d 06 f2 ff fe
Wemb_QuantMultA intgemm8 (1, 1) 7f 15 dd 78 41 07 06 f9 04 04 04 fb 03 fd 01 0d 06 f2 ff fe
decoder_ff_logit_out_b float32 (1, 32000) 5b 55 b2 c0 57 d9 a6 c1 ce 24 c4 40 8d 46 d1 c0 17 bc 07 40
decoder_l1_context_Wk intgemm8 (256, 256) d0 fb 1f d2 06 19 0b ee f7 ef 0e d8 d1 fa 00 ce fa 26 f2 e7
decoder_l1_context_Wk_QuantMultA float32 (1, 1) af 1a 46 41 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
decoder_l1_context_Wo intgemm8 (256, 256) fb b4 ee df 1a 0e 1c 03 09 1b 12 13 26 eb 1c 11 10 e4 e0 dd
decoder_l1_context_Wo_QuantMultA float32 (1, 1) df 96 a1 41 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
decoder_l1_context_Wo_ln_bias float32 (1, 256) eb fc 14 3e 7b 7f d4 3e a0 4f e5 3d 4a 83 8a 3e 90 a2 e1 3d
decoder_l1_context_Wo_ln_scale float32 (1, 256) 4b 1f 96 3f 99 30 54 3f bf df 91 3f 01 8c 98 3f 74 55 93 3f
decoder_l1_context_Wq intgemm8 (256, 256) ff 13 04 0b fd fc 1d 05 f6 fa 18 1b 0e 01 18 3a fd 13 01 f5
decoder_l1_context_Wq_QuantMultA float32 (1, 1) a4 69 76 41 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
decoder_l1_context_Wv intgemm8 (256, 256) 18 d7 18 dd 00 f3 0d f8 03 16 01 fd fd fd de f9 01 e7 14 df
decoder_l1_context_Wv_QuantMultA float32 (1, 1) af 1a 46 41 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
decoder_l1_context_bk float32 (1, 256) 14 d7 4e 40 a0 92 74 40 d5 c0 6c c0 a9 8f 4d 40 73 4c 80 40
decoder_l1_context_bo float32 (1, 256) 4a c1 05 bf 89 f1 5c c0 1a 3f 91 be 5b b9 87 c0 23 06 1b 3e
decoder_l1_context_bq float32 (1, 256) a1 80 86 be 0d e2 42 c0 9b 01 28 40 78 08 eb 3e fe cd 9e bf
decoder_l1_context_bv float32 (1, 256) 1f ab 4b bf ed ac 35 3f 34 a5 5e 3f 88 69 a0 bf 75 35 7b bf
decoder_l1_ffn_W1 intgemm8 (256, 1536) 07 05 fb 02 06 fd 04 03 0a 03 01 07 f6 03 f8 02 02 f9 01 04
decoder_l1_ffn_W1_QuantMultA float32 (1, 1) b3 04 5b 41 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
decoder_l1_ffn_W2 intgemm8 (1536, 256) 02 00 07 f1 01 06 02 f8 f7 03 fc 06 05 fd 09 07 fc 07 fe 0c
decoder_l1_ffn_W2_QuantMultA float32 (1, 1) 62 d8 26 41 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
decoder_l1_ffn_b1 float32 (1, 1536) 16 bc 09 c0 bf e0 87 c0 67 9a 00 c0 df a0 8e c0 e4 5f 53 be
decoder_l1_ffn_b2 float32 (1, 256) b4 21 cd bf 8b 9e 94 3f 0a b1 d4 3f bc 2f a2 c0 88 5a 0e c0
decoder_l1_ffn_ffn_ln_bias float32 (1, 256) 1c 51 2f 3e 4d be b2 bd 19 03 a5 bd 24 bd e3 3d 8c ef 03 3e
decoder_l1_ffn_ffn_ln_scale float32 (1, 256) 7b 8d 08 40 b8 21 a8 3f ab f3 be 3f 7f ca b3 3f c9 11 d6 3f
decoder_l1_rnn_W intgemm8 (256, 256) db 0b 02 f7 01 16 09 08 f6 03 f1 0c 00 f5 ee fb f2 13 f4 e7
decoder_l1_rnn_W_QuantMultA float32 (1, 1) df 1f 4b 41 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
decoder_l1_rnn_Wf intgemm8 (256, 256) f6 f2 06 01 0b 0a 06 ff 15 0d 1f 14 27 e7 f1 0d 07 f9 06 f2
decoder_l1_rnn_Wf_QuantMultA float32 (1, 1) df 1f 4b 41 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
decoder_l1_rnn_bf float32 (1, 256) c5 d0 31 c0 24 19 64 40 04 af 0d 40 15 92 56 40 9e 74 ad bf
decoder_l1_rnn_ffn_ln_bias float32 (1, 256) 9c e3 25 3e 7c f0 e2 3d a4 26 34 3d b6 97 1d 3e f0 10 30 bb
decoder_l1_rnn_ffn_ln_scale float32 (1, 256) 85 e6 3e 3f ed 0c 1d 3f d0 85 47 3f 91 da 89 3f 16 c3 4f 3f
decoder_l2_context_Wk intgemm8 (256, 256) 0a 17 07 03 f2 f8 1b f3 ff 10 f7 06 08 ea db ff f4 f4 07 27
decoder_l2_context_Wk_QuantMultA float32 (1, 1) af 1a 46 41 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
decoder_l2_context_Wo intgemm8 (256, 256) f2 04 ce 06 f8 f1 0c 17 06 ff e6 0a 15 12 0c 1e 35 1f f5 1b
decoder_l2_context_Wo_QuantMultA float32 (1, 1) 1f f2 c2 41 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
decoder_l2_context_Wo_ln_bias float32 (1, 256) 84 8d b8 bd a5 14 82 be 2f 25 9d be 45 24 e6 3c 30 d9 b9 3d
decoder_l2_context_Wo_ln_scale float32 (1, 256) a7 ca b6 3f c2 13 c2 3f 56 cc 8e 3f 28 8b cc 3f dd b9 b5 3f
decoder_l2_context_Wq intgemm8 (256, 256) 02 03 ed ff 09 fb fe e5 13 0e 10 04 f0 fe ff 1a 05 1b 06 e4
decoder_l2_context_Wq_QuantMultA float32 (1, 1) 25 13 1e 41 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
decoder_l2_context_Wv intgemm8 (256, 256) 18 ef 0e ee f8 f8 07 ff 24 e5 d5 04 08 fa 06 f6 fc 0d f3 e8
decoder_l2_context_Wv_QuantMultA float32 (1, 1) af 1a 46 41 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
decoder_l2_context_bk float32 (1, 256) f3 85 46 41 df 4b 38 40 4c 0a 51 c1 db e1 47 be 26 20 66 41
decoder_l2_context_bo float32 (1, 256) 7d a0 6d bf f9 cb ec 3f 52 9d 5f 3f 1a b8 02 c0 d2 29 b7 bf
decoder_l2_context_bq float32 (1, 256) f5 1b 95 40 4f 55 49 3d 37 49 1b c0 db b2 c3 3f c2 80 59 c0
decoder_l2_context_bv float32 (1, 256) 53 ed c8 bd b3 af 89 be 58 82 83 be d4 16 6d 3d 7a 77 1d 3e
decoder_l2_ffn_W1 intgemm8 (256, 1536) f8 f8 02 f7 f2 fb 07 fb 01 07 03 01 f4 fe f8 fb fb f2 09 fe
decoder_l2_ffn_W1_QuantMultA float32 (1, 1) 81 1f 69 41 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
decoder_l2_ffn_W2 intgemm8 (1536, 256) fc fd 01 06 fd 00 f7 fe fc f7 fb ff 01 fe f6 04 07 03 02 ff
decoder_l2_ffn_W2_QuantMultA float32 (1, 1) 13 8b 45 41 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
decoder_l2_ffn_b1 float32 (1, 1536) ae 9c 88 c0 14 d2 b8 bf b7 b5 da bf 4c 52 18 c0 e7 70 b5 bf
decoder_l2_ffn_b2 float32 (1, 256) 17 4d 79 40 ec c3 2a bf 9d 7a 9c be 0e c7 f2 bf 52 2b da bf
decoder_l2_ffn_ffn_ln_bias float32 (1, 256) e6 0d e3 3d ed be f3 be c9 32 83 be 69 43 b1 be 74 4d b6 3e
decoder_l2_ffn_ffn_ln_scale float32 (1, 256) ff 9c 3c 40 37 90 38 40 e5 e6 3b 40 c7 35 5e 40 47 ae 53 40
decoder_l2_rnn_W intgemm8 (256, 256) ef ff 05 f3 fb 0d fa 05 00 f9 f9 10 01 0c 00 fe 08 ff fd fe
decoder_l2_rnn_W_QuantMultA float32 (1, 1) a3 a3 26 41 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
decoder_l2_rnn_Wf intgemm8 (256, 256) 1b fe 03 ee 26 10 08 f9 03 fa 0a 17 f9 05 ff 04 0c 19 08 28
decoder_l2_rnn_Wf_QuantMultA float32 (1, 1) a3 a3 26 41 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
decoder_l2_rnn_bf float32 (1, 256) 11 79 ba 3c a7 be 93 3d 21 a3 b9 40 32 25 da bf 50 43 0c c0
decoder_l2_rnn_ffn_ln_bias float32 (1, 256) 68 7a 75 ba e9 ef 39 be 59 87 3f 3d a6 26 47 3e 6b 2e ee bd
decoder_l2_rnn_ffn_ln_scale float32 (1, 256) 42 36 78 3f 9b 34 d8 3f 0f 58 59 3f 01 6f b0 3f 37 27 ac 3f
encoder_l1_ffn_W1 intgemm8 (256, 1536) 05 e6 1b f7 fb f2 0a ef 19 fd ff 0c f9 25 16 f9 f1 0a 0c 02
encoder_l1_ffn_W1_QuantMultA float32 (1, 1) ea 5a ba 41 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
encoder_l1_ffn_W2 intgemm8 (1536, 256) f5 16 2b ff fc ff eb 04 0d 0c e5 fb 0e fd 05 0e f2 f4 10 ff
encoder_l1_ffn_W2_QuantMultA float32 (1, 1) 37 77 21 41 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
encoder_l1_ffn_b1 float32 (1, 1536) 07 f3 ac bf f2 d9 22 c0 34 ee ac bf d9 38 e1 3e 56 af 57 bf
encoder_l1_ffn_b2 float32 (1, 256) e4 31 c1 be fa 5b a2 bf 03 5d 4a bf 41 40 31 3f 86 20 17 3e
encoder_l1_ffn_ffn_ln_bias float32 (1, 256) 4a ea e8 3c f8 5f 8e 3d a6 97 b7 3d 12 7a 22 bd 43 9d a6 bb
encoder_l1_ffn_ffn_ln_scale float32 (1, 256) 69 b5 72 3f bd c0 7a 3f 5a d7 79 3f 33 cb 82 3f d7 96 7b 3f
encoder_l1_self_Wk intgemm8 (256, 256) 07 0f f5 03 06 01 18 04 0e 21 0c ff f6 ef ff fc f7 05 fe 11
encoder_l1_self_Wk_QuantMultA float32 (1, 1) 48 7c 23 41 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
encoder_l1_self_Wo intgemm8 (256, 256) 25 ed ec ca ce 4a ae 0a 1f 1f b8 e7 00 e2 d4 27 56 1f 21 44
encoder_l1_self_Wo_QuantMultA float32 (1, 1) 7c 0a 74 41 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
encoder_l1_self_Wo_ln_bias float32 (1, 256) 78 ae 13 3b 13 ff ed 3d 04 af a7 bc 30 1a ba bd 87 87 f2 3b
encoder_l1_self_Wo_ln_scale float32 (1, 256) b5 c6 cd 3e 96 3f f9 3e 35 fb 00 3f d2 9d 0c 3f b8 6c 1b 3f
encoder_l1_self_Wq intgemm8 (256, 256) 00 09 00 02 07 13 03 02 08 09 1d 08 06 01 fe ec 05 1c f4 08
encoder_l1_self_Wq_QuantMultA float32 (1, 1) 48 7c 23 41 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
encoder_l1_self_Wv intgemm8 (256, 256) 02 fb 00 0d 13 04 0d d2 0d dd 0d e3 20 14 d8 08 d1 26 fc 31
encoder_l1_self_Wv_QuantMultA float32 (1, 1) 48 7c 23 41 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
encoder_l1_self_bk float32 (1, 256) 74 9e ae 3e 50 42 b6 bd fd 48 92 3e 54 4c 9d 3d 72 62 82 3c
encoder_l1_self_bo float32 (1, 256) 16 06 41 3f 76 4b 6b bf f4 b6 47 bd 04 40 2d 3f 40 5d de 3e
encoder_l1_self_bq float32 (1, 256) e3 cd d5 3d 5f 76 b6 bd 79 3c ec be 87 f8 0b 3f 6f 5a 38 3f
encoder_l1_self_bv float32 (1, 256) c9 85 2e 3f 44 13 05 c0 be b5 0e 3f 96 9f d8 be 60 41 a8 be
encoder_l2_ffn_W1 intgemm8 (256, 1536) f4 0f fe 0f 33 de 23 01 1b d8 01 07 ee 1b 0f f3 e5 01 13 fa
encoder_l2_ffn_W1_QuantMultA float32 (1, 1) 72 9e 4b 41 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
encoder_l2_ffn_W2 intgemm8 (1536, 256) f9 f3 fa 12 02 fe ff 17 0d d6 ef d9 16 fa e5 02 0d f5 05 f0
encoder_l2_ffn_W2_QuantMultA float32 (1, 1) 6f fa 6c 41 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
encoder_l2_ffn_b1 float32 (1, 1536) dc 9c 43 bf 09 eb 88 bf e0 cf a3 bf 38 62 eb be 0e 22 85 be
encoder_l2_ffn_b2 float32 (1, 256) b6 f5 92 3e d9 50 80 3e 21 da c8 bf 16 54 e0 bf 16 7f 95 bf
encoder_l2_ffn_ffn_ln_bias float32 (1, 256) 42 92 e0 bc cb 26 b3 3c f7 e7 07 3e 76 b5 82 3d 65 8c 6b 3d
encoder_l2_ffn_ffn_ln_scale float32 (1, 256) 5c 6e 64 3f 0f 09 77 3f 83 2d 82 3f 79 57 7b 3f 8e b0 7f 3f
encoder_l2_self_Wk intgemm8 (256, 256) e2 10 f7 fd fc 0a ee fe 0f 0c 0e f0 fb 15 06 01 f8 01 e2 18
encoder_l2_self_Wk_QuantMultA float32 (1, 1) 4a eb 5e 41 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
encoder_l2_self_Wo intgemm8 (256, 256) fe f0 04 22 13 cb b0 36 dd f8 04 fa fc 51 2e 0e f1 e7 fa ce
encoder_l2_self_Wo_QuantMultA float32 (1, 1) 40 8f 0d 42 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
encoder_l2_self_Wo_ln_bias float32 (1, 256) 7b ca a3 bb 8f fd b7 bd ae 3f c3 3c c8 96 9e 3c 1c 6e d3 3d
encoder_l2_self_Wo_ln_scale float32 (1, 256) 57 f5 74 3f 10 5f 80 3f c5 61 83 3f a1 a3 7d 3f 91 ab 83 3f
encoder_l2_self_Wq intgemm8 (256, 256) ce f4 02 f1 22 25 1f 02 f8 1d f7 f4 e2 fa 4a df 02 f1 ef 0c
encoder_l2_self_Wq_QuantMultA float32 (1, 1) 4a eb 5e 41 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
encoder_l2_self_Wv intgemm8 (256, 256) c3 1d 0f 2f d5 05 07 e7 e6 09 dd 16 29 dc b9 04 38 24 e3 d1
encoder_l2_self_Wv_QuantMultA float32 (1, 1) 4a eb 5e 41 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
encoder_l2_self_bk float32 (1, 256) 50 83 35 3e 83 51 83 bd 47 e5 22 be 76 a6 91 be f3 39 cc 3e
encoder_l2_self_bo float32 (1, 256) af 01 85 be 47 50 40 3f 3f 93 62 be 0c ce 51 bf 6b 28 62 be
encoder_l2_self_bq float32 (1, 256) ca 1e ca 3e 93 03 ae be 0d c6 02 3f d1 07 c5 3f 29 3c 9f bf
encoder_l2_self_bv float32 (1, 256) 00 a3 c4 3e 07 ae 3c 3e 99 0f 72 3e 09 8f 6e be 4b ca 6d 3c
encoder_l3_ffn_W1 intgemm8 (256, 1536) 20 19 04 d5 fe ff 1a fc d3 ea ee 0d e0 fb 00 07 13 ff f5 fa
encoder_l3_ffn_W1_QuantMultA float32 (1, 1) cf 95 63 41 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
encoder_l3_ffn_W2 intgemm8 (1536, 256) 06 f5 17 07 03 0a 03 00 13 f9 fd f3 ed ea f2 01 08 01 16 ff
encoder_l3_ffn_W2_QuantMultA float32 (1, 1) 26 2e 6d 41 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
encoder_l3_ffn_b1 float32 (1, 1536) 22 4e ea bf 5c 70 23 c0 8c 88 fe 3e cb 87 37 c0 0d 27 23 c0
encoder_l3_ffn_b2 float32 (1, 256) 8d 1c 09 40 91 2f 59 be 68 c1 7f 3f eb ad fb be ba d8 af bf
encoder_l3_ffn_ffn_ln_bias float32 (1, 256) d2 c1 55 bd ee fb 91 3c ef 8d bd 3d 1c 23 ad 3c f0 e4 b6 3d
encoder_l3_ffn_ffn_ln_scale float32 (1, 256) f2 56 9b 3f 9b c7 a0 3f 50 a8 96 3f 25 fc 9c 3f 24 42 a0 3f
encoder_l3_self_Wk intgemm8 (256, 256) f9 eb 05 04 f7 00 e1 ee ea 1d fc 16 22 1a df 34 0d 1c 53 20
encoder_l3_self_Wk_QuantMultA float32 (1, 1) 51 24 67 41 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
encoder_l3_self_Wo intgemm8 (256, 256) 28 d9 f9 05 08 e8 24 44 de 3a e1 22 fd 2e e3 fc 0e fe 29 aa
encoder_l3_self_Wo_QuantMultA float32 (1, 1) b3 0c 0b 42 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
encoder_l3_self_Wo_ln_bias float32 (1, 256) 7b 66 3f bc bd c4 e6 bd dc fa 93 3e 02 2f 2f 3e f2 88 98 3e
encoder_l3_self_Wo_ln_scale float32 (1, 256) 6e 48 83 3f 89 33 84 3f a8 56 83 3f 3e 21 77 3f 6c 2a 86 3f
encoder_l3_self_Wq intgemm8 (256, 256) eb 19 fb 15 de f2 15 0b 15 fd 16 e3 0d 03 0c 2f e3 0e 10 11
encoder_l3_self_Wq_QuantMultA float32 (1, 1) 51 24 67 41 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
encoder_l3_self_Wv intgemm8 (256, 256) 16 e9 0c 14 14 1e d3 fc 04 10 f9 ef 14 e3 23 21 2e 0d 0c 09
encoder_l3_self_Wv_QuantMultA float32 (1, 1) 51 24 67 41 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
encoder_l3_self_bk float32 (1, 256) 76 cd a9 3d 64 e0 7b be e7 e6 79 3d ab 5e d7 3d 2d f3 5a 3e
encoder_l3_self_bo float32 (1, 256) 6f 4c f0 3d 3b e8 5e 3f 27 79 89 bf f5 65 a4 bf 67 4d 44 bf
encoder_l3_self_bq float32 (1, 256) c5 15 40 3f e8 d8 0a bf 58 85 38 bf d1 70 34 bf 94 d7 5f be
encoder_l3_self_bv float32 (1, 256) 6a 87 3e be ee b9 08 be e7 12 93 be f9 a8 57 bf bd c4 d8 3e
encoder_l4_ffn_W1 intgemm8 (256, 1536) 0e f5 02 fb 02 e4 0f 06 08 13 1d 28 fe 0a fb dc 12 3b 37 eb
encoder_l4_ffn_W1_QuantMultA float32 (1, 1) 5a 21 2f 41 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
encoder_l4_ffn_W2 intgemm8 (1536, 256) de 09 f2 08 fa 07 06 1d fb 0d 13 0f f5 1f 11 0e dc f6 f1 15
encoder_l4_ffn_W2_QuantMultA float32 (1, 1) 2b ac 69 41 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
encoder_l4_ffn_b1 float32 (1, 1536) ce 46 dd bf 92 ef ab 3e 65 80 d5 3f f4 8f c7 bf 80 ed de bf
encoder_l4_ffn_b2 float32 (1, 256) 9a 41 16 40 e8 1b b0 3f 63 8b 22 bf 58 8d 0e bf 1d 63 f7 be
encoder_l4_ffn_ffn_ln_bias float32 (1, 256) 95 bd e9 bd bb f4 07 bd fb a0 d8 3d 90 09 53 3d 0b 82 f9 3b
encoder_l4_ffn_ffn_ln_scale float32 (1, 256) a9 42 8a 3f bb 40 88 3f d8 41 8e 3f 48 16 7f 3f 65 12 91 3f
encoder_l4_self_Wk intgemm8 (256, 256) f1 f8 14 e9 09 f5 e2 f9 04 fe 0b 15 02 fa fc ff f9 fc f6 0e
encoder_l4_self_Wk_QuantMultA float32 (1, 1) 07 23 59 41 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
encoder_l4_self_Wo intgemm8 (256, 256) 05 01 fd 1b f6 0f 0c 0a f2 f2 fe 04 ff ea 02 12 fc 06 06 ef
encoder_l4_self_Wo_QuantMultA float32 (1, 1) 65 44 ed 41 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
encoder_l4_self_Wo_ln_bias float32 (1, 256) 15 ff 37 3d 50 ac f4 3c 5d fb 95 3b 15 93 08 3e 56 63 ba 3d
encoder_l4_self_Wo_ln_scale float32 (1, 256) 01 ed 8f 3f f3 52 97 3f a8 17 a2 3f a3 83 92 3f 7b 63 9b 3f
encoder_l4_self_Wq intgemm8 (256, 256) d8 e7 1e 06 ff 00 f2 0f fd 07 1a fa 1c fb e9 1f 06 c6 cb ee
encoder_l4_self_Wq_QuantMultA float32 (1, 1) 07 23 59 41 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
encoder_l4_self_Wv intgemm8 (256, 256) 07 e4 dc f1 e3 e4 29 10 ef 13 10 0e 01 d7 19 df ea f7 ba 26
encoder_l4_self_Wv_QuantMultA float32 (1, 1) 07 23 59 41 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
encoder_l4_self_bk float32 (1, 256) cd c4 45 bf e0 96 f1 be c9 06 8f 3e e0 e9 24 bf af 22 42 be
encoder_l4_self_bo float32 (1, 256) 9e 32 b8 bd 9d 33 cd 3e 37 be 8a be 03 c3 fa be 6f 09 6b bd
encoder_l4_self_bq float32 (1, 256) 26 c4 5e be f8 91 5e 40 57 f0 d8 be 15 b6 c2 3f 20 fc e7 be
encoder_l4_self_bv float32 (1, 256) 80 4b 6f 3d 33 8b 2d bc 52 75 d3 3e 1a 21 ba be e8 b8 1a 3f
encoder_l5_ffn_W1 intgemm8 (256, 1536) e7 0f e9 fa 00 20 11 f2 1f 01 10 05 ef 04 09 0d 10 fb fc 03
encoder_l5_ffn_W1_QuantMultA float32 (1, 1) e4 a9 3d 41 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
encoder_l5_ffn_W2 intgemm8 (1536, 256) 06 0f f0 28 03 fb f1 ff 14 fc ed 0e 0a f6 f6 0c 03 08 08 f5
encoder_l5_ffn_W2_QuantMultA float32 (1, 1) c7 0d 20 41 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
encoder_l5_ffn_b1 float32 (1, 1536) 38 d7 d8 bf 28 e1 5d bf 2b 3a 11 bf 60 21 25 bf 33 27 4c c0
encoder_l5_ffn_b2 float32 (1, 256) 84 ab e6 be 62 d5 42 3f f6 51 3e bf fd b1 98 3f 1e 14 fa bf
encoder_l5_ffn_ffn_ln_bias float32 (1, 256) 88 7d c5 3a 93 52 17 bb c8 39 a2 3c 75 f4 8f bd a6 52 45 3c
encoder_l5_ffn_ffn_ln_scale float32 (1, 256) 5f 3f 90 3f 64 3e ab 3f 82 c1 b7 3f 7e 11 8d 3f 83 de a6 3f
encoder_l5_self_Wk intgemm8 (256, 256) 03 0f 08 1e f2 f8 0d 0f 00 fe f2 07 06 fe 06 fb f8 07 09 fd
encoder_l5_self_Wk_QuantMultA float32 (1, 1) 02 8b 51 41 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
encoder_l5_self_Wo intgemm8 (256, 256) 02 f9 ed ef 3d fd f1 1c 03 d5 fe dc e2 df c6 dd 1a cd f2 e4
encoder_l5_self_Wo_QuantMultA float32 (1, 1) 5d a7 79 41 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
encoder_l5_self_Wo_ln_bias float32 (1, 256) 27 e7 05 be 04 c1 1c bd 75 ae 8e 3d c2 5e e2 3d 82 c9 6e 3c
encoder_l5_self_Wo_ln_scale float32 (1, 256) 93 67 8d 3f 77 7c 9a 3f c1 97 9e 3f ef a8 9c 3f 36 e2 a3 3f
encoder_l5_self_Wq intgemm8 (256, 256) d1 f9 e9 ef f2 fb f1 ff 05 e3 2a 0e f5 c2 df ea 14 24 fe 2e
encoder_l5_self_Wq_QuantMultA float32 (1, 1) 02 8b 51 41 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
encoder_l5_self_Wv intgemm8 (256, 256) ed fa 07 db f4 e1 d8 f8 d3 d7 eb 23 eb e0 41 f4 f3 1d d3 fa
encoder_l5_self_Wv_QuantMultA float32 (1, 1) 02 8b 51 41 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
encoder_l5_self_bk float32 (1, 256) 8d fa 4e 3e 5e a0 72 3e 04 2a 8d bd 90 23 62 3e 70 14 39 3e
encoder_l5_self_bo float32 (1, 256) f5 9a ae 3f 96 9a 6d 3f 85 75 af bd a0 18 bc be f5 c8 4a 3c
encoder_l5_self_bq float32 (1, 256) 0b 35 a9 be 0e 5e 7c bf 71 73 88 3f af 7a 9b bf a5 fe 4d 3e
encoder_l5_self_bv float32 (1, 256) b1 6d 74 be ab 5f b9 bd dc 13 a6 be 0b 1e 61 bf cc bb 94 3f
encoder_l6_ffn_W1 intgemm8 (256, 1536) ef d1 fc fe 01 f3 17 1a 01 09 e6 e7 fe e7 02 de f7 11 21 13
encoder_l6_ffn_W1_QuantMultA float32 (1, 1) ad 33 44 41 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
encoder_l6_ffn_W2 intgemm8 (1536, 256) 15 05 e5 16 26 fd 08 fd 03 eb ec ff fa fd 07 14 e5 0b fb 02
encoder_l6_ffn_W2_QuantMultA float32 (1, 1) 8d cd 86 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
encoder_l6_ffn_b1 float32 (1, 1536) b2 36 b1 bf 72 b0 64 c0 55 96 d6 bf 09 2d d1 3f d2 5f de bf
encoder_l6_ffn_b2 float32 (1, 256) 50 3c 1e bf 81 eb a0 bf bc 2f 71 3e 7a 50 8a 40 8c f6 90 3f
encoder_l6_ffn_ffn_ln_bias float32 (1, 256) 72 ad 05 3e 65 99 d0 bc 86 03 d2 bd a6 00 96 be d9 a9 8f bd
encoder_l6_ffn_ffn_ln_scale float32 (1, 256) 4b 45 8c 3f 17 c9 90 3f a0 f6 97 3f 5f 18 7b 3f 7f d6 8e 3f
encoder_l6_self_Wk intgemm8 (256, 256) 15 13 0a 01 05 f8 0c 09 07 f8 f2 07 f9 13 e8 ec 17 f9 ff 09
encoder_l6_self_Wk_QuantMultA float32 (1, 1) dd cd 3e 41 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
encoder_l6_self_Wo intgemm8 (256, 256) 2b e8 12 f0 1e f7 e5 00 11 eb fd 0c 08 fa ea f3 05 ea fb 06
encoder_l6_self_Wo_QuantMultA float32 (1, 1) 32 1a 8f 41 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
encoder_l6_self_Wo_ln_bias float32 (1, 256) 39 2a ca bd 59 b9 59 bd 42 81 35 be fc 09 a8 bc 81 3f 75 3c
encoder_l6_self_Wo_ln_scale float32 (1, 256) fb 3f a4 3f 45 ae a8 3f cb b5 a6 3f 43 ab a0 3f 9a 06 aa 3f
encoder_l6_self_Wq intgemm8 (256, 256) de f4 17 0c 08 f6 f1 2e 18 f8 13 10 fa 06 ea fd ec 10 d9 01
encoder_l6_self_Wq_QuantMultA float32 (1, 1) dd cd 3e 41 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
encoder_l6_self_Wv intgemm8 (256, 256) e2 20 12 d2 04 05 fd fe 16 15 ef 1d 07 02 05 f3 fe 1e 02 f3
encoder_l6_self_Wv_QuantMultA float32 (1, 1) dd cd 3e 41 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
encoder_l6_self_bk float32 (1, 256) f7 c2 24 3f cd 1d 43 be de 49 5b 3f ae 2f 9a 3e 0f 55 96 be
encoder_l6_self_bo float32 (1, 256) 5b 3e 48 3e 95 08 a5 bd f0 0b 2e 3f b3 fa 6d bd d6 ab 3a bf
encoder_l6_self_bq float32 (1, 256) 35 e0 c3 3e 45 22 7c bf 0e 6d 81 c0 79 56 61 3f 9c fd 8a bf
encoder_l6_self_bv float32 (1, 256) e5 97 2a bf f2 04 ee 3e 54 6a 8a 3f 00 78 fe be cb 8c 59 3f
none_QuantMultA float32 (1, 1) 50 a4 02 41 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
special:model.yml int8 (1187,) 62 65 72 74 2d 74 72 61 69 6e 2d 74 79 70 65 2d 65 6d 62 65
YAML:
bert-train-type-embeddings: true
bert-type-vocab-size: 2
dec-cell: ssru
dec-cell-base-depth: 2
dec-cell-high-depth: 1
dec-depth: 2
dim-emb: 256
dim-rnn: 1024
dim-vocabs:
- 32000
- 32000
enc-cell: gru
enc-cell-depth: 1
enc-depth: 6
enc-type: bidirectional
factors-combine: sum
factors-dim-emb: 0
input-types: []
layer-normalization: false
lemma-dependency: ''
lemma-dim-emb: 0
output-omit-bias: false
right-left: false
skip: false
tied-embeddings: false
tied-embeddings-all: true
tied-embeddings-src: false
transformer-aan-activation: swish
transformer-aan-depth: 2
transformer-aan-nogate: false
transformer-decoder-autoreg: rnn
transformer-dim-aan: 2048
transformer-dim-ffn: 1536
transformer-ffn-activation: relu
transformer-ffn-depth: 2
transformer-guided-alignment-layer: last
transformer-heads: 8
transformer-no-projection: false
transformer-pool: false
transformer-postprocess: dan
transformer-postprocess-emb: d
transformer-postprocess-top: ''
transformer-preprocess: ''
transformer-tied-layers: []
transformer-train-position-embeddings: false
type: transformer
ulr: false
ulr-dim-emb: 0
ulr-trainable-transformation: false
version: v1.10.25; e8a1a253 2021-12-07 17:47:33 +0000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment