@@ -135,21 +135,22 @@ def create_goodput_recorder(config):
135135 if config .enable_goodput_recording and jax .process_index () == 0 :
136136 max_logging .log ("[GOODPUT NO-OP] recorder skipped (decoupled stub)." )
137137 return None
138- if config .enable_goodput_recording :
139- logger_name = f"goodput_{ config .run_name } "
140138
141- # Detect if we should use the elastic-aware recorder
142- recorder = None
143- if config .elastic_enabled :
144- try :
145- from ml_goodput_measurement import goodput_elastic
146- from maxtext .utils import elastic_utils
147- recorder = goodput_elastic .ElasticGoodputRecorder (config .run_name , logger_name , jax .process_index () == 0 )
148- elastic_utils .record_slice_state (recorder )
149- except ImportError :
150- pass
151-
152- if recorder is None :
153- recorder = goodput .GoodputRecorder (config .run_name , logger_name , jax .process_index () == 0 )
154- return recorder
155- return None
139+ if not config .enable_goodput_recording :
140+ return None
141+
142+ logger_name = f"goodput_{ config .run_name } "
143+
144+ # Detect if we should use the elastic-aware recorder
145+ if config .elastic_enabled :
146+ try :
147+ from ml_goodput_measurement import goodput_elastic
148+ from maxtext .utils import elastic_utils
149+ recorder = goodput_elastic .ElasticGoodputRecorder (config .run_name , logger_name , jax .process_index () == 0 )
150+ elastic_utils .record_slice_state (recorder )
151+ except ImportError as e :
152+ max_logging .log (f"Could not create elastic goodput recorder: { e } " )
153+ else :
154+ return recorder
155+
156+ return goodput .GoodputRecorder (config .run_name , logger_name , jax .process_index () == 0 )
0 commit comments