Balanced generation under the pipeline, per-kind brake; STATE: type mix fix

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Kral
2026-10-05 19:27:43 +02:00
parent 55f4068330
commit 976274d48a
3 changed files with 42 additions and 8 deletions

View File

@@ -221,7 +221,7 @@ class Pipeline:
def old_generators(self):
out = subprocess.run(["pgrep", "-fl", r"harness\.trainset run --part"], capture_output=True, text=True).stdout
return [l for l in out.splitlines() if "--plan plan2" not in l]
return [l for l in out.splitlines() if "--plan balanced" not in l and "--plan plan2" not in l]
def supervisor(self):
launched = False
@@ -232,15 +232,14 @@ class Pipeline:
if time.time() > self.gen_deadline or os.path.exists(trainset.STOP_FLAG):
continue
if not launched and not self.old_generators():
trainset.ensure_plan("plan2")
dl = self.a.gen_deadline
for i in range(3):
f = open(os.path.join(ROOT, "runs", "gen_train", f"p2_w{i}.log"), "a")
self.children.append(subprocess.Popen(
[sys.executable, "-m", "harness.trainset", "run", "--plan", "plan2", "--part", str(i),
[sys.executable, "-m", "harness.trainset", "run", "--plan", "balanced", "--part", str(i),
"--parts", "3", "--deadline", dl], cwd=ROOT, stdout=f, stderr=f))
launched = True
log("plan 2 generators started (3 workers, deadline", dl + ")")
log("balanced generators started (3 workers, deadline", dl + ")")
elif launched:
for i, c in enumerate(self.children):
if c.poll() not in (None, 0) and crashes < 3:
@@ -248,7 +247,7 @@ class Pipeline:
log("generator", i, "exited with", c.returncode, "- restarted")
f = open(os.path.join(ROOT, "runs", "gen_train", f"p2_w{i}.log"), "a")
self.children[i] = subprocess.Popen(
[sys.executable, "-m", "harness.trainset", "run", "--plan", "plan2", "--part", str(i),
[sys.executable, "-m", "harness.trainset", "run", "--plan", "balanced", "--part", str(i),
"--parts", "3", "--deadline", self.a.gen_deadline], cwd=ROOT, stdout=f, stderr=f)
# K variants: free text, about 10 % of the other accepted training tasks
if k_proc is None or k_proc.poll() is not None: