Skip to content

Commit 8b473f5

Browse files
committed
tests/ordered: add PAO (μ̃) batch lever to the dry-run report
Extend SEQUANT_UT_DRYRUN_BATCH with pao | aux_pao | aux_pao_occ, adding the μ̃ (PAO) contracted axis (block 256) to the report tool's batch policy. This is the lever that lets the factorizer contract K in the compact PAO basis and slice μ̃; the sweep shows the contracted-only plans (pao, aux_pao) now BUILD on the ordered scheduler (no forced-split assert), isolating the remaining blockers to the executor (μ̃-scatter assert) and the occ-only-reducible 4-occ 2-PNO peak. The pure-aux ordered build keeps its {Κ} mode_order; every other mode uses the empty (production) mode_order.
1 parent c34d1b0 commit 8b473f5

1 file changed

Lines changed: 23 additions & 15 deletions

File tree

tests/unit/test_ordered_executor.cpp

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1258,25 +1258,34 @@ TEST_CASE(
12581258
system == "c60" ? kOrderedExecC60_pVDZF12 : kOrderedExecWater20_pVDZF12);
12591259
auto cm = std::make_shared<sequant::eval::dryrun::CostModel const>(regime);
12601260

1261-
// BATCH mode (SEQUANT_UT_DRYRUN_BATCH = none | aux [default] | aux_occ).
1261+
// BATCH mode (SEQUANT_UT_DRYRUN_BATCH = none | aux [default] | aux_occ |
1262+
// pao | aux_pao | aux_pao_occ). "pao" adds the μ̃ (PAO) contracted axis --
1263+
// the lever that lets the factorizer contract K in the compact PAO basis and
1264+
// slice μ̃, avoiding the aux-free 4-occ/2-PNO integrals entirely.
12621265
std::string batch = "aux";
12631266
if (char const* b = std::getenv("SEQUANT_UT_DRYRUN_BATCH")) batch = b;
1264-
bool const batch_aux = (batch == "aux" || batch == "aux_occ");
1265-
bool const batch_occ = (batch == "aux_occ");
1266-
constexpr std::size_t kAuxBlock = 256, kOccBlock = 8;
1267+
bool const batch_aux = (batch == "aux" || batch == "aux_occ" ||
1268+
batch == "aux_pao" || batch == "aux_pao_occ");
1269+
bool const batch_pao =
1270+
(batch == "pao" || batch == "aux_pao" || batch == "aux_pao_occ");
1271+
bool const batch_occ = (batch == "aux_occ" || batch == "aux_pao_occ");
1272+
constexpr std::size_t kAuxBlock = 256, kOccBlock = 8, kPaoBlock = 256;
12671273

12681274
sequant::BatchPolicy policy;
1269-
policy.is_batchable_contracted_index = [batch_aux](sequant::Index const& ix) {
1270-
return batch_aux && ix.space().base_key() == L"Κ";
1275+
policy.is_batchable_contracted_index = [batch_aux,
1276+
batch_pao](sequant::Index const& ix) {
1277+
return (batch_aux && ix.space().base_key() == L"Κ") ||
1278+
(batch_pao && ix.space().base_key() == L"μ̃");
12711279
};
12721280
policy.is_batchable_external_index = [batch_occ](sequant::Index const& ix) {
12731281
return batch_occ && ix.space().base_key() == L"i";
12741282
};
12751283
policy.batch_spectator_indices = batch_occ;
12761284
policy.node_level_placement = batch_occ; // occ external placement needs it
1277-
policy.batch_target_size =
1278-
[batch_aux, batch_occ](sequant::Index const& ix) -> std::size_t {
1285+
policy.batch_target_size = [batch_aux, batch_pao, batch_occ](
1286+
sequant::Index const& ix) -> std::size_t {
12791287
if (batch_aux && ix.space().base_key() == L"Κ") return kAuxBlock;
1288+
if (batch_pao && ix.space().base_key() == L"μ̃") return kPaoBlock;
12801289
if (batch_occ && ix.space().base_key() == L"i") return kOccBlock;
12811290
return 1;
12821291
};
@@ -1348,16 +1357,15 @@ TEST_CASE(
13481357
// note still print.
13491358
std::optional<sequant::eval::OrderedSchedule> ordered_opt;
13501359
try {
1351-
if (batch_occ)
1352-
// Empty mode_order matches production (cck.ipp); base-key sort nests occ
1353-
// (i) outside Κ. (Non-innermost occ forced split is still unimplemented,
1354-
// so the ordered aux_occ build asserts -- caught gracefully below.)
1355-
ordered_opt =
1356-
sequant::eval::build_ordered_schedule(rich, legality, policy, {});
1357-
else if (batch_aux)
1360+
if (batch_aux && !batch_pao && !batch_occ)
1361+
// Pure aux: Κ is the sole (hence innermost) axis.
13581362
ordered_opt =
13591363
sequant::eval::build_ordered_schedule(rich, legality, policy, {L"Κ"});
13601364
else
1365+
// Empty mode_order matches production (cck.ipp); base-key sort nests the
1366+
// realized axes by base_key. Contracted axes (Κ, μ̃) nest cleanly; an
1367+
// external occ (i) nests OUTERMOST and forces a non-innermost split that
1368+
// is still unimplemented -- so any *_occ build asserts, caught below.
13611369
ordered_opt =
13621370
sequant::eval::build_ordered_schedule(rich, legality, policy, {});
13631371
} catch (std::exception const& e) {

0 commit comments

Comments
 (0)