DFlash2 batch slot drafts: on by default only on a layer split (the measured case), one card stays opt-in

This commit is contained in:
Niko1221 committed 2026-11-02 09:50:35 +01:00
1 parent d292672844
commit 3e7b8343b2
1 file changed
+3 -2
+3 -2
View File
@@ -6367,14 +6367,15 @@ int main(int argc, char** argv) {
// spare, and a round with no spare row does no drafter work (the committed rows wait on the host and are replayed when spare rows return). Measured on 2x
// A6000 (RESULTS-DF2MGPU.md section 3): +25% / +9% over no drafts at 2 / 3 active slots, level at 4, within 1.5% at 8 and with users joining and leaving.
// They run through the serial windows (one group); a layer split whose slots would be pipelined in groups by default keeps its groups and its undrafted
// slots (the pipelined groups carry no drafts), and so does an explicit --batch-groups above 1.
// slots (the pipelined groups carry no drafts), and so does an explicit --batch-groups above 1. One card: opt-in only (STRATA_BATCH_DF2=1).
const bool batch_df2_wanted = [&] {
const char* e = std::getenv("STRATA_BATCH_DF2");
const bool off = e != nullptr && e[0] == '0';
const bool forced = e != nullptr && e[0] != '0' && e[0] != '\0';
if (off || !(o.draft == "dflash2" && !o.draft_auto && o.batch >= 2 && o.serve && !split_same)) return false;
if (forced) return true;
return batch_groups_for(false).groups <= 1;
// the default is what was measured: a layer split (2x A6000) whose slots would run as one group; one card is opt-in (STRATA_BATCH_DF2=1) until it is measured
return !stages.empty() && batch_groups_for(false).groups <= 1;
}();
const char* batch_mtp_env = std::getenv("STRATA_BATCH_MTP");
bool batch_mtp = o.batch_mtp || (batch_mtp_env != nullptr && batch_mtp_env[0] != '\0' && batch_mtp_env[0] != '0') || batch_df2_wanted;