Archive 4 checkpoints (1-4)
Browse files- paper-releases/pbisc-diffusion/updates/20261014T112200Z-strict-priority-score-join/diffusion/dataset/server_1/model8/plans/paper_figures_strictpairs_20261012/recoveries/priority_server2_20261014/PLAN.md +30 -0
- paper-releases/pbisc-diffusion/updates/20261014T112200Z-strict-priority-score-join/diffusion/dataset/server_1/model8/plans/paper_figures_strictpairs_20261012/recoveries/priority_server2_20261014/collect.py +101 -0
- paper-releases/pbisc-diffusion/updates/20261014T112200Z-strict-priority-score-join/diffusion/metadata/inference_locations.json +5 -0
- paper-releases/pbisc-diffusion/updates/20261014T112200Z-strict-priority-score-join/diffusion/metadata/request.json +19 -0
paper-releases/pbisc-diffusion/updates/20261014T112200Z-strict-priority-score-join/diffusion/dataset/server_1/model8/plans/paper_figures_strictpairs_20261012/recoveries/priority_server2_20261014/PLAN.md
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Server_2 strict comparator continuation with x4 priority
|
| 2 |
+
|
| 3 |
+
User authorization: transfer 17 unstarted units and reuse Imperial draw3 partial completion; x4 downstream has priority.
|
| 4 |
+
|
| 5 |
+
## Ownership and reuse
|
| 6 |
+
- units.json contains exactly18 disjoint units. Original local worker and original two-host supervisor stopped while waiting for GPU, not during scientific computation. x4 training remains running.
|
| 7 |
+
- Imperial draw3: PBISC adapter/lora/pairedcal complete; scSemi5/5 representatives trained and120/145 targets inferred. Probe verified all existing receipts and selected scinfer-120 as the first pending operation.
|
| 8 |
+
- 913 staged files matched SHA256. Original remote deconvolution/finalizer helpers were preserved because they differ but are not executed by this compute-only worker. Raw source receipts preserved on server_2; only output stat metadata normalized for transport.
|
| 9 |
+
- Remote worker runs compute only for18 units in list order. No other support/seed/hyperparameter changes. Collector transfers completed outputs, verifies SHA256, retains original completed receipts and CPU-scores on server_1.
|
| 10 |
+
|
| 11 |
+
## Priority
|
| 12 |
+
- No x4 controller/model/source files changed.
|
| 13 |
+
- At checkpoint_epoch_016.pt appearance on shared NAS, lower-priority work stops launching new operations, GPU and CPU alike. An already-running operation finishes normally; it is not killed or repeated. scSemi inference operates in8-target chunks; handoff is at the next boundary, not instantaneous preemption.
|
| 14 |
+
- Waiting occurs before acquiring ml-run/GPU lock. x4 may acquire both hosts normally.
|
| 15 |
+
- After HF_CORE_VERIFIED.json confirms x4 core computation and backup, collector's independent watcher writes a shared release marker and lower-priority work resumes. If x4 fails, lower-priority work remains waiting for inspection rather than guessing that priority is released.
|
| 16 |
+
- NAS absence fails closed. No automatic restart of failed jobs. The priority truth table was tested without launching experiments.
|
| 17 |
+
|
| 18 |
+
## Durable services
|
| 19 |
+
- server_2: pbisc-strict-priority-remote-20261014.service
|
| 20 |
+
- server_1: pbisc-strict-priority-collect-v2-20261014.service
|
| 21 |
+
- Original controller: pbisc-strict-two-host-controller-20261012.service (stopped)
|
| 22 |
+
- Original local worker: pbisc-strict-resume-20261012-local.service (stopped)
|
| 23 |
+
- Logs and priority/collection status in this directory on their corresponding host.
|
| 24 |
+
|
| 25 |
+
## Preservation
|
| 26 |
+
- No checkpoints or generated outputs deleted.
|
| 27 |
+
- Completed18-unit results trigger the normal versioned paper archive/HF publisher: PBISC LoRA checkpoints, core score tables/metadata and hashed inference locations. Manuscript/deck are not overwritten.
|
| 28 |
+
|
| 29 |
+
## Preserved CPU join
|
| 30 |
+
The previous12 server_2 units had completed compute/import but not central scoring. After the transferred18 units, the collector verifies their import receipts and scores their existing outputs without training/generation. This preserves the retired controller's pending CPU join. These12 were previously described too broadly as completed comparisons; only their compute was complete.
|
paper-releases/pbisc-diffusion/updates/20261014T112200Z-strict-priority-score-join/diffusion/dataset/server_1/model8/plans/paper_figures_strictpairs_20261012/recoveries/priority_server2_20261014/collect.py
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Collect completed remote units only, keep original receipts, then CPU-score and archive."""
|
| 2 |
+
from pathlib import Path
|
| 3 |
+
import sys,json,subprocess,shlex,threading,time,fcntl,hashlib,copy,os
|
| 4 |
+
R=Path(__file__).resolve().parent;S=R.parents[1];M=S.parents[1]
|
| 5 |
+
sys.path[:0]=[str(R),str(S/'tools')]
|
| 6 |
+
import campaign
|
| 7 |
+
from worker import LowPriorityRuntime,X
|
| 8 |
+
from runtime import atomic_json,sha256,stat_record,stamp
|
| 9 |
+
from two_host_resume import unit_support,validate_snapshot,verify_import
|
| 10 |
+
PY='/home/sj_server_2/miniforge3/envs/b2sc-infer/bin/python'
|
| 11 |
+
def remote(argv,**kw):return subprocess.run(['ssh','-o','BatchMode=yes','spark-0110',shlex.join(argv)],check=True,**kw)
|
| 12 |
+
def state(phase,**kw):atomic_json(R/'COLLECT_STATUS.json',{'phase':phase,'at':stamp(),**kw})
|
| 13 |
+
def release_watch():
|
| 14 |
+
while True:
|
| 15 |
+
p=X/'HF_CORE_VERIFIED.json'
|
| 16 |
+
if p.exists() and json.loads(p.read_text()).get('state')=='verified':
|
| 17 |
+
atomic_json(X/'payload/priority/LOW_PRIORITY_RELEASE.json',{'reason':'x4 core computation and HF backup verified','receipt':str(p),'sha256':sha256(p),'at':stamp()});return
|
| 18 |
+
time.sleep(30)
|
| 19 |
+
def collect(unit):
|
| 20 |
+
dest=R/'imported'/unit;dest.mkdir(parents=True,exist_ok=True)
|
| 21 |
+
done=dest/'IMPORTED.json'
|
| 22 |
+
if done.exists():return
|
| 23 |
+
snapshot=json.loads(remote([PY,str(S/'tools/two_host_resume.py'),'snapshot','--unit',unit],capture_output=True,text=True).stdout)
|
| 24 |
+
validate_snapshot(S,unit,snapshot)
|
| 25 |
+
atomic_json(dest/'snapshot.json',snapshot)
|
| 26 |
+
for row in snapshot['files']:
|
| 27 |
+
rel=Path(row['path']);target=dest/rel if rel.parts[0] in ['receipts','unit_status'] else S/rel
|
| 28 |
+
target.parent.mkdir(parents=True,exist_ok=True)
|
| 29 |
+
if target.exists() and sha256(target)!=row['sha256']:
|
| 30 |
+
# Only pre-existing mutable state/logs from the migrated partial unit may advance.
|
| 31 |
+
allowed=unit=='imperial_eskd-disease-draw3' and rel.parts[0] in ['scsemi','logs']
|
| 32 |
+
assert allowed,('unexpected conflicting artifact',target)
|
| 33 |
+
saved=dest/'before_import'/rel;saved.parent.mkdir(parents=True,exist_ok=True)
|
| 34 |
+
if not saved.exists():subprocess.run(['cp','-p',str(target),str(saved)],check=True)
|
| 35 |
+
subprocess.run(['rsync','-a','--protect-args','spark-0110:'+str(S/rel),str(target)],check=True)
|
| 36 |
+
assert target.stat().st_size==row['bytes'] and sha256(target)==row['sha256']
|
| 37 |
+
for raw in (dest/'receipts').glob('*.json'):
|
| 38 |
+
record=json.loads(raw.read_text());assert record['state']=='completed'
|
| 39 |
+
for out in record.get('outputs',[]):
|
| 40 |
+
f=Path(out['path']);assert sha256(f)==out['sha256'];out.update(stat_record(f))
|
| 41 |
+
original=S/'receipts'/raw.name
|
| 42 |
+
if original.exists():
|
| 43 |
+
old=json.loads(original.read_text());assert old['state']=='completed' and old['signature']==record['signature']
|
| 44 |
+
assert [o['sha256'] for o in old.get('outputs',[])]==[o['sha256'] for o in record.get('outputs',[])]
|
| 45 |
+
# Original source receipt remains unchanged; rsync preserved timestamps of immutable outputs.
|
| 46 |
+
for o in old.get('outputs',[]):assert stat_record(Path(o['path']))=={k:o[k] for k in ['path','bytes','mtime_ns']}
|
| 47 |
+
else:
|
| 48 |
+
record['remote_provenance']={'host':'server_2','raw_receipt':str(raw),'sha256':sha256(raw)};atomic_json(original,record)
|
| 49 |
+
atomic_json(done,{'state':'verified','unit':unit,'snapshot_sha256':sha256(dest/'snapshot.json'),'at':stamp()})
|
| 50 |
+
def main():
|
| 51 |
+
threading.Thread(target=release_watch,daemon=True).start()
|
| 52 |
+
units=json.loads((R/'units.json').read_text());rt=LowPriorityRuntime(S)
|
| 53 |
+
with (S/'.campaign.lock').open('a') as lock:
|
| 54 |
+
fcntl.flock(lock,fcntl.LOCK_EX|fcntl.LOCK_NB)
|
| 55 |
+
for unit in units:
|
| 56 |
+
state('waiting_remote',unit=unit)
|
| 57 |
+
while True:
|
| 58 |
+
code='import pathlib,json,sys; p=pathlib.Path(sys.argv[1]); print(p.read_text() if p.exists() else "null")'
|
| 59 |
+
marker=json.loads(remote(['python3','-c',code,str(S/'unit_status'/f'{unit}.json')],capture_output=True,text=True).stdout)
|
| 60 |
+
if marker and marker.get('state')=='completed' and marker.get('stage')=='compute':break
|
| 61 |
+
props=remote(['/usr/bin/env','XDG_RUNTIME_DIR=/run/user/1000','DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus','systemctl','--user','show','pbisc-strict-priority-remote-20261014.service','-p','ActiveState','-p','SubState'],capture_output=True,text=True).stdout
|
| 62 |
+
if 'ActiveState=failed' in props or 'ActiveState=inactive' in props:raise RuntimeError('Remote worker stopped before unit completion: '+props)
|
| 63 |
+
time.sleep(30)
|
| 64 |
+
state('collecting',unit=unit);collect(unit)
|
| 65 |
+
path,_,manifest=unit_support(S,unit)
|
| 66 |
+
state('scoring',unit=unit);campaign.run_score(rt,path)
|
| 67 |
+
atomic_json(S/'unit_status'/f'{unit}.json',{'state':'completed','stage':'all','support_sha256':manifest['sha256'],'at':stamp(),'source':'priority server2 migration'})
|
| 68 |
+
state('unit_completed',unit=unit)
|
| 69 |
+
state('all_18_completed',units=units)
|
| 70 |
+
# The retired controller also owned this CPU-only join. Preserve it without any new GPU work.
|
| 71 |
+
prior=json.loads((S/'recoveries/two_host/config.json').read_text())['remote_units']
|
| 72 |
+
for unit in prior:
|
| 73 |
+
verify_import(S,unit,S/'recoveries/two_host/imported'/unit)
|
| 74 |
+
path,_,manifest=unit_support(S,unit)
|
| 75 |
+
state('scoring_previously_generated',unit=unit);campaign.run_score(rt,path)
|
| 76 |
+
atomic_json(S/'unit_status'/f'{unit}.json',{'state':'completed','stage':'all','support_sha256':manifest['sha256'],'at':stamp(),'source':'CPU-only join of previously imported generation'})
|
| 77 |
+
units=units+prior
|
| 78 |
+
state('transferred_and_existing_scores_complete',units=units)
|
| 79 |
+
assets=[];locations=[]
|
| 80 |
+
for unit in units:
|
| 81 |
+
path,rel,_=unit_support(S,unit)
|
| 82 |
+
assets.extend([{'host':'server_1','source':str(path),'kind':'metadata','state':'completed'},
|
| 83 |
+
{'host':'server_1','source':str(S/'runs'/rel/'lora/checkpoint_ft.pt'),'kind':'checkpoint','state':'completed'}])
|
| 84 |
+
for f in (S/'scores'/rel).rglob('*'):
|
| 85 |
+
if f.is_file() and f.suffix in ['.json','.csv'] and f.stat().st_size<4*2**20:
|
| 86 |
+
assets.append({'host':'server_1','source':str(f),'kind':'report' if f.suffix=='.json' else 'table','state':'completed'})
|
| 87 |
+
for f in (S/'generated'/rel).glob('*.npz'):
|
| 88 |
+
locations.append({'host':'server_1','path':str(f),'state':'completed','sha256':sha256(f),'reason':'Completed transferred strict-pair comparator output; source server_2 and imported receipts retained.'})
|
| 89 |
+
request={'project_id':'pbisc-diffusion','summary':'Completed18 transferred strict-pair units plus CPU-only evaluation of12 previously generated/imported units; Imperial draw3 first120 targets reused; x4 priority preserved.','assets':assets,'inference_locations':locations}
|
| 90 |
+
atomic_json(R/'FINAL_ARCHIVE_REQUEST.json',request)
|
| 91 |
+
from datetime import datetime,timezone
|
| 92 |
+
ident=datetime.now(timezone.utc).strftime('%Y%m%dT%H%M%SZ')+'-strict-priority-results'
|
| 93 |
+
release=M.parents[1]/'paper-release-20260928';cli=release/'maintenance/update.py'
|
| 94 |
+
with (R/'final_archive.log').open('x') as log:
|
| 95 |
+
for args in [['prepare','--request',str(R/'FINAL_ARCHIVE_REQUEST.json'),'--id',ident],['publish',ident,'--execute']]:
|
| 96 |
+
subprocess.run(['/home/sj_server_1/miniforge3/bin/python',str(cli),*args],check=True,stdout=log,stderr=subprocess.STDOUT)
|
| 97 |
+
receipt=release/'maintenance/updates'/ident/'UPDATE_VERIFIED.json';assert json.loads(receipt.read_text())['status']=='PASS'
|
| 98 |
+
state('complete_and_archived',units=units,archive_id=ident,receipt=str(receipt))
|
| 99 |
+
if __name__=='__main__':
|
| 100 |
+
try:main()
|
| 101 |
+
except BaseException as e:state('stopped_needs_inspection',error=str(e));raise
|
paper-releases/pbisc-diffusion/updates/20261014T112200Z-strict-priority-score-join/diffusion/metadata/inference_locations.json
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"locations": [],
|
| 3 |
+
"project_id": "pbisc-diffusion",
|
| 4 |
+
"update_id": "20261014T112200Z-strict-priority-score-join"
|
| 5 |
+
}
|
paper-releases/pbisc-diffusion/updates/20261014T112200Z-strict-priority-score-join/diffusion/metadata/request.json
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"assets": [
|
| 3 |
+
{
|
| 4 |
+
"host": "server_1",
|
| 5 |
+
"kind": "code",
|
| 6 |
+
"source": "/home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paper_figures_strictpairs_20261012/recoveries/priority_server2_20261014/collect.py",
|
| 7 |
+
"state": "completed"
|
| 8 |
+
},
|
| 9 |
+
{
|
| 10 |
+
"host": "server_1",
|
| 11 |
+
"kind": "report",
|
| 12 |
+
"source": "/home/sj_server_1/PBISC/immun-pbmc-fm/model_8_sparse_data_diffusion/plans/paper_figures_strictpairs_20261012/recoveries/priority_server2_20261014/PLAN.md",
|
| 13 |
+
"state": "completed"
|
| 14 |
+
}
|
| 15 |
+
],
|
| 16 |
+
"inference_locations": [],
|
| 17 |
+
"project_id": "pbisc-diffusion",
|
| 18 |
+
"summary": "Preserve retired strict controller CPU-only scoring join for12 previously generated units after18 transferred computations; no additional model training or generation; same x4 priority gate."
|
| 19 |
+
}
|