@@ -550,6 +550,7 @@ def _spawn_ssim_task(
550550 log_dir : str ,
551551 task_index : int ,
552552 pytest_extra_args : list [str ],
553+ hf_api_key : str ,
553554) -> _RunningTask :
554555 import shlex
555556
@@ -559,6 +560,7 @@ def _spawn_ssim_task(
559560 command = f"set -euo pipefail && source $HOME/.local/bin/env && source /opt/venv/bin/activate && { pytest_command } "
560561 env = os .environ .copy ()
561562 env ["HF_HOME" ] = "/root/data/.cache"
563+ env ["HF_API_KEY" ] = hf_api_key
562564 # MultiprocExecutor returns CUDA tensors through mp pipes (CUDA IPC).
563565 # On kernels without pidfd_open support, PyTorch fails when
564566 # expandable_segments=True. Force False for CI compatibility.
@@ -675,6 +677,7 @@ def _build_pytest_extra_args(
675677 ssim_full_quality : bool ,
676678 ssim_reference_repo : str ,
677679 skip_ssim_reference_download : bool ,
680+ ssim_bootstrap_mode : bool ,
678681 pytest_k : str ,
679682) -> list [str ]:
680683 args = []
@@ -684,6 +687,8 @@ def _build_pytest_extra_args(
684687 args .extend (["--ssim-reference-repo" , ssim_reference_repo .strip ()])
685688 if skip_ssim_reference_download :
686689 args .append ("--skip-ssim-reference-download" )
690+ if ssim_bootstrap_mode :
691+ args .append ("--ssim-bootstrap-mode" )
687692 if pytest_k .strip ():
688693 args .extend (["-k" , pytest_k .strip ()])
689694 return args
@@ -693,6 +698,7 @@ def _schedule_ssim_tasks(
693698 repo_root : str ,
694699 tasks : list [SSIMTask ],
695700 pytest_extra_args : list [str ],
701+ hf_api_key : str ,
696702 fail_fast : bool = True ,
697703) -> dict [int , _TaskResult ]:
698704 import tempfile
@@ -735,6 +741,7 @@ def _schedule_ssim_tasks(
735741 log_dir = log_dir ,
736742 task_index = task .task_id ,
737743 pytest_extra_args = pytest_extra_args ,
744+ hf_api_key = hf_api_key ,
738745 )
739746 print (f"Started { task .test_name } on GPUs { ',' .join (assigned_gpu_ids )} " )
740747 running_tasks .append (running_task )
@@ -885,6 +892,7 @@ def run_ssim_partition(
885892 ssim_full_quality : bool = False ,
886893 ssim_reference_repo : str = "" ,
887894 skip_ssim_reference_download : bool = False ,
895+ ssim_bootstrap_mode : bool = False ,
888896 pytest_k : str = "" ,
889897 sync_generated_to_volume : bool = False ,
890898 generated_volume_subdir : str = "" ,
@@ -913,12 +921,14 @@ def run_ssim_partition(
913921 ssim_full_quality = ssim_full_quality ,
914922 ssim_reference_repo = ssim_reference_repo ,
915923 skip_ssim_reference_download = skip_ssim_reference_download ,
924+ ssim_bootstrap_mode = ssim_bootstrap_mode ,
916925 pytest_k = pytest_k ,
917926 )
918927 results = _schedule_ssim_tasks (
919928 repo_root ,
920929 partition ,
921930 pytest_extra_args = pytest_extra_args ,
931+ hf_api_key = hf_api_key ,
922932 fail_fast = fail_fast ,
923933 )
924934 summaries = _collect_task_summaries (partition , results )
@@ -955,6 +965,7 @@ def run_ssim_tests(
955965 full_quality : bool = False ,
956966 reference_repo : str = "" ,
957967 skip_reference_download : bool = False ,
968+ bootstrap_mode : bool = False ,
958969 pytest_k : str = "" ,
959970 sync_generated_to_volume : bool = False ,
960971 generated_volume_subdir : str = "" ,
@@ -975,15 +986,24 @@ def run_ssim_tests(
975986 print (f"Selected model ids: { model_ids } " )
976987 if pytest_k .strip ():
977988 print (f"Using pytest -k filter: { pytest_k } " )
989+ if bootstrap_mode :
990+ print (
991+ "SSIM bootstrap mode enabled: missing references will upload "
992+ "draft artifacts and xfail."
993+ )
978994 quality_tier = _resolve_output_quality_tier (full_quality )
979995 if sync_generated_to_volume :
980996 resolved_subdir = _resolve_generated_volume_subdir (
981997 generated_volume_subdir ,
982998 resolved_git_commit ,
983999 )
1000+ generated_volume_path = _build_generated_volume_relative_path (
1001+ generated_volume_subdir = resolved_subdir ,
1002+ quality_tier = quality_tier ,
1003+ )
9841004 print (
9851005 "Raw generated videos will be saved to Modal volume path: "
986- f"{ _build_generated_volume_relative_path ( generated_volume_subdir = resolved_subdir , quality_tier = quality_tier ) } "
1006+ f"{ generated_volume_path } "
9871007 )
9881008 else :
9891009 resolved_subdir = ""
@@ -998,6 +1018,7 @@ def run_ssim_tests(
9981018 ssim_full_quality = full_quality ,
9991019 ssim_reference_repo = reference_repo ,
10001020 skip_ssim_reference_download = skip_reference_download ,
1021+ ssim_bootstrap_mode = bootstrap_mode ,
10011022 pytest_k = pytest_k ,
10021023 sync_generated_to_volume = sync_generated_to_volume ,
10031024 generated_volume_subdir = resolved_subdir ,
0 commit comments