Datasets:
Refresh verified six-GPU manifest: 7626 tuples
Browse files- README.md +1 -1
- metadata.jsonl +0 -0
- pipeline/pipeline.py +7 -2
- pipeline/root_supervisor.py +53 -4
- progress/sixgpu-status.json +17 -18
README.md
CHANGED
|
@@ -32,7 +32,7 @@ dataset_info:
|
|
| 32 |
|
| 33 |
Tuples: original video, original-video depth, style video, and the unchanged editing instruction.
|
| 34 |
|
| 35 |
-
Current verified tuples: **
|
| 36 |
|
| 37 |
Source: [QingyanBai/Ditto-1M](https://huggingface.co/datasets/QingyanBai/Ditto-1M), revision `aac1417418d8f7e77d4e257d5620c36b2c3a00e8`. Attribution: Qingyan Bai et al., *Ditto: Scaling Instruction-Based Video Editing with a High-Quality Synthetic Dataset*. Source license CC BY-NC-SA 4.0 is retained for this derivative dataset. The original media are unmodified. Depth was estimated using [depth-anything/DA3-LARGE](https://huggingface.co/depth-anything/DA3-LARGE).
|
| 38 |
|
|
|
|
| 32 |
|
| 33 |
Tuples: original video, original-video depth, style video, and the unchanged editing instruction.
|
| 34 |
|
| 35 |
+
Current verified tuples: **7626**. Target: 8,400 accepted tuples; processing is ongoing.
|
| 36 |
|
| 37 |
Source: [QingyanBai/Ditto-1M](https://huggingface.co/datasets/QingyanBai/Ditto-1M), revision `aac1417418d8f7e77d4e257d5620c36b2c3a00e8`. Attribution: Qingyan Bai et al., *Ditto: Scaling Instruction-Based Video Editing with a High-Quality Synthetic Dataset*. Source license CC BY-NC-SA 4.0 is retained for this derivative dataset. The original media are unmodified. Depth was estimated using [depth-anything/DA3-LARGE](https://huggingface.co/depth-anything/DA3-LARGE).
|
| 38 |
|
metadata.jsonl
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
pipeline/pipeline.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
"""Bounded streaming pipeline; quotas count verified HF tuples, not candidates."""
|
| 2 |
-
import argparse,collections,concurrent.futures as cf,fcntl,json,os,shutil,sqlite3,subprocess,sys,threading,time,traceback
|
| 3 |
from pathlib import Path
|
| 4 |
from common import *
|
| 5 |
from streaming import seed_download,indexed_download,build_index
|
|
@@ -51,7 +51,12 @@ class Run:
|
|
| 51 |
if p.exists():shutil.rmtree(p)
|
| 52 |
with self.db_lock:self.db.execute('UPDATE jobs SET cleaned=1 WHERE id=?',(jid,));self.db.commit()
|
| 53 |
def space(self):
|
| 54 |
-
used=
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 55 |
headroom=self.a.window*2*200*1024**2+2*1024**3
|
| 56 |
return used+headroom<self.a.scratch_gib*1024**3 and free>self.a.reserve_gib*1024**3+headroom
|
| 57 |
def queue_upload(self,row,d,filtered,depth):
|
|
|
|
| 1 |
"""Bounded streaming pipeline; quotas count verified HF tuples, not candidates."""
|
| 2 |
+
import argparse,collections,concurrent.futures as cf,fcntl,json,os,shutil,sqlite3,stat,subprocess,sys,threading,time,traceback
|
| 3 |
from pathlib import Path
|
| 4 |
from common import *
|
| 5 |
from streaming import seed_download,indexed_download,build_index
|
|
|
|
| 51 |
if p.exists():shutil.rmtree(p)
|
| 52 |
with self.db_lock:self.db.execute('UPDATE jobs SET cleaned=1 WHERE id=?',(jid,));self.db.commit()
|
| 53 |
def space(self):
|
| 54 |
+
used=0
|
| 55 |
+
for p in self.scratch.rglob('*'):
|
| 56 |
+
try:info=p.stat()
|
| 57 |
+
except FileNotFoundError:continue # Verified media may be cleaned during this scan.
|
| 58 |
+
if stat.S_ISREG(info.st_mode):used+=info.st_size
|
| 59 |
+
free=shutil.disk_usage(self.scratch).free
|
| 60 |
headroom=self.a.window*2*200*1024**2+2*1024**3
|
| 61 |
return used+headroom<self.a.scratch_gib*1024**3 and free>self.a.reserve_gib*1024**3+headroom
|
| 62 |
def queue_upload(self,row,d,filtered,depth):
|
pipeline/root_supervisor.py
CHANGED
|
@@ -17,6 +17,7 @@ DOWNLOADER=None
|
|
| 17 |
DOWNLOAD_RETRIES=0
|
| 18 |
UPLOADER=None
|
| 19 |
UPLOAD_RETRIES=0
|
|
|
|
| 20 |
os.environ.update(HF_TOKEN_PATH='/root/.styleedit-hf-token',PYTHONPATH='/opt/depth-anything-3-code/src',HF_HUB_DISABLE_PROGRESS_BARS='1',OMP_NUM_THREADS='4',OPENBLAS_NUM_THREADS='2')
|
| 21 |
sys.path.insert(0,str(APP))
|
| 22 |
|
|
@@ -55,6 +56,29 @@ class ExistingDownloader:
|
|
| 55 |
try:return None if b'local_media.py' in Path(f'/proc/{self.pid}/cmdline').read_bytes() else 1
|
| 56 |
except OSError:return 1
|
| 57 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 58 |
def start_download():
|
| 59 |
marker=ROOT/'download-process.json'
|
| 60 |
if marker.exists():
|
|
@@ -67,28 +91,44 @@ def start_download():
|
|
| 67 |
return child
|
| 68 |
|
| 69 |
def start_uploader():
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 70 |
with (ROOT/'batch-upload.log').open('a') as log:
|
| 71 |
return subprocess.Popen([sys.executable,'-u',str(APP/'batch_upload.py')],stdout=log,stderr=subprocess.STDOUT,start_new_session=True)
|
| 72 |
|
| 73 |
def start(gpu,stage):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 74 |
env=dict(os.environ,CUDA_VISIBLE_DEVICES=str(gpu),STYLEEDIT_GPU_LOCK=f'/opt/styleedit-gpu-{gpu}.lock')
|
| 75 |
args=[sys.executable,'-u',str(APP/'pipeline.py'),'--local-media-root',str(ROOT/'media'),'--plan',str(ROOT/f'{stage}-gpu{gpu}.json'),'--state',str(STATE/f'gpu{gpu}'),'--scratch',f'/opt/styleedit-sixgpu-scratch/gpu{gpu}','--limit','0','--per-style','100','--window','6','--download-workers','4','--upload-workers','8','--scratch-gib','60','--reserve-gib','50']
|
| 76 |
with (ROOT/f'{stage}-gpu{gpu}.log').open('a') as log:
|
| 77 |
return subprocess.Popen(args,env=env,stdout=log,stderr=subprocess.STDOUT,start_new_session=True)
|
| 78 |
|
| 79 |
def main():
|
| 80 |
-
global DOWNLOADER,UPLOADER
|
| 81 |
ROOT.mkdir(exist_ok=True)
|
| 82 |
lock=(ROOT/'supervisor.lock').open('a');fcntl.flock(lock,fcntl.LOCK_EX|fcntl.LOCK_NB)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 83 |
failure=ROOT/'failure.json'
|
| 84 |
if failure.exists():os.replace(failure,ROOT/f'failure-before-{int(time.time())}.json')
|
| 85 |
-
DOWNLOADER=start_download()
|
| 86 |
while not (ROOT/'RESTORED').exists():
|
| 87 |
status('restoring_runtime',{});time.sleep(20)
|
| 88 |
from huggingface_hub import HfApi
|
| 89 |
api=HfApi();print('AUTH_OK',api.whoami()['name'],flush=True);api.auth_check('faraway00/StyleEdit',repo_type='dataset')
|
| 90 |
from reconcile_remote import reconcile
|
| 91 |
-
reconcile()
|
| 92 |
UPLOADER=start_uploader()
|
| 93 |
rows=json.loads((APP/'candidates.json').read_text());assignment={s:i%6 for i,s in enumerate(sorted({r['style_id'] for r in rows}))}
|
| 94 |
for gpu in range(6):
|
|
@@ -109,7 +149,16 @@ def main():
|
|
| 109 |
except Exception as error:print('MANIFEST_RETRY',type(error).__name__,str(error)[:200],flush=True)
|
| 110 |
time.sleep(30)
|
| 111 |
children={g:start(g,stage) for g in range(6)}
|
| 112 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 113 |
status('processing_'+stage,children)
|
| 114 |
if time.monotonic()-last_publish>600:
|
| 115 |
try: sixgpu_publish.publish();last_publish=time.monotonic()
|
|
|
|
| 17 |
DOWNLOAD_RETRIES=0
|
| 18 |
UPLOADER=None
|
| 19 |
UPLOAD_RETRIES=0
|
| 20 |
+
RESUME=None
|
| 21 |
os.environ.update(HF_TOKEN_PATH='/root/.styleedit-hf-token',PYTHONPATH='/opt/depth-anything-3-code/src',HF_HUB_DISABLE_PROGRESS_BARS='1',OMP_NUM_THREADS='4',OPENBLAS_NUM_THREADS='2')
|
| 22 |
sys.path.insert(0,str(APP))
|
| 23 |
|
|
|
|
| 56 |
try:return None if b'local_media.py' in Path(f'/proc/{self.pid}/cmdline').read_bytes() else 1
|
| 57 |
except OSError:return 1
|
| 58 |
|
| 59 |
+
def process_alive(pid,expected):
|
| 60 |
+
try:
|
| 61 |
+
proc=Path(f'/proc/{pid}')
|
| 62 |
+
if proc.joinpath('stat').read_text().rsplit(')',1)[1].split()[0]=='Z':return False
|
| 63 |
+
args=proc.joinpath('cmdline').read_bytes().split(b'\0')
|
| 64 |
+
return all(str(value).encode() in args for value in expected)
|
| 65 |
+
except (OSError,IndexError):return False
|
| 66 |
+
|
| 67 |
+
class ExistingProcess:
|
| 68 |
+
"""Attach without starting a second writer; require fresh completion evidence."""
|
| 69 |
+
def __init__(self,pid,expected,state=None,returncode=None):
|
| 70 |
+
self.pid=pid;self.expected=expected;self.state=state;self.returncode=returncode;self.since=time.time()
|
| 71 |
+
def poll(self):
|
| 72 |
+
if self.returncode is not None:return self.returncode
|
| 73 |
+
if process_alive(self.pid,self.expected):return None
|
| 74 |
+
self.returncode=1
|
| 75 |
+
if self.state is not None:
|
| 76 |
+
summary=self.state/'summary.json';quota=self.state/'quota-report.json'
|
| 77 |
+
if all(p.exists() and p.stat().st_mtime>=self.since for p in [summary,quota]):
|
| 78 |
+
if not json.loads(summary.read_text())['errors']:
|
| 79 |
+
self.returncode=0 if json.loads(quota.read_text())['complete'] else 2
|
| 80 |
+
return self.returncode
|
| 81 |
+
|
| 82 |
def start_download():
|
| 83 |
marker=ROOT/'download-process.json'
|
| 84 |
if marker.exists():
|
|
|
|
| 91 |
return child
|
| 92 |
|
| 93 |
def start_uploader():
|
| 94 |
+
marker=ROOT/'batch-upload/process.json'
|
| 95 |
+
if marker.exists():
|
| 96 |
+
existing=ExistingProcess(json.loads(marker.read_text())['pid'],[APP/'batch_upload.py'])
|
| 97 |
+
if existing.poll() is None:
|
| 98 |
+
print('UPLOADER_ADOPTED',existing.pid,flush=True);return existing
|
| 99 |
with (ROOT/'batch-upload.log').open('a') as log:
|
| 100 |
return subprocess.Popen([sys.executable,'-u',str(APP/'batch_upload.py')],stdout=log,stderr=subprocess.STDOUT,start_new_session=True)
|
| 101 |
|
| 102 |
def start(gpu,stage):
|
| 103 |
+
if RESUME and RESUME['stage']=='processing_'+stage:
|
| 104 |
+
old=RESUME['processes'].get(str(gpu))
|
| 105 |
+
if old:
|
| 106 |
+
expected=[APP/'pipeline.py',ROOT/f'{stage}-gpu{gpu}.json',STATE/f'gpu{gpu}']
|
| 107 |
+
if old['returncode']==0 or (old['returncode'] is None and process_alive(old['pid'],expected)):
|
| 108 |
+
print('SHARD_ADOPTED',gpu,old['pid'],'completed' if old['returncode']==0 else 'running',flush=True)
|
| 109 |
+
return ExistingProcess(old['pid'],expected,STATE/f'gpu{gpu}',old['returncode'])
|
| 110 |
env=dict(os.environ,CUDA_VISIBLE_DEVICES=str(gpu),STYLEEDIT_GPU_LOCK=f'/opt/styleedit-gpu-{gpu}.lock')
|
| 111 |
args=[sys.executable,'-u',str(APP/'pipeline.py'),'--local-media-root',str(ROOT/'media'),'--plan',str(ROOT/f'{stage}-gpu{gpu}.json'),'--state',str(STATE/f'gpu{gpu}'),'--scratch',f'/opt/styleedit-sixgpu-scratch/gpu{gpu}','--limit','0','--per-style','100','--window','6','--download-workers','4','--upload-workers','8','--scratch-gib','60','--reserve-gib','50']
|
| 112 |
with (ROOT/f'{stage}-gpu{gpu}.log').open('a') as log:
|
| 113 |
return subprocess.Popen(args,env=env,stdout=log,stderr=subprocess.STDOUT,start_new_session=True)
|
| 114 |
|
| 115 |
def main():
|
| 116 |
+
global DOWNLOADER,UPLOADER,RESUME
|
| 117 |
ROOT.mkdir(exist_ok=True)
|
| 118 |
lock=(ROOT/'supervisor.lock').open('a');fcntl.flock(lock,fcntl.LOCK_EX|fcntl.LOCK_NB)
|
| 119 |
+
if '--resume' in sys.argv:
|
| 120 |
+
RESUME=json.loads((ROOT/'status.json').read_text())
|
| 121 |
+
if not RESUME['stage'].startswith('processing_'):raise RuntimeError('Resume requires an existing processing stage')
|
| 122 |
+
if not all((ROOT/(c+'.extracted.json')).exists() for c in ['source','global_style1','global_style2']):raise RuntimeError('Resume requires extracted inputs')
|
| 123 |
failure=ROOT/'failure.json'
|
| 124 |
if failure.exists():os.replace(failure,ROOT/f'failure-before-{int(time.time())}.json')
|
| 125 |
+
if RESUME is None:DOWNLOADER=start_download()
|
| 126 |
while not (ROOT/'RESTORED').exists():
|
| 127 |
status('restoring_runtime',{});time.sleep(20)
|
| 128 |
from huggingface_hub import HfApi
|
| 129 |
api=HfApi();print('AUTH_OK',api.whoami()['name'],flush=True);api.auth_check('faraway00/StyleEdit',repo_type='dataset')
|
| 130 |
from reconcile_remote import reconcile
|
| 131 |
+
if RESUME is None:reconcile()
|
| 132 |
UPLOADER=start_uploader()
|
| 133 |
rows=json.loads((APP/'candidates.json').read_text());assignment={s:i%6 for i,s in enumerate(sorted({r['style_id'] for r in rows}))}
|
| 134 |
for gpu in range(6):
|
|
|
|
| 149 |
except Exception as error:print('MANIFEST_RETRY',type(error).__name__,str(error)[:200],flush=True)
|
| 150 |
time.sleep(30)
|
| 151 |
children={g:start(g,stage) for g in range(6)}
|
| 152 |
+
scratch_retries=collections.Counter()
|
| 153 |
+
while True:
|
| 154 |
+
for gpu,child in list(children.items()):
|
| 155 |
+
if child.poll()!=1 or scratch_retries[gpu]:continue
|
| 156 |
+
with (ROOT/f'{stage}-gpu{gpu}.log').open('rb') as log:
|
| 157 |
+
log.seek(0,2);log.seek(max(0,log.tell()-4096));tail=log.read().decode(errors='replace')
|
| 158 |
+
if 'FileNotFoundError' in tail and 'in space' in tail:
|
| 159 |
+
scratch_retries[gpu]+=1;children[gpu]=start(gpu,stage)
|
| 160 |
+
print('SCRATCH_RACE_SHARD_RESUMED',gpu,children[gpu].pid,flush=True)
|
| 161 |
+
if not any(p.poll() is None for p in children.values()):break
|
| 162 |
status('processing_'+stage,children)
|
| 163 |
if time.monotonic()-last_publish>600:
|
| 164 |
try: sixgpu_publish.publish();last_publish=time.monotonic()
|
progress/sixgpu-status.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
{
|
| 2 |
-
"utc": "2026-10-
|
| 3 |
"stage": "processing_global_style1",
|
| 4 |
-
"verified":
|
| 5 |
"counts": {
|
| 6 |
"00e5f0752aae": 100,
|
| 7 |
"10ae00528692": 100,
|
|
@@ -14,7 +14,7 @@
|
|
| 14 |
"ab92d219b250": 100,
|
| 15 |
"baf401925b12": 100,
|
| 16 |
"d2bef4453db8": 100,
|
| 17 |
-
"e212a26e5c9c":
|
| 18 |
"ef610916460f": 100,
|
| 19 |
"0423a6080620": 100,
|
| 20 |
"128131ec4461": 100,
|
|
@@ -79,18 +79,17 @@
|
|
| 79 |
"a78ae8b77085": 100,
|
| 80 |
"b7eb902e7b22": 100,
|
| 81 |
"cfdb284d6b07": 100,
|
| 82 |
-
"dec9f2e31acf":
|
| 83 |
"ee3d28fd4cc8": 100,
|
| 84 |
"ff3dbf0e95b5": 100
|
| 85 |
},
|
| 86 |
"statuses": {
|
| 87 |
-
"deferred":
|
| 88 |
-
"
|
| 89 |
-
"
|
| 90 |
-
"
|
| 91 |
-
"verified": 7592
|
| 92 |
},
|
| 93 |
-
"root_free_bytes":
|
| 94 |
"archives_extracted": [
|
| 95 |
"source",
|
| 96 |
"global_style1",
|
|
@@ -99,7 +98,7 @@
|
|
| 99 |
"processes": {
|
| 100 |
"0": {
|
| 101 |
"pid": 45060,
|
| 102 |
-
"returncode":
|
| 103 |
},
|
| 104 |
"1": {
|
| 105 |
"pid": 45061,
|
|
@@ -110,24 +109,24 @@
|
|
| 110 |
"returncode": 0
|
| 111 |
},
|
| 112 |
"3": {
|
| 113 |
-
"pid":
|
| 114 |
-
"returncode":
|
| 115 |
},
|
| 116 |
"4": {
|
| 117 |
"pid": 45064,
|
| 118 |
"returncode": 0
|
| 119 |
},
|
| 120 |
"5": {
|
| 121 |
-
"pid":
|
| 122 |
-
"returncode":
|
| 123 |
}
|
| 124 |
},
|
| 125 |
"batch_upload": {
|
| 126 |
-
"utc": "2026-10-
|
| 127 |
"state": "running",
|
| 128 |
"new_verified": 0,
|
| 129 |
-
"pending":
|
| 130 |
-
"verified_receipts":
|
| 131 |
},
|
| 132 |
"archive_download_bytes": 574104526178
|
| 133 |
}
|
|
|
|
| 1 |
{
|
| 2 |
+
"utc": "2026-10-25T13:08:20Z",
|
| 3 |
"stage": "processing_global_style1",
|
| 4 |
+
"verified": 7626,
|
| 5 |
"counts": {
|
| 6 |
"00e5f0752aae": 100,
|
| 7 |
"10ae00528692": 100,
|
|
|
|
| 14 |
"ab92d219b250": 100,
|
| 15 |
"baf401925b12": 100,
|
| 16 |
"d2bef4453db8": 100,
|
| 17 |
+
"e212a26e5c9c": 100,
|
| 18 |
"ef610916460f": 100,
|
| 19 |
"0423a6080620": 100,
|
| 20 |
"128131ec4461": 100,
|
|
|
|
| 79 |
"a78ae8b77085": 100,
|
| 80 |
"b7eb902e7b22": 100,
|
| 81 |
"cfdb284d6b07": 100,
|
| 82 |
+
"dec9f2e31acf": 100,
|
| 83 |
"ee3d28fd4cc8": 100,
|
| 84 |
"ff3dbf0e95b5": 100
|
| 85 |
},
|
| 86 |
"statuses": {
|
| 87 |
+
"deferred": 38241,
|
| 88 |
+
"reject": 1346,
|
| 89 |
+
"verified": 7626,
|
| 90 |
+
"retry": 19199
|
|
|
|
| 91 |
},
|
| 92 |
+
"root_free_bytes": 947505360896,
|
| 93 |
"archives_extracted": [
|
| 94 |
"source",
|
| 95 |
"global_style1",
|
|
|
|
| 98 |
"processes": {
|
| 99 |
"0": {
|
| 100 |
"pid": 45060,
|
| 101 |
+
"returncode": 0
|
| 102 |
},
|
| 103 |
"1": {
|
| 104 |
"pid": 45061,
|
|
|
|
| 109 |
"returncode": 0
|
| 110 |
},
|
| 111 |
"3": {
|
| 112 |
+
"pid": 1538902,
|
| 113 |
+
"returncode": null
|
| 114 |
},
|
| 115 |
"4": {
|
| 116 |
"pid": 45064,
|
| 117 |
"returncode": 0
|
| 118 |
},
|
| 119 |
"5": {
|
| 120 |
+
"pid": 1538903,
|
| 121 |
+
"returncode": 0
|
| 122 |
}
|
| 123 |
},
|
| 124 |
"batch_upload": {
|
| 125 |
+
"utc": "2026-10-25T13:08:17Z",
|
| 126 |
"state": "running",
|
| 127 |
"new_verified": 0,
|
| 128 |
+
"pending": 0,
|
| 129 |
+
"verified_receipts": 7367
|
| 130 |
},
|
| 131 |
"archive_download_bytes": 574104526178
|
| 132 |
}
|