@@ -2783,24 +2783,24 @@ def _run_batch_parallel(
27832783 f = executor .submit (_autots_worker , config , run_dir , workspace )
27842784 futures [f ] = (task , run_dir , workspace , iteration )
27852785
2786- # ── Collect results in completion order via as_completed ─────────
2787- # as_completed() yields each Future as soon as its subprocess
2788- # finishes, so shorter tasks are processed without waiting for
2789- # slower ones in the same batch. Graph updates still happen
2790- # sequentially (graph is not thread-safe), but we no longer block
2791- # the fastest results behind the slowest worker.
2792- results : list [tuple [ExplorationTask , str , list [str ], str , int ]] = []
2793- for f in concurrent .futures .as_completed (futures ):
2794- task , run_dir , _workspace , iteration = futures [f ]
2795- try :
2796- profile_dirs : list [str ] = f .result ()
2797- results .append ((task , run_dir , profile_dirs , "DONE" , iteration ))
2798- except Exception as exc :
2799- logger .error (
2800- "_run_batch_parallel: AutoTS failed for run %s: %s" ,
2801- run_dir , exc ,
2802- )
2803- results .append ((task , run_dir , [], "FAILED" , iteration ))
2786+ # ── Collect results in completion order via as_completed ─────────
2787+ # as_completed() yields each Future as soon as its subprocess
2788+ # finishes, so shorter tasks are processed without waiting for
2789+ # slower ones in the same batch. Graph updates still happen
2790+ # sequentially (graph is not thread-safe), but we no longer block
2791+ # the fastest results behind the slowest worker.
2792+ results : list [tuple [ExplorationTask , str , list [str ], str , int ]] = []
2793+ for f in concurrent .futures .as_completed (futures ):
2794+ task , run_dir , _workspace , iteration = futures [f ]
2795+ try :
2796+ profile_dirs : list [str ] = f .result ()
2797+ results .append ((task , run_dir , profile_dirs , "DONE" , iteration ))
2798+ except Exception as exc :
2799+ logger .error (
2800+ "_run_batch_parallel: AutoTS failed for run %s: %s" ,
2801+ run_dir , exc ,
2802+ )
2803+ results .append ((task , run_dir , [], "FAILED" , iteration ))
28042804
28052805 # ── Process results sequentially (graph is not thread-safe) ───────
28062806 for task , run_dir , profile_dirs , status , iteration in results :
@@ -2832,6 +2832,7 @@ def _run_batch_parallel(
28322832 run_dir , task ,
28332833 status = status ,
28342834 profile_dirs = profile_dirs ,
2835+ iteration = iteration ,
28352836 )
28362837
28372838 self .graph .save (self .graph_json_path )
@@ -3148,7 +3149,7 @@ def _save_run_metadata(
31483149 iteration = None ,
31493150 ) -> None :
31503151 info = {
3151- "iteration" : self ._iteration ,
3152+ "iteration" : iteration if iteration is not None else self ._iteration ,
31523153 "node_id" : task .node_id ,
31533154 "afir_params" : task .afir_params ,
31543155 "priority" : task .priority ,
0 commit comments