Fix seed1 dispatch to select actually idle eligible GPUs before assignment

This commit is contained in:
MeltAstra committed 2026-11-18 14:38:42 +08:00
1 parent c0f89a5e95
commit 8c5020c5cb
27 files changed
+4310 -27

No files matched your search

+7 -3
View File
@@ -12,7 +12,7 @@ from phase2_gate_outcome_review import validate_review
from phase2_h1_worker_v2 import checked, save, sha
from phase2_home_freeze_io import freeze
from s2_recovery_gpu_supervisor import disk_usage, tree_usage
from phase3_seed1_common import config, dispatchable, execution_command, project_cell, project_total, read, available_gpus
from phase3_seed1_common import config, dispatchable, execution_command, project_cell, project_total, read, available_gpus, idle_eligible_gpus
def run(root):
@@ -83,13 +83,17 @@ def run(root):
return True
def dispatch():
for j in dispatchable(pending, [v['job'] for v in active.values()], available_gpus(c)):
eligible=available_gpus(c)-{v['job']['gpu_uuid'] for v in active.values()}
idle,observations=idle_eligible_gpus(eligible)
observed_unix=time.time()
save(root/'dispatch-idle-observation.json',dict(unix=observed_unix,eligible=sorted(eligible),observations=observations))
for j in dispatchable(pending, [v['job'] for v in active.values()], idle):
i = j['id']
d = root / 'jobs' / str(i)
d.mkdir(parents=True, exist_ok=False)
log = (d / 'entry.log').open('x')
begin = time.monotonic()
save(d / 'assignment.json', dict(id=i, gpu_uuid=j['gpu_uuid'], contract_sha256=sha(root/'contract.json'), unix=time.time(), release_evidence=sorted(available_gpus(c))))
save(d / 'assignment.json', dict(id=i, gpu_uuid=j['gpu_uuid'], contract_sha256=sha(root/'contract.json'), unix=time.time(), release_evidence=sorted(eligible), idle_observations=observations, idle_observed_unix=observed_unix))
cmd = [sys.executable, 'tools/phase3_seed1_guard.py', str(root), str(i), sha(d/'assignment.json')]
try:
p = subprocess.Popen(cmd, stdout=log, stderr=subprocess.STDOUT, start_new_session=True)