Repository navigation
Commit 0e04820
committed
tensor: fix dropped rows/cols in the ToT x scalar strided scale paths
The GEMM-based ToT x scalar scale paths of Tensor::gemm (and the
T x ToT mirror) probe each row (column) for cleanliness; the presence
probe stops at the first ABSENT cell, leaving the probed inner size
A == -1 when the leading cell is absent. The subsequent 'A <= 0 =>
empty row, nothing to do' shortcut then dropped the ENTIRE row's
contributions even when later cells were present. Rows whose leading
contracted cell is absent (common for screened tensor-of-tensors, e.g.
PNO-CC CSV intermediates) silently lost their contraction.
Fix: when the probe ends with A <= 0, scan the full row (column) for
any present cell; only a fully absent row is skipped, anything else
takes the per-cell AXPY fallback. Also guard the engine's scale
fallback element op against absent cells.
This bug predates the general-product work but was masked on the
legacy einsum route, whose canonical operand layout fails the
NoTranspose gate of the strided path; the expression route's
GEMM-canonical layout exposed it. Found with TA_EINSUM_DIFFERENTIAL on
c6h14 PNO-CCSD: the opt-in expression-route energy error drops from
1.7 Eh to 6.9e-7 (the small residual is a screening-semantics
difference -- the legacy route hard-zeroes sub-threshold result tiles
that the engine route keeps -- plus a small systematic difference in
phantom-unit denest products, both under review).
Adds the CSV-like reproduction test (arena view cells, SparsePolicy,
variable inner extents, screened cells, non-leading fused index,
interleaved target): expression route and einsum routes agree to
1e-10, deterministically.1 parent fe6703a commit 0e04820
5 files changed
Lines changed: 459 additions & 3 deletions
File tree
- src/TiledArray
- einsum
- expressions
- tensor
- tile_op
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1096 | 1096 | | |
1097 | 1097 | | |
1098 | 1098 | | |
| 1099 | + | |
| 1100 | + | |
| 1101 | + | |
| 1102 | + | |
| 1103 | + | |
| 1104 | + | |
| 1105 | + | |
| 1106 | + | |
| 1107 | + | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
| 1112 | + | |
| 1113 | + | |
| 1114 | + | |
| 1115 | + | |
| 1116 | + | |
| 1117 | + | |
| 1118 | + | |
| 1119 | + | |
| 1120 | + | |
| 1121 | + | |
| 1122 | + | |
| 1123 | + | |
| 1124 | + | |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
| 1128 | + | |
| 1129 | + | |
| 1130 | + | |
| 1131 | + | |
| 1132 | + | |
| 1133 | + | |
| 1134 | + | |
| 1135 | + | |
| 1136 | + | |
| 1137 | + | |
| 1138 | + | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
1099 | 1144 | | |
1100 | 1145 | | |
1101 | 1146 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1679 | 1679 | | |
1680 | 1680 | | |
1681 | 1681 | | |
| 1682 | + | |
1682 | 1683 | | |
1683 | 1684 | | |
1684 | 1685 | | |
1685 | 1686 | | |
1686 | 1687 | | |
| 1688 | + | |
1687 | 1689 | | |
1688 | 1690 | | |
1689 | 1691 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3374 | 3374 | | |
3375 | 3375 | | |
3376 | 3376 | | |
3377 | | - | |
| 3377 | + | |
| 3378 | + | |
| 3379 | + | |
| 3380 | + | |
| 3381 | + | |
| 3382 | + | |
| 3383 | + | |
| 3384 | + | |
| 3385 | + | |
| 3386 | + | |
| 3387 | + | |
| 3388 | + | |
| 3389 | + | |
3378 | 3390 | | |
3379 | 3391 | | |
3380 | 3392 | | |
| |||
3533 | 3545 | | |
3534 | 3546 | | |
3535 | 3547 | | |
3536 | | - | |
| 3548 | + | |
| 3549 | + | |
| 3550 | + | |
| 3551 | + | |
| 3552 | + | |
| 3553 | + | |
| 3554 | + | |
| 3555 | + | |
| 3556 | + | |
| 3557 | + | |
3537 | 3558 | | |
3538 | 3559 | | |
3539 | 3560 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
193 | 193 | | |
194 | 194 | | |
195 | 195 | | |
196 | | - | |
| 196 | + | |
| 197 | + | |
197 | 198 | | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
198 | 208 | | |
199 | 209 | | |
200 | 210 | | |
| |||
0 commit comments