Bit-cascade division stages and all float comparators
Browse filesReplaced the remaining single-layer wide comparators with bit-cascaded
ternary equivalents using the existing add_bit_cascade_compare helper:
alu.alu{8,16,32}bit.div.stage{N}.cmp per-stage GE comparator
float16.add.exp_cmp.{a_gt_b,a_lt_b} 5-bit GT/LT
float32.add.exp_cmp.{a_gt_b,a_lt_b} 8-bit GT/LT
float16.cmp.{mag_a_gt_b,mag_a_ge_b,...} 15-bit magnitude comparator
float32.cmp.{mag_a_gt_b,mag_a_ge_b,...} 31-bit magnitude comparator
float16.div.mant_div.stage{N}.cmp 11-bit GE per stage
float32.div.mant_div.stage{N}.cmp 24-bit GE per stage
Each emit retains the original output gate name (e.g. mag_a_gt_b),
backed now by a tree of bit-cascade gates whose internal structure lives
under cmp_bc.* / mag_bc.* / exp_cmp_bc.*. Public consumers see the same
names; only the weight tensors change shape (smaller).
eval.py shape expectations updated for the float tests.
Non-ternary weight tensor count on the canonical drops from 161 to 70.
The 70 remaining are hand-constructed seed-file content:
68 modular arithmetic layer1 gates (mod 3, 5, 6, 7, 9, 10, 11, 12)
2 pattern_recognition gates (leadingones, trailingones)
All 18 variants rebuilt; eval_all.py reports 100% fitness on every one.
- build.py +89 -43
- eval.py +7 -7
- neural_computer.safetensors +2 -2
- variants/neural_alu16.safetensors +2 -2
- variants/neural_alu32.safetensors +2 -2
- variants/neural_alu8.safetensors +2 -2
- variants/neural_computer16.safetensors +2 -2
- variants/neural_computer16_reduced.safetensors +2 -2
- variants/neural_computer16_registers.safetensors +2 -2
- variants/neural_computer16_scratchpad.safetensors +2 -2
- variants/neural_computer16_small.safetensors +2 -2
- variants/neural_computer32.safetensors +2 -2
- variants/neural_computer32_reduced.safetensors +2 -2
- variants/neural_computer32_registers.safetensors +2 -2
- variants/neural_computer32_scratchpad.safetensors +2 -2
- variants/neural_computer32_small.safetensors +2 -2
- variants/neural_computer8.safetensors +2 -2
- variants/neural_computer8_reduced.safetensors +2 -2
- variants/neural_computer8_registers.safetensors +2 -2
- variants/neural_computer8_scratchpad.safetensors +2 -2
- variants/neural_computer8_small.safetensors +2 -2
|
@@ -495,10 +495,18 @@ def add_div(tensors: Dict[str, torch.Tensor]) -> None:
|
|
| 495 |
- Uses existing comparator and subtractor components
|
| 496 |
"""
|
| 497 |
# Comparison gates: check if (remainder << 1 | next_bit) >= divisor
|
|
|
|
| 498 |
for stage in range(8):
|
| 499 |
-
|
| 500 |
-
|
| 501 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 502 |
|
| 503 |
# Conditional mux gates: select (rem - div) or rem based on comparison
|
| 504 |
for stage in range(8):
|
|
@@ -930,14 +938,20 @@ def add_mul_nbits(tensors: Dict[str, torch.Tensor], bits: int) -> None:
|
|
| 930 |
def add_div_nbits(tensors: Dict[str, torch.Tensor], bits: int) -> None:
|
| 931 |
"""Add N-bit division circuit.
|
| 932 |
|
| 933 |
-
Uses restoring division algorithm with N iterations.
|
|
|
|
| 934 |
"""
|
| 935 |
-
pos_weights = [float(1 << (bits - 1 - i)) for i in range(bits)]
|
| 936 |
-
neg_weights = [-w for w in pos_weights]
|
| 937 |
-
cmp_weights = pos_weights + neg_weights
|
| 938 |
-
|
| 939 |
for stage in range(bits):
|
| 940 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 941 |
|
| 942 |
for stage in range(bits):
|
| 943 |
for bit in range(bits):
|
|
@@ -1078,10 +1092,17 @@ def add_float16_add(tensors: Dict[str, torch.Tensor]) -> None:
|
|
| 1078 |
"""
|
| 1079 |
prefix = "float16.add"
|
| 1080 |
|
| 1081 |
-
|
| 1082 |
-
|
| 1083 |
-
|
| 1084 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1085 |
|
| 1086 |
for bit in range(5):
|
| 1087 |
add_gate(tensors, f"{prefix}.exp_diff.fa{bit}.ha1.sum.layer1.or", [1.0, 1.0], [-1.0])
|
|
@@ -1235,9 +1256,17 @@ def add_float16_div(tensors: Dict[str, torch.Tensor]) -> None:
|
|
| 1235 |
add_gate(tensors, f"{prefix}.bias_add.fa{bit}.carry_or", [1.0, 1.0], [-1.0])
|
| 1236 |
|
| 1237 |
for stage in range(11):
|
| 1238 |
-
|
| 1239 |
-
|
| 1240 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1241 |
|
| 1242 |
for bit in range(11):
|
| 1243 |
add_gate(tensors, f"{prefix}.mant_div.stage{stage}.sub.not_d.bit{bit}", [-1.0], [0.0])
|
|
@@ -1292,16 +1321,17 @@ def add_float16_cmp(tensors: Dict[str, torch.Tensor]) -> None:
|
|
| 1292 |
|
| 1293 |
add_gate(tensors, f"{prefix}.both_zero", [1.0, 1.0], [-2.0])
|
| 1294 |
|
| 1295 |
-
|
| 1296 |
-
|
| 1297 |
-
|
| 1298 |
-
|
| 1299 |
-
|
| 1300 |
-
|
| 1301 |
-
|
| 1302 |
-
|
| 1303 |
-
|
| 1304 |
-
|
|
|
|
| 1305 |
|
| 1306 |
add_gate(tensors, f"{prefix}.eq.not_nan", [-1.0], [0.0])
|
| 1307 |
add_gate(tensors, f"{prefix}.eq.mag_or_zero", [1.0, 1.0], [-1.0])
|
|
@@ -1412,16 +1442,17 @@ def add_float32_cmp(tensors: Dict[str, torch.Tensor]) -> None:
|
|
| 1412 |
|
| 1413 |
add_gate(tensors, f"{prefix}.both_zero", [1.0, 1.0], [-2.0])
|
| 1414 |
|
| 1415 |
-
|
| 1416 |
-
|
| 1417 |
-
|
| 1418 |
-
|
| 1419 |
-
|
| 1420 |
-
|
| 1421 |
-
|
| 1422 |
-
|
| 1423 |
-
|
| 1424 |
-
|
|
|
|
| 1425 |
|
| 1426 |
add_gate(tensors, f"{prefix}.eq.not_nan", [-1.0], [0.0])
|
| 1427 |
add_gate(tensors, f"{prefix}.eq.mag_or_zero", [1.0, 1.0], [-1.0])
|
|
@@ -1469,10 +1500,17 @@ def add_float32_add(tensors: Dict[str, torch.Tensor]) -> None:
|
|
| 1469 |
"""
|
| 1470 |
prefix = "float32.add"
|
| 1471 |
|
| 1472 |
-
|
| 1473 |
-
|
| 1474 |
-
|
| 1475 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1476 |
|
| 1477 |
for bit in range(8):
|
| 1478 |
add_gate(tensors, f"{prefix}.exp_diff.fa{bit}.ha1.sum.layer1.or", [1.0, 1.0], [-1.0])
|
|
@@ -1626,9 +1664,17 @@ def add_float32_div(tensors: Dict[str, torch.Tensor]) -> None:
|
|
| 1626 |
add_gate(tensors, f"{prefix}.bias_add.fa{bit}.carry_or", [1.0, 1.0], [-1.0])
|
| 1627 |
|
| 1628 |
for stage in range(24):
|
| 1629 |
-
|
| 1630 |
-
|
| 1631 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1632 |
|
| 1633 |
for bit in range(24):
|
| 1634 |
add_gate(tensors, f"{prefix}.mant_div.stage{stage}.sub.not_d.bit{bit}", [-1.0], [0.0])
|
|
|
|
| 495 |
- Uses existing comparator and subtractor components
|
| 496 |
"""
|
| 497 |
# Comparison gates: check if (remainder << 1 | next_bit) >= divisor
|
| 498 |
+
# Bit-cascaded ternary GE comparator per stage.
|
| 499 |
for stage in range(8):
|
| 500 |
+
add_bit_cascade_compare(
|
| 501 |
+
tensors,
|
| 502 |
+
cmp_prefix=f"alu.alu8bit.div.stage{stage}.cmp_bc",
|
| 503 |
+
bits=8,
|
| 504 |
+
out_gt=f"alu.alu8bit.div.stage{stage}.cmp_bc.gt",
|
| 505 |
+
out_lt=f"alu.alu8bit.div.stage{stage}.cmp_bc.lt",
|
| 506 |
+
out_ge=f"alu.alu8bit.div.stage{stage}.cmp",
|
| 507 |
+
out_le=f"alu.alu8bit.div.stage{stage}.cmp_bc.le",
|
| 508 |
+
out_eq=f"alu.alu8bit.div.stage{stage}.cmp_bc.eq",
|
| 509 |
+
)
|
| 510 |
|
| 511 |
# Conditional mux gates: select (rem - div) or rem based on comparison
|
| 512 |
for stage in range(8):
|
|
|
|
| 938 |
def add_div_nbits(tensors: Dict[str, torch.Tensor], bits: int) -> None:
|
| 939 |
"""Add N-bit division circuit.
|
| 940 |
|
| 941 |
+
Uses restoring division algorithm with N iterations. Each stage's
|
| 942 |
+
comparator (rem >= div) is a ternary bit-cascade GE.
|
| 943 |
"""
|
|
|
|
|
|
|
|
|
|
|
|
|
| 944 |
for stage in range(bits):
|
| 945 |
+
add_bit_cascade_compare(
|
| 946 |
+
tensors,
|
| 947 |
+
cmp_prefix=f"alu.alu{bits}bit.div.stage{stage}.cmp_bc",
|
| 948 |
+
bits=bits,
|
| 949 |
+
out_gt=f"alu.alu{bits}bit.div.stage{stage}.cmp_bc.gt",
|
| 950 |
+
out_lt=f"alu.alu{bits}bit.div.stage{stage}.cmp_bc.lt",
|
| 951 |
+
out_ge=f"alu.alu{bits}bit.div.stage{stage}.cmp",
|
| 952 |
+
out_le=f"alu.alu{bits}bit.div.stage{stage}.cmp_bc.le",
|
| 953 |
+
out_eq=f"alu.alu{bits}bit.div.stage{stage}.cmp_bc.eq",
|
| 954 |
+
)
|
| 955 |
|
| 956 |
for stage in range(bits):
|
| 957 |
for bit in range(bits):
|
|
|
|
| 1092 |
"""
|
| 1093 |
prefix = "float16.add"
|
| 1094 |
|
| 1095 |
+
# 5-bit exponent comparator, bit-cascaded ternary form.
|
| 1096 |
+
add_bit_cascade_compare(
|
| 1097 |
+
tensors,
|
| 1098 |
+
cmp_prefix=f"{prefix}.exp_cmp_bc",
|
| 1099 |
+
bits=5,
|
| 1100 |
+
out_gt=f"{prefix}.exp_cmp.a_gt_b",
|
| 1101 |
+
out_lt=f"{prefix}.exp_cmp.a_lt_b",
|
| 1102 |
+
out_ge=f"{prefix}.exp_cmp_bc.ge",
|
| 1103 |
+
out_le=f"{prefix}.exp_cmp_bc.le",
|
| 1104 |
+
out_eq=f"{prefix}.exp_cmp_bc.eq",
|
| 1105 |
+
)
|
| 1106 |
|
| 1107 |
for bit in range(5):
|
| 1108 |
add_gate(tensors, f"{prefix}.exp_diff.fa{bit}.ha1.sum.layer1.or", [1.0, 1.0], [-1.0])
|
|
|
|
| 1256 |
add_gate(tensors, f"{prefix}.bias_add.fa{bit}.carry_or", [1.0, 1.0], [-1.0])
|
| 1257 |
|
| 1258 |
for stage in range(11):
|
| 1259 |
+
# 11-bit GE comparator per division stage, bit-cascaded ternary form.
|
| 1260 |
+
add_bit_cascade_compare(
|
| 1261 |
+
tensors,
|
| 1262 |
+
cmp_prefix=f"{prefix}.mant_div.stage{stage}.cmp_bc",
|
| 1263 |
+
bits=11,
|
| 1264 |
+
out_gt=f"{prefix}.mant_div.stage{stage}.cmp_bc.gt",
|
| 1265 |
+
out_lt=f"{prefix}.mant_div.stage{stage}.cmp_bc.lt",
|
| 1266 |
+
out_ge=f"{prefix}.mant_div.stage{stage}.cmp",
|
| 1267 |
+
out_le=f"{prefix}.mant_div.stage{stage}.cmp_bc.le",
|
| 1268 |
+
out_eq=f"{prefix}.mant_div.stage{stage}.cmp_bc.eq",
|
| 1269 |
+
)
|
| 1270 |
|
| 1271 |
for bit in range(11):
|
| 1272 |
add_gate(tensors, f"{prefix}.mant_div.stage{stage}.sub.not_d.bit{bit}", [-1.0], [0.0])
|
|
|
|
| 1321 |
|
| 1322 |
add_gate(tensors, f"{prefix}.both_zero", [1.0, 1.0], [-2.0])
|
| 1323 |
|
| 1324 |
+
# Bit-cascaded ternary 15-bit magnitude comparator (sign-cleared payload).
|
| 1325 |
+
add_bit_cascade_compare(
|
| 1326 |
+
tensors,
|
| 1327 |
+
cmp_prefix=f"{prefix}.mag_bc",
|
| 1328 |
+
bits=15,
|
| 1329 |
+
out_gt=f"{prefix}.mag_a_gt_b",
|
| 1330 |
+
out_lt=f"{prefix}.mag_a_lt_b",
|
| 1331 |
+
out_ge=f"{prefix}.mag_a_ge_b",
|
| 1332 |
+
out_le=f"{prefix}.mag_a_le_b",
|
| 1333 |
+
out_eq=f"{prefix}.mag_eq.and",
|
| 1334 |
+
)
|
| 1335 |
|
| 1336 |
add_gate(tensors, f"{prefix}.eq.not_nan", [-1.0], [0.0])
|
| 1337 |
add_gate(tensors, f"{prefix}.eq.mag_or_zero", [1.0, 1.0], [-1.0])
|
|
|
|
| 1442 |
|
| 1443 |
add_gate(tensors, f"{prefix}.both_zero", [1.0, 1.0], [-2.0])
|
| 1444 |
|
| 1445 |
+
# Bit-cascaded ternary 31-bit magnitude comparator.
|
| 1446 |
+
add_bit_cascade_compare(
|
| 1447 |
+
tensors,
|
| 1448 |
+
cmp_prefix=f"{prefix}.mag_bc",
|
| 1449 |
+
bits=31,
|
| 1450 |
+
out_gt=f"{prefix}.mag_a_gt_b",
|
| 1451 |
+
out_lt=f"{prefix}.mag_a_lt_b",
|
| 1452 |
+
out_ge=f"{prefix}.mag_a_ge_b",
|
| 1453 |
+
out_le=f"{prefix}.mag_a_le_b",
|
| 1454 |
+
out_eq=f"{prefix}.mag_eq.and",
|
| 1455 |
+
)
|
| 1456 |
|
| 1457 |
add_gate(tensors, f"{prefix}.eq.not_nan", [-1.0], [0.0])
|
| 1458 |
add_gate(tensors, f"{prefix}.eq.mag_or_zero", [1.0, 1.0], [-1.0])
|
|
|
|
| 1500 |
"""
|
| 1501 |
prefix = "float32.add"
|
| 1502 |
|
| 1503 |
+
# 8-bit exponent comparator, bit-cascaded ternary form.
|
| 1504 |
+
add_bit_cascade_compare(
|
| 1505 |
+
tensors,
|
| 1506 |
+
cmp_prefix=f"{prefix}.exp_cmp_bc",
|
| 1507 |
+
bits=8,
|
| 1508 |
+
out_gt=f"{prefix}.exp_cmp.a_gt_b",
|
| 1509 |
+
out_lt=f"{prefix}.exp_cmp.a_lt_b",
|
| 1510 |
+
out_ge=f"{prefix}.exp_cmp_bc.ge",
|
| 1511 |
+
out_le=f"{prefix}.exp_cmp_bc.le",
|
| 1512 |
+
out_eq=f"{prefix}.exp_cmp_bc.eq",
|
| 1513 |
+
)
|
| 1514 |
|
| 1515 |
for bit in range(8):
|
| 1516 |
add_gate(tensors, f"{prefix}.exp_diff.fa{bit}.ha1.sum.layer1.or", [1.0, 1.0], [-1.0])
|
|
|
|
| 1664 |
add_gate(tensors, f"{prefix}.bias_add.fa{bit}.carry_or", [1.0, 1.0], [-1.0])
|
| 1665 |
|
| 1666 |
for stage in range(24):
|
| 1667 |
+
# 24-bit GE comparator per stage, bit-cascaded ternary form.
|
| 1668 |
+
add_bit_cascade_compare(
|
| 1669 |
+
tensors,
|
| 1670 |
+
cmp_prefix=f"{prefix}.mant_div.stage{stage}.cmp_bc",
|
| 1671 |
+
bits=24,
|
| 1672 |
+
out_gt=f"{prefix}.mant_div.stage{stage}.cmp_bc.gt",
|
| 1673 |
+
out_lt=f"{prefix}.mant_div.stage{stage}.cmp_bc.lt",
|
| 1674 |
+
out_ge=f"{prefix}.mant_div.stage{stage}.cmp",
|
| 1675 |
+
out_le=f"{prefix}.mant_div.stage{stage}.cmp_bc.le",
|
| 1676 |
+
out_eq=f"{prefix}.mant_div.stage{stage}.cmp_bc.eq",
|
| 1677 |
+
)
|
| 1678 |
|
| 1679 |
for bit in range(24):
|
| 1680 |
add_gate(tensors, f"{prefix}.mant_div.stage{stage}.sub.not_d.bit{bit}", [-1.0], [0.0])
|
|
@@ -4120,8 +4120,8 @@ class BatchedFitnessEvaluator:
|
|
| 4120 |
print("\n=== FLOAT16 ADD ===")
|
| 4121 |
|
| 4122 |
expected_gates = [
|
| 4123 |
-
('float16.add.exp_cmp.a_gt_b.weight', (
|
| 4124 |
-
('float16.add.exp_cmp.a_lt_b.weight', (
|
| 4125 |
('float16.add.exp_diff.fa0.ha1.sum.layer1.or.weight', (2,)),
|
| 4126 |
('float16.add.align.stage0.bit0.not_sel.weight', (1,)),
|
| 4127 |
('float16.add.sign_xor.layer1.or.weight', (2,)),
|
|
@@ -4198,7 +4198,7 @@ class BatchedFitnessEvaluator:
|
|
| 4198 |
('float16.div.sign_xor.layer1.or.weight', (2,)),
|
| 4199 |
('float16.div.exp_sub.not_b.bit0.weight', (1,)),
|
| 4200 |
('float16.div.bias_add.fa0.ha1.sum.layer1.or.weight', (2,)),
|
| 4201 |
-
('float16.div.mant_div.stage0.cmp.weight', (
|
| 4202 |
('float16.div.mant_div.stage0.sub.not_d.bit0.weight', (1,)),
|
| 4203 |
('float16.div.mant_div.stage0.mux.bit0.not_sel.weight', (1,)),
|
| 4204 |
]
|
|
@@ -4238,7 +4238,7 @@ class BatchedFitnessEvaluator:
|
|
| 4238 |
('float16.cmp.either_nan.weight', (2,)),
|
| 4239 |
('float16.cmp.sign_xor.layer1.or.weight', (2,)),
|
| 4240 |
('float16.cmp.both_zero.weight', (2,)),
|
| 4241 |
-
('float16.cmp.mag_a_gt_b.weight', (
|
| 4242 |
('float16.cmp.eq.result.weight', (2,)),
|
| 4243 |
('float16.cmp.lt.result.weight', (3,)),
|
| 4244 |
('float16.cmp.gt.result.weight', (3,)),
|
|
@@ -4316,7 +4316,7 @@ class BatchedFitnessEvaluator:
|
|
| 4316 |
print("\n=== FLOAT32 ADD ===")
|
| 4317 |
|
| 4318 |
expected_gates = [
|
| 4319 |
-
('float32.add.exp_cmp.a_gt_b.weight', (
|
| 4320 |
('float32.add.exp_diff.fa0.ha1.sum.layer1.or.weight', (2,)),
|
| 4321 |
('float32.add.align.stage0.bit0.not_sel.weight', (1,)),
|
| 4322 |
('float32.add.sign_xor.layer1.or.weight', (2,)),
|
|
@@ -4393,7 +4393,7 @@ class BatchedFitnessEvaluator:
|
|
| 4393 |
('float32.div.sign_xor.layer1.or.weight', (2,)),
|
| 4394 |
('float32.div.exp_sub.not_b.bit0.weight', (1,)),
|
| 4395 |
('float32.div.bias_add.fa0.ha1.sum.layer1.or.weight', (2,)),
|
| 4396 |
-
('float32.div.mant_div.stage0.cmp.weight', (
|
| 4397 |
('float32.div.mant_div.stage0.sub.not_d.bit0.weight', (1,)),
|
| 4398 |
('float32.div.mant_div.stage0.mux.bit0.not_sel.weight', (1,)),
|
| 4399 |
]
|
|
@@ -4433,7 +4433,7 @@ class BatchedFitnessEvaluator:
|
|
| 4433 |
('float32.cmp.either_nan.weight', (2,)),
|
| 4434 |
('float32.cmp.sign_xor.layer1.or.weight', (2,)),
|
| 4435 |
('float32.cmp.both_zero.weight', (2,)),
|
| 4436 |
-
('float32.cmp.mag_a_gt_b.weight', (
|
| 4437 |
('float32.cmp.eq.result.weight', (2,)),
|
| 4438 |
('float32.cmp.lt.result.weight', (3,)),
|
| 4439 |
('float32.cmp.gt.result.weight', (3,)),
|
|
|
|
| 4120 |
print("\n=== FLOAT16 ADD ===")
|
| 4121 |
|
| 4122 |
expected_gates = [
|
| 4123 |
+
('float16.add.exp_cmp.a_gt_b.weight', (5,)), # bit-cascaded final OR over 5 bits
|
| 4124 |
+
('float16.add.exp_cmp.a_lt_b.weight', (5,)), # bit-cascaded final OR over 5 bits
|
| 4125 |
('float16.add.exp_diff.fa0.ha1.sum.layer1.or.weight', (2,)),
|
| 4126 |
('float16.add.align.stage0.bit0.not_sel.weight', (1,)),
|
| 4127 |
('float16.add.sign_xor.layer1.or.weight', (2,)),
|
|
|
|
| 4198 |
('float16.div.sign_xor.layer1.or.weight', (2,)),
|
| 4199 |
('float16.div.exp_sub.not_b.bit0.weight', (1,)),
|
| 4200 |
('float16.div.bias_add.fa0.ha1.sum.layer1.or.weight', (2,)),
|
| 4201 |
+
('float16.div.mant_div.stage0.cmp.weight', (1,)), # bit-cascaded GE = NOT(LT) buffer
|
| 4202 |
('float16.div.mant_div.stage0.sub.not_d.bit0.weight', (1,)),
|
| 4203 |
('float16.div.mant_div.stage0.mux.bit0.not_sel.weight', (1,)),
|
| 4204 |
]
|
|
|
|
| 4238 |
('float16.cmp.either_nan.weight', (2,)),
|
| 4239 |
('float16.cmp.sign_xor.layer1.or.weight', (2,)),
|
| 4240 |
('float16.cmp.both_zero.weight', (2,)),
|
| 4241 |
+
('float16.cmp.mag_a_gt_b.weight', (15,)), # bit-cascaded final OR over 15 bits
|
| 4242 |
('float16.cmp.eq.result.weight', (2,)),
|
| 4243 |
('float16.cmp.lt.result.weight', (3,)),
|
| 4244 |
('float16.cmp.gt.result.weight', (3,)),
|
|
|
|
| 4316 |
print("\n=== FLOAT32 ADD ===")
|
| 4317 |
|
| 4318 |
expected_gates = [
|
| 4319 |
+
('float32.add.exp_cmp.a_gt_b.weight', (8,)), # bit-cascaded final OR over 8 bits
|
| 4320 |
('float32.add.exp_diff.fa0.ha1.sum.layer1.or.weight', (2,)),
|
| 4321 |
('float32.add.align.stage0.bit0.not_sel.weight', (1,)),
|
| 4322 |
('float32.add.sign_xor.layer1.or.weight', (2,)),
|
|
|
|
| 4393 |
('float32.div.sign_xor.layer1.or.weight', (2,)),
|
| 4394 |
('float32.div.exp_sub.not_b.bit0.weight', (1,)),
|
| 4395 |
('float32.div.bias_add.fa0.ha1.sum.layer1.or.weight', (2,)),
|
| 4396 |
+
('float32.div.mant_div.stage0.cmp.weight', (1,)), # bit-cascaded GE = NOT(LT) buffer
|
| 4397 |
('float32.div.mant_div.stage0.sub.not_d.bit0.weight', (1,)),
|
| 4398 |
('float32.div.mant_div.stage0.mux.bit0.not_sel.weight', (1,)),
|
| 4399 |
]
|
|
|
|
| 4433 |
('float32.cmp.either_nan.weight', (2,)),
|
| 4434 |
('float32.cmp.sign_xor.layer1.or.weight', (2,)),
|
| 4435 |
('float32.cmp.both_zero.weight', (2,)),
|
| 4436 |
+
('float32.cmp.mag_a_gt_b.weight', (31,)), # bit-cascaded final OR over 31 bits
|
| 4437 |
('float32.cmp.eq.result.weight', (2,)),
|
| 4438 |
('float32.cmp.lt.result.weight', (3,)),
|
| 4439 |
('float32.cmp.gt.result.weight', (3,)),
|
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:cebab4da35327fd33df5d8c51b94b2aa78c2fa4024447a3d708c17abe16988de
|
| 3 |
+
size 27129497
|
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:bbdd1fa4da68c78c6df075b1348ccdc6078f32c00cab4fbf5a637268d057948f
|
| 3 |
+
size 17045126
|
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5e1d73f1fb7c08476cfe33b4af7a23abce2e1dcb320166d503f41f90fb80fe66
|
| 3 |
+
size 18610419
|
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ef6eeadc02e7791c0172fdd747be6069cee9d42f7a0117ec790a5c82446aca52
|
| 3 |
+
size 15476531
|
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7b1a4769cc97b531f240b30a1be6c3d586705162ba092d15faf36d625553e712
|
| 3 |
+
size 25545780
|
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a4898c06100b2d9cb2a6281899f97545d8d9d1026dcde12ee0e9e53a9aec83a0
|
| 3 |
+
size 17734524
|
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0caa9087e34b1b3463d8ea17e22fc1ce2786f1d121e1a4b7ee19024f99560536
|
| 3 |
+
size 17131660
|
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a33d563bf442171a7cd543e91dee4f59e550470a785b3abd7fc87642c5244b84
|
| 3 |
+
size 17212388
|
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1450a242b5f35da0e07ff9d7cfea656dc819318bdb1b0c1b92eeb874be063a4b
|
| 3 |
+
size 17331228
|
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5ac52a81ce84db5c223619377dc371ee8585e398638d27005e3beae9920a14cc
|
| 3 |
+
size 27129497
|
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:bede692b9066b5da2f4323a1f9524a03d3aaebe44426e17d8a4b6b40b293665b
|
| 3 |
+
size 19318801
|
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4c069defbe8983c9706f73e7e1ba30a1957ce637a518eeaa21f2f453004653ca
|
| 3 |
+
size 18715553
|
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:feb88c8ca6882d45c9ea3ad0fe447a63c95e98cbefc3f1955c43ac1c09c4d323
|
| 3 |
+
size 18796065
|
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b53f4b57f99409cf2204e4ddaeec05eb381b1ef6091808f4a2462f5575d1e4fa
|
| 3 |
+
size 18914905
|
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ebe7336a5853e445ee490472570febf874a5c9795cd1e3aa6bc82615ab10647a
|
| 3 |
+
size 23967977
|
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:323e44b6d218fee6ece8ef8792482cd55556ab0b9a6dc08cef3dbce33aaee176
|
| 3 |
+
size 16156705
|
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:14788684708414276ecde83ea2f7ed549dfe21acad90e46947274f3ff6e02253
|
| 3 |
+
size 15553977
|
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1431ce552517ff3df400d8c98eab7cda8b0bd951e8154e3b47bfdee1be2b70f8
|
| 3 |
+
size 15634545
|
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3d55a3bd459591aeb7ccd4cd9a0f11bc69a5db602c604b85661e1657657dba68
|
| 3 |
+
size 15753409
|