Buckets:
| """Freeze the existing single-anchor/MaxRL framework; install SDK in isolation. | |
| No model computation, training-client creation, or paid API request is performed. | |
| """ | |
| from __future__ import annotations | |
| import argparse | |
| import hashlib | |
| import json | |
| from pathlib import Path | |
| import shutil | |
| import subprocess | |
| import sys | |
| BASE = Path('/mnt/localssd/xiaofan') | |
| ORIGINAL = BASE / 'trimul-h100-20261010/source' | |
| def digest(path): | |
| return hashlib.sha256(Path(path).read_bytes()).hexdigest() | |
| def main(): | |
| ap = argparse.ArgumentParser() | |
| ap.add_argument('--root', type=Path, required=True) | |
| ap.add_argument('--install', action='store_true') | |
| args = ap.parse_args() | |
| root = args.root.resolve() | |
| if root.exists(): | |
| raise FileExistsError('Use a new preparation root; never overwrite a run') | |
| root.mkdir() | |
| (root / 'control').mkdir() | |
| (root / 'run').mkdir() | |
| code = root / 'code' | |
| code.mkdir() | |
| for path in Path(__file__).parent.glob('*.py'): | |
| shutil.copy2(path, code / path.name) | |
| source = root / 'source' | |
| shutil.copytree(ORIGINAL / 'ttt_discover', source / 'ttt_discover', | |
| ignore=shutil.ignore_patterns('__pycache__', '*.pyc')) | |
| (source / 'examples').mkdir() | |
| original_init = ORIGINAL / 'examples/__init__.py' | |
| if original_init.exists(): | |
| shutil.copy2(original_init, source / 'examples/__init__.py') | |
| shutil.copytree(ORIGINAL / 'examples/gpu_mode', source / 'examples/gpu_mode', | |
| ignore=shutil.ignore_patterns('__pycache__', '*.pyc')) | |
| (source / 'vendor').mkdir() | |
| (source / 'vendor/ttt_discover_gpu').symlink_to(ORIGINAL / 'vendor/ttt_discover_gpu', target_is_directory=True) | |
| reference = code / 'reference' | |
| reference.mkdir() | |
| copied = {} | |
| names = ['kernel_stage_cut_compose.py', 'kernel_semantic_contract_compose.py', | |
| 'prepare_component_search.py', 'prepare_strided_fusion.py'] | |
| for name in names: | |
| choices = sorted(BASE.glob('fcfw-kernel-*/' + name)) | |
| if name.startswith('prepare_'): | |
| choices = [BASE / 'fcfw-kernel-component-graph-code-20261021-v3' / name] | |
| choices = [p for p in choices if p.is_file()] | |
| if not choices: | |
| raise FileNotFoundError(name) | |
| origin = choices[0] | |
| shutil.copy2(origin, reference / name) | |
| copied[name] = dict(origin=str(origin), sha256=digest(origin)) | |
| packet = dict( | |
| schema='kernel-component-api10-preparation-v1', root=str(root), | |
| existing_framework=str(ORIGINAL), reference_helpers=copied, | |
| files={str(p.relative_to(root)): digest(p) for directory in [source / 'ttt_discover', source / 'examples', code] | |
| for p in directory.rglob('*.py')}, | |
| official_manifest_sha256=digest(ORIGINAL / 'vendor/ttt_discover_gpu/manifest.json'), | |
| shared_step0_path=str(ORIGINAL.parent / 'shared/trimul_step0.json'), | |
| shared_step0_sha256=digest(ORIGINAL.parent / 'shared/trimul_step0.json'), | |
| paid_requests=0, sdk='0.34.0', model='openai/gpt-oss-120b', | |
| logical_steps=10, imported_step0_policy_updates=0, fresh_batches=9, | |
| groups_per_batch=8, group_size=64, fresh_episodes=4608, | |
| source_library='parent_and_current_64_siblings_only', | |
| injected_paper_or_manual_implementations=False, | |
| ) | |
| (root / 'control/preparation.json').write_text(json.dumps(packet, indent=2)) | |
| if args.install: | |
| old_python = ORIGINAL / '.venv-train-math/bin/python' | |
| site_paths = json.loads(subprocess.check_output( | |
| [str(old_python), '-c', 'import site,json;print(json.dumps(site.getsitepackages()))'], text=True)) | |
| subprocess.run(['uv', 'venv', '--python', str(old_python), str(root / '.venv-api')], check=True) | |
| new_python = root / '.venv-api/bin/python' | |
| new_sites = json.loads(subprocess.check_output( | |
| [str(new_python), '-c', 'import site,json;print(json.dumps(site.getsitepackages()))'], text=True)) | |
| Path(new_sites[0], 'existing_framework_dependencies.pth').write_text('\n'.join(site_paths) + '\n') | |
| subprocess.run(['uv', 'pip', 'install', '--python', str(new_python), 'tinker==0.34.0'], check=True) | |
| packet['api_python'] = str(new_python) | |
| packet['parent_site_packages'] = site_paths | |
| (root / 'control/preparation.json').write_text(json.dumps(packet, indent=2)) | |
| print(json.dumps({k: packet[k] for k in ['root', 'model', 'logical_steps', 'fresh_batches', 'fresh_episodes', 'paid_requests']}), flush=True) | |
| if __name__ == '__main__': | |
| main() | |
Xet Storage Details
- Size:
- 4.55 kB
- Xet hash:
- 0ab2ab3cc82b7cddc67975046361b47d919c94ec9f5997e501ec263c581b90d9
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.