repro: locked Ego-Exo and robot environment snapshots, installation and training recipes
9947c3c verified Download tools/verify_environment.py from diffusion-gif/training-environments: direct link, hf CLI and curl.
- Browser
- Download file 2.23 kB
-
https://huggingface.co/datasets/diffusion-gif/training-environments/resolve/main/tools/verify_environment.py
- Command line
-
hf download hf://datasets/diffusion-gif/training-environments/tools/verify_environment.py
-
curl -L -o verify_environment.py https://huggingface.co/datasets/diffusion-gif/training-environments/resolve/main/tools/verify_environment.py
2.23 kB
| #!/usr/bin/env python3 | |
| """Preflight versions/imports/driver vs toolkit; no weights loaded or training.""" | |
| import argparse,importlib,json,os,platform,shutil,subprocess,sys | |
| from pathlib import Path | |
| ROOT=Path(__file__).absolute().parents[1] | |
| MAP={'egoexo-generator':'egoexo/generator','egoexo-captioner-phiseg':'egoexo/captioner_and_phiseg','robot-sft-grpo':'robot/legacy_sft_grpo','robot-data-cpu':'robot/data_cpu'} | |
| def main(): | |
| p=argparse.ArgumentParser(description=__doc__);p.add_argument('--profile',choices=MAP,required=True);p.add_argument('--gpu-basic-check',action='store_true');a=p.parse_args();folder=ROOT/MAP[a.profile];snapshot=json.loads((folder/'environment.snapshot.json').read_text()) | |
| result={'profile':a.profile,'python':platform.python_version(),'expected_python':snapshot['python'],'weights_loaded':False,'training_run':False,'modules':{}} | |
| modules=['numpy','PIL','huggingface_hub'] if a.profile=='robot-data-cpu' else ['torch','torchvision','torchaudio','transformers','accelerate','safetensors'] | |
| if a.profile=='robot-sft-grpo':modules+=['verl','vllm','fla','tilelang'] | |
| if a.profile=='egoexo-captioner-phiseg':modules+=['swift'] | |
| for name in modules: | |
| try:m=importlib.import_module(name);result['modules'][name]={'ok':True,'version':str(getattr(m,'__version__','unknown'))} | |
| except Exception as e:result['modules'][name]={'ok':False,'error_type':type(e).__name__} | |
| if 'torch' in sys.modules: | |
| import torch | |
| result.update(torch_cuda_runtime=torch.version.cuda,gpu_available=torch.cuda.is_available(),gpu_count=torch.cuda.device_count()) | |
| nvcc=shutil.which('nvcc');result['cuda_toolkit_nvcc_found']=bool(nvcc) | |
| if nvcc:result['nvcc_version']=subprocess.check_output([nvcc,'--version'],text=True).strip().splitlines()[-2:] | |
| if a.gpu_basic_check and torch.cuda.is_available(): | |
| x=torch.ones((2,2),device='cuda',dtype=torch.bfloat16);result['tiny_bfloat16_sum']=float(x.sum());torch.cuda.synchronize() | |
| if a.profile=='robot-sft-grpo' and torch.cuda.device_count()<8:result['8GPU_GRPO_preconditions_met']=False | |
| print(json.dumps(result,indent=2)) | |
| if result['python']!=result['expected_python'] or any(not x['ok'] for x in result['modules'].values()):raise SystemExit(1) | |
| if __name__=='__main__':main() | |