Archive 4 checkpoints (1-4)
Browse files- .gitattributes +1 -0
- paper-releases/pbisc-diffusion/updates/20261013T144247Z-f01-trunk4x-campaign-launch/diffusion/dataset/server_1/model8/plans/f01_trunk4x_complete_20261013/runtime/sshfs +3 -0
- paper-releases/pbisc-diffusion/updates/20261013T144247Z-f01-trunk4x-campaign-launch/diffusion/dataset/server_1/model8/plans/f01_trunk4x_complete_20261013/task_plan.md +14 -0
- paper-releases/pbisc-diffusion/updates/20261013T144247Z-f01-trunk4x-campaign-launch/diffusion/dataset/server_1/model8/plans/f01_trunk4x_complete_20261013/tools/archive_completed.py +47 -0
- paper-releases/pbisc-diffusion/updates/20261013T144247Z-f01-trunk4x-campaign-launch/diffusion/dataset/server_1/model8/plans/f01_trunk4x_complete_20261013/tools/build_matrix.py +49 -0
.gitattributes
CHANGED
|
@@ -260,3 +260,4 @@ paper-releases/pbisc-diffusion/updates/20261013T094815Z-all-celltypes-final-pale
|
|
| 260 |
paper-releases/pbisc-diffusion/updates/20261013T094815Z-all-celltypes-final-palette-142/diffusion/dataset/server_1/model8/presentations/2026-09-30--paper-summary--r00/figures/final_palette_20261013/native/gene_length_input.pdf filter=lfs diff=lfs merge=lfs -text
|
| 261 |
paper-releases/pbisc-diffusion/updates/20261013T115045Z-figure-strengthening-154/diffusion/dataset/server_1/model8/presentations/2026-09-30--paper-summary--r00/PBISC-Diffusion_expanded_master_20261013_strengthened.pdf filter=lfs diff=lfs merge=lfs -text
|
| 262 |
paper-releases/pbisc-diffusion/updates/20261013T115045Z-figure-strengthening-154/diffusion/dataset/server_1/model8/presentations/2026-09-30--paper-summary--r00/PBISC-Diffusion_expanded_master_20261013_strengthened.pptx filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 260 |
paper-releases/pbisc-diffusion/updates/20261013T094815Z-all-celltypes-final-palette-142/diffusion/dataset/server_1/model8/presentations/2026-09-30--paper-summary--r00/figures/final_palette_20261013/native/gene_length_input.pdf filter=lfs diff=lfs merge=lfs -text
|
| 261 |
paper-releases/pbisc-diffusion/updates/20261013T115045Z-figure-strengthening-154/diffusion/dataset/server_1/model8/presentations/2026-09-30--paper-summary--r00/PBISC-Diffusion_expanded_master_20261013_strengthened.pdf filter=lfs diff=lfs merge=lfs -text
|
| 262 |
paper-releases/pbisc-diffusion/updates/20261013T115045Z-figure-strengthening-154/diffusion/dataset/server_1/model8/presentations/2026-09-30--paper-summary--r00/PBISC-Diffusion_expanded_master_20261013_strengthened.pptx filter=lfs diff=lfs merge=lfs -text
|
| 263 |
+
paper-releases/pbisc-diffusion/updates/20261013T144247Z-f01-trunk4x-campaign-launch/diffusion/dataset/server_1/model8/plans/f01_trunk4x_complete_20261013/runtime/sshfs filter=lfs diff=lfs merge=lfs -text
|
paper-releases/pbisc-diffusion/updates/20261013T144247Z-f01-trunk4x-campaign-launch/diffusion/dataset/server_1/model8/plans/f01_trunk4x_complete_20261013/runtime/sshfs
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d42d5b5dc641c15ed40c8ea8148ff18d53d8e7c53b4034a366ce4ae4b2da30ef
|
| 3 |
+
size 135736
|
paper-releases/pbisc-diffusion/updates/20261013T144247Z-f01-trunk4x-campaign-launch/diffusion/dataset/server_1/model8/plans/f01_trunk4x_complete_20261013/task_plan.md
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Exact f01 6k trunk×4 campaign
|
| 2 |
+
|
| 3 |
+
User request: pretrain trunk×4 with the paper's current×1 checkpoint's exact6k gene context, then prepare the paper comparisons; prefer server_2, fallback server_1 if busy.
|
| 4 |
+
|
| 5 |
+
- [x] Inspect both hosts: both busy; select server_1 with exclusive-lock queue, preserve existing jobs.
|
| 6 |
+
- [x] Freeze baseline config/data/code and prove only trunk architecture changes scientifically.
|
| 7 |
+
- [x] Define full experiment matrix, dependencies, reuse and missing-evidence gates.
|
| 8 |
+
- [x] Implement pretraining launcher and automatic continuation into matched downstream work.
|
| 9 |
+
- [x] Run CPU contract checks and launch durable guarded queue.
|
| 10 |
+
- [ ] Archive plan/code/launch evidence with truthful running/queued state.
|
| 11 |
+
|
| 12 |
+
Not an early claim of completed training. Do not substitute the legacy-panel trunk checkpoint, shrink the gene panel, or rerun unchanged baselines.
|
| 13 |
+
|
| 14 |
+
Current:128-step GPU profile passed; full pretraining started on server_1. Results pending. First launch stopped at environment gate before CUDA; logs preserved and explicit env corrected.
|
paper-releases/pbisc-diffusion/updates/20261013T144247Z-f01-trunk4x-campaign-launch/diffusion/dataset/server_1/model8/plans/f01_trunk4x_complete_20261013/tools/archive_completed.py
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Task-end paper archive, exact completed outputs only; large cell arrays as locators."""
|
| 2 |
+
from pathlib import Path
|
| 3 |
+
from datetime import datetime,timezone
|
| 4 |
+
import json,subprocess,sys
|
| 5 |
+
P=Path(__file__).resolve().parents[1];M=P.parents[1];RELEASE=M.parents[1]/'paper-release-20260928';CLI=RELEASE/'maintenance/update.py'
|
| 6 |
+
result=json.loads((P/'RESULTS_STATUS.json').read_text());assert result['phase']=='data_complete_with_review_gates'
|
| 7 |
+
assets=[];locations=[];seen=set();loc_seen=set()
|
| 8 |
+
def add(path,kind):
|
| 9 |
+
p=path.resolve()
|
| 10 |
+
if str(p) not in seen:assets.append({'host':'server_1','source':str(p),'kind':kind,'state':'completed'});seen.add(str(p))
|
| 11 |
+
parent=json.loads((P/'PRETRAIN_VERIFIED.json').read_text());add(Path(parent['checkpoint']),'checkpoint')
|
| 12 |
+
for p in [P/'PRETRAIN_VERIFIED.json',P/'RESULTS_STATUS.json',P/'PENDING_EVIDENCE.json',P/'MATRIX.json',P/'CONTRACT.json']:
|
| 13 |
+
add(p,'report')
|
| 14 |
+
for p in (P/'comparison').glob('*'):
|
| 15 |
+
if p.is_file():add(p,'figure' if p.suffix in ['.png','.pdf','.svg'] else 'table')
|
| 16 |
+
for j in json.loads((P/'MATRIX.json').read_text())['paired_jobs']:
|
| 17 |
+
out=Path(j['output'])
|
| 18 |
+
if not j.get('adapter_alias'):
|
| 19 |
+
add(out/'run/checkpoint_ft.pt','checkpoint');add(out/'run/RUN.json','report')
|
| 20 |
+
for p in (out/'input').glob('**/ISOLATION.json'):add(p,'report')
|
| 21 |
+
for p in (out/'evaluation').glob('**/*.json'):
|
| 22 |
+
if '/labels/' not in str(p):add(p,'report')
|
| 23 |
+
for p in (out/'evaluation').glob('**/*.csv'):
|
| 24 |
+
if p.stat().st_size<4*2**20:add(p,'table')
|
| 25 |
+
for p in (P/'payload').glob('**/*.npz'):
|
| 26 |
+
if p.with_suffix('.log').is_file():
|
| 27 |
+
r=json.loads(p.with_suffix('.log').read_text())
|
| 28 |
+
if r.get('output_sha256') and str(p.resolve()) not in loc_seen:
|
| 29 |
+
loc_seen.add(str(p.resolve()));locations.append({'host':'server_1','path':str(p.resolve()),'state':'completed','receipt':str(p.with_suffix('.log').resolve()),'sha256':r['output_sha256'],'reason':'Completed exact-f01-panel trunkx4 generation; preserved on verified NAS mount. Aliases are not independent experiments.'})
|
| 30 |
+
# Keep all16 pretraining snapshots on NAS; publish the fixed E16 model and adaptation models.
|
| 31 |
+
# Other epoch checkpoints are recorded, not silently deleted to reduce storage.
|
| 32 |
+
pre=Path(parent['checkpoint']).parent
|
| 33 |
+
snapshot={'epoch_checkpoints':[str(p) for p in sorted(pre.glob('checkpoint_epoch_*.pt'))],'retained_on_NAS':True,'selected_for_model_publication':parent['checkpoint']}
|
| 34 |
+
(P/'PRETRAIN_SNAPSHOT_LOCATIONS.json').write_text(json.dumps(snapshot,indent=2)+'\n');add(P/'PRETRAIN_SNAPSHOT_LOCATIONS.json','report')
|
| 35 |
+
request={'project_id':'pbisc-diffusion','summary':'Exact current f01 6k-panel trunkx4 pretraining and matched downstream data. Biological population identity/clinical reproduction gates remain explicitly pending where documented.','assets':assets,'inference_locations':locations}
|
| 36 |
+
path=P/'FINAL_ARCHIVE_REQUEST.json';path.write_text(json.dumps(request,indent=2)+'\n');ident=datetime.now(timezone.utc).strftime('%Y%m%dT%H%M%SZ')+'-f01-trunk4x-data'
|
| 37 |
+
need=sum(Path(x['source']).stat().st_size for x in assets)
|
| 38 |
+
free=int(subprocess.check_output(['ssh','spark-0110',"python3 -c 'import shutil;print(shutil.disk_usage(\"/home/sj_server_2/PBISC/paper-release-20260928\").free)'"],text=True))
|
| 39 |
+
if free<need+32*2**30:
|
| 40 |
+
(P/'FINAL_ARCHIVE.json').write_text(json.dumps({'state':'pending_capacity','needed_bytes':need,'archive_free_bytes':free,'all_outputs_preserved_on_NAS':True},indent=2)+'\n');raise SystemExit('Archive capacity gate: no originals deleted; inspect storage routing')
|
| 41 |
+
with (P/'final_archive.log').open('x') as log:
|
| 42 |
+
subprocess.run([sys.executable,str(CLI),'prepare','--request',str(path),'--id',ident],check=True,stdout=log,stderr=subprocess.STDOUT)
|
| 43 |
+
manifest=json.loads((RELEASE/'maintenance/updates'/ident/'manifest.json').read_text());assert {(x['host'],x['source']) for x in manifest['assets'] if x['category']!='update_metadata'} <= {(x['host'],x['source']) for x in assets}
|
| 44 |
+
subprocess.run([sys.executable,str(CLI),'publish',ident,'--execute'],check=True,stdout=log,stderr=subprocess.STDOUT)
|
| 45 |
+
receipt=RELEASE/'maintenance/updates'/ident/'UPDATE_VERIFIED.json';assert json.loads(receipt.read_text())['status']=='PASS'
|
| 46 |
+
assert json.loads((RELEASE/'LATEST.json').read_text())['id']==ident and json.loads((RELEASE/'CURRENT_CATALOG.json').read_text())['latest_id']==ident
|
| 47 |
+
(P/'FINAL_ARCHIVE.json').write_text(json.dumps({'state':'verified','id':ident,'receipt':str(receipt),'data_readiness':result['phase']},indent=2)+'\n')
|
paper-releases/pbisc-diffusion/updates/20261013T144247Z-f01-trunk4x-campaign-launch/diffusion/dataset/server_1/model8/plans/f01_trunk4x_complete_20261013/tools/build_matrix.py
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Freeze paired adaptation matrix from actual current-paper run records."""
|
| 2 |
+
from pathlib import Path
|
| 3 |
+
import json,hashlib,subprocess,shlex
|
| 4 |
+
import pandas as pd
|
| 5 |
+
P=Path(__file__).resolve().parents[1];M=P.parents[1];F=M/'plans/paired_finetune_intradataset_20260927';S=M/'plans/paper_figures_strictpairs_20261012'
|
| 6 |
+
COHORTS=['immicro','ye2026_sepsis','imperial_eskd','giroux2022','ji2025_chili']
|
| 7 |
+
def sha(p):
|
| 8 |
+
with Path(p).open('rb') as f:return hashlib.file_digest(f,'sha256').hexdigest()
|
| 9 |
+
def read_run(path):
|
| 10 |
+
if path.is_file():raw=path.read_text();host='server_1'
|
| 11 |
+
else:raw=subprocess.check_output(['ssh','spark-0110','cat '+shlex.quote(str(path))],text=True);host='server_2'
|
| 12 |
+
r=json.loads(raw);assert r['source_checkpoint_sha256']=='8c7cd0e83e2bc19fe03dfcbc084919a1e2f61be8cc8bc12f4caf543dfda91633'
|
| 13 |
+
dest=P/'baseline_records'/path.relative_to(F/'runs');dest.parent.mkdir(parents=True,exist_ok=True);dest.write_text(raw)
|
| 14 |
+
return r,{'host':host,'path':str(path),'snapshot':str(dest),'sha256':sha(dest)}
|
| 15 |
+
def main():
|
| 16 |
+
jobs=[];baseline_records=[]
|
| 17 |
+
for support_path in sorted((S/'protocol/splits').glob('**/support.json')):
|
| 18 |
+
s=json.loads(support_path.read_text());rel=str(support_path.parent.relative_to(S/'protocol/splits'));name='strict/'+rel
|
| 19 |
+
jobs.append({'id':name,'family':'strict','cohort':s['cohort'],'support_path':str(support_path),'support_sha256':s['sha256'],'train_samples':s['train_sample_ids'],'validation_samples':[],'test_samples':s['test_sample_ids'],'train_donors':s['train_donor_ids'],'test_donors':s['test_donor_ids'],'condition':str(F/f"data/{s['cohort']}/conditions_raw_fixed.npz"),'test_condition':str(S/'data'/rel/'test_raw.npz'),'cal_condition':str(S/'data'/rel/'test_cal.npz'),'mode':'lora','rank':16,'alpha':16.,'lr':.0005,'warmup':200,'batch_size':256,'ema_decay':.999,'fixed_steps':3000,'seed':20260927,'sampling_seed':20260928,'baseline_score':str(S/'scores'/rel/'score/summary.json'),'baseline_generated':str(S/'generated'/rel/'lora.npz'),'scsemi_generated':str(S/'generated'/rel/'scsemi.npz')})
|
| 20 |
+
for cohort in COHORTS:
|
| 21 |
+
for fold in range(5):
|
| 22 |
+
for arm in (['real_lora','lora_r4','lora_r64','real_full'] if cohort=='immicro' else ['real_lora']):
|
| 23 |
+
path=F/f'runs/{cohort}/fold{fold}/{arm}/RUN.json';r,source=read_run(path);baseline_records.append(source)
|
| 24 |
+
job={'id':f'cv/{cohort}/{arm}/fold{fold}','family':'cv','cohort':cohort,'fold':fold,'old_arm':arm,'source_run':source,'train_samples':r['train_rows'],'validation_samples':r['inner_val_rows'],'test_samples':r['test_rows_never_loaded_for_training'],'condition':r['condition_npz'],'test_condition':str(F/f'data/{cohort}/fold{fold}/test_raw.npz'),'mode':r['mode'],'rank':r['trainable'].get('lora_rank',16),'alpha':r['trainable'].get('lora_alpha',16.),'lr':r['lr'],'warmup':r['warmup'],'batch_size':r['batch_size'],'ema_decay':r['ema_decay'],'fixed_steps':0,'seed':r['seed'],'max_steps':r['max_steps'],'eval_every':r['eval_every'],'patience':r['patience'],'sampling_seed':20260927}
|
| 25 |
+
# Read actual sampling seed when a receipt is locally available; otherwise the historical queue contract applies.
|
| 26 |
+
for candidate in [F/f'generated/{cohort}/fold{fold}/{arm}__raw.log']:
|
| 27 |
+
if candidate.is_file():job['sampling_seed']=json.loads(candidate.read_text())['seed']
|
| 28 |
+
jobs.append(job)
|
| 29 |
+
for draw in range(5):
|
| 30 |
+
path=F/f'runs/{cohort}/fewshot_n5/draw{draw}/lora/RUN.json';r,source=read_run(path);baseline_records.append(source)
|
| 31 |
+
alias=None
|
| 32 |
+
for x in jobs:
|
| 33 |
+
if x['family']=='strict' and x['cohort']==cohort and set(x['train_samples'])==set(r['train_rows']) and set(x['test_samples'])==set(r['test_rows_never_loaded_for_training']) and not r['inner_val_rows'] and r['fixed_steps']==3000:alias=x['id'];break
|
| 34 |
+
folds=pd.read_csv(F/f'data/{cohort}/folds.csv');lookup=folds.set_index('sample_id').donor_id.to_dict()
|
| 35 |
+
jobs.append({'id':f'legacy5/{cohort}/draw{draw}','family':'legacy5','cohort':cohort,'draw':draw,'source_run':source,'adapter_alias':alias,'train_samples':r['train_rows'],'train_donors':sorted({lookup[x] for x in r['train_rows']}),'validation_samples':[],'test_samples':r['test_rows_never_loaded_for_training'],'condition':r['condition_npz'],'test_condition':str(F/f'data/{cohort}/fewshot_n5/draw{draw}/test_raw.npz'),'mode':'lora','rank':16,'alpha':16.,'lr':r['lr'],'warmup':r['warmup'],'batch_size':r['batch_size'],'ema_decay':r['ema_decay'],'fixed_steps':3000,'seed':r['seed'],'sampling_seed':20260928,'baseline_score':str(F/f'scores/{cohort}/fewshot_n5/draw{draw}/summary.json')})
|
| 36 |
+
for job in jobs:
|
| 37 |
+
assert not set(job['train_samples'])&set(job['test_samples'])
|
| 38 |
+
assert not set(job['validation_samples'])&set(job['test_samples'])
|
| 39 |
+
for k in ['condition','test_condition']:
|
| 40 |
+
assert Path(job[k]).is_file(),job[k]
|
| 41 |
+
job[k+'_sha256']=sha(job[k])
|
| 42 |
+
job['output']=str(P/'payload/paired'/job['id'])
|
| 43 |
+
slereceipts=[]
|
| 44 |
+
for i in range(5):
|
| 45 |
+
tag='f016k_e16' if i==0 else f'f016ks{i}_e16';p=M/f'analysis/floor01_benchmark_20260923/generated_{tag}.log';r=json.loads(p.read_text());slereceipts.append({'seed':r['seed'],'baseline_receipt':str(p),'baseline_generated':str(p.with_suffix('.npz')),'seed_index':i})
|
| 46 |
+
result={'schema':'pbisc.f01.trunk4x.matrix.v1','paired_jobs':jobs,'new_adapter_count':sum(not j.get('adapter_alias') for j in jobs),'adapter_alias_count':sum(bool(j.get('adapter_alias')) for j in jobs),'sle':slereceipts,'global_cohorts':COHORTS,'bulkonly_cohorts':['ye2026_sepsis','imperial_eskd'],'rare_identity_gate':'Original-paper fine labels/timing required. Marker diagnostics do not complete biological reproduction.','comparison_scope':'Exact current f01 6000genes, no intersection projection','baseline_run_snapshots':baseline_records}
|
| 47 |
+
(P/'MATRIX.json').write_text(json.dumps(result,indent=2)+'\n')
|
| 48 |
+
print(json.dumps({'jobs':len(jobs),'adapters':result['new_adapter_count'],'aliases':result['adapter_alias_count'],'families':{f:sum(j['family']==f for j in jobs) for f in ['strict','cv','legacy5']}}))
|
| 49 |
+
if __name__=='__main__':main()
|