Merge branch 'f-021-split' into f-021-int

This commit is contained in:
Niko1221 committed 2026-10-20 00:19:12 +02:00
commit e45a9bfd3a
4 files changed
+33 -4

No files matched your search

+19
View File
@@ -78,6 +78,25 @@ int main() {
const auto r = bg::resolve(i);
check(r.groups == 1 && r.serial == bg::Serial::None && r.would_be == 1, "auto would be 1 group anyway: no reason");
}
{ // PROPOSED NVIDIA default: two cards, nothing given: serial windows (measured +12..16% on 2x A4000)
bg::Input i = in(4, 1);
i.nv_serial_faster = true;
auto r = bg::resolve(i);
check(r.groups == 1 && r.from_auto && r.serial == bg::Serial::TwoCardsSerialFaster && r.would_be == 2,
"nv_serial_faster, 2 cards, 4 slots, nothing given: one group, named");
check(bg::serial_what(r.serial)[0] == 's', "the reason names the measurement");
check(bg::resolve(in(4, 1)).groups == 2, "flag off: the pipeline default stays");
i = in(8, 1); i.nv_serial_faster = true; // measured too: +15%
check(bg::resolve(i).groups == 1, "8 slots (measured +15%): serial too");
i = in(4, 3); i.nv_serial_faster = true;
check(bg::resolve(i).groups == 4, "4 cards (not measured): the pipeline stays");
i = in(4, 1); i.nv_serial_faster = true; i.batch_mtp = true;
check(bg::resolve(i).groups == 2 && bg::resolve(i).mtp_dropped, "with --batch-mtp the 0.1.43.1 rule is unchanged");
i = in(4, 1); i.nv_serial_faster = true; i.set = true; i.auto_given = true;
check(bg::resolve(i).groups == 2, "--batch-groups auto given: the pipeline");
i.auto_given = false; i.given = 2;
check(bg::resolve(i).groups == 2, "--batch-groups 2 given: 2");
}
{ // explicit values are honoured
bg::Input i = in(4, 1);
i.set = true;
+8 -1
View File
@@ -5131,6 +5131,9 @@ int main(int argc, char** argv) {
bin.batch_mtp = mtp_on;
bin.adapt_async = o.adapt_async != 0;
{ const char* ms = std::getenv("STRATA_BATCH_MTP_SERIAL"); bin.mtp_serial = ms != nullptr && ms[0] != '\0' && ms[0] != '0'; }
#if !defined(STRATA_USE_HIP)
{ const char* nv = std::getenv("STRATA_BATCH_GROUPS_NV_SERIAL"); bin.nv_serial_faster = nv == nullptr || nv[0] != '0'; } // PROPOSED 0.2.1 default (NVIDIA, 2 cards)
#endif
return strata::program::batch_groups::resolve(bin);
};
const char* batch_mtp_env = std::getenv("STRATA_BATCH_MTP");
@@ -5202,7 +5205,11 @@ int main(int argc, char** argv) {
o.batch_groups = r.groups;
if (groups_said == r.groups) return; // (the second call, once the slots that fit are known, says nothing new)
groups_said = r.groups;
if (r.serial != strata::program::batch_groups::Serial::None)
if (r.serial == strata::program::batch_groups::Serial::TwoCardsSerialFaster)
std::fprintf(stderr, "strata generate: --batch-groups auto: 1 group of %d slot%s - %s; --batch-groups %d asks for the "
"pipelined groups\n", o.batch, o.batch == 1 ? "" : "s",
strata::program::batch_groups::serial_what(r.serial), r.would_be);
else if (r.serial != strata::program::batch_groups::Serial::None)
std::fprintf(stderr, "strata generate: --batch-groups auto: 1 group of %d slot%s - %s does not run in pipelined "
"groups; --batch-groups %d would pipeline them and turn it off\n", o.batch,
o.batch == 1 ? "" : "s", strata::program::batch_groups::serial_what(r.serial), r.would_be);