@@ -404,7 +404,8 @@ def put_data_on_devices(x, sharding):
404404 prompt_mask = put_data_on_devices (prompt_mask , data_sharding )
405405 do_prof_qwen3 = profile_target in ("all" , "qwen3" )
406406 if do_prof_qwen3 :
407- jax .profiler .start_trace ("/tmp/xprof_qwen3" )
407+ tb_dir = getattr (self ._config , "tensorboard_dir" , "/tmp" )
408+ jax .profiler .start_trace (os .path .join (tb_dir , "profile_qwen3" ))
408409 with jax .named_scope ("qwen3_text_encoder" ):
409410 prompt_embeds_jax = self ._jitted_qwen3_forward (qwen3_params , prompt_ids , prompt_mask )
410411 prompt_embeds_jax .block_until_ready ()
@@ -468,7 +469,8 @@ def put_data_on_devices(x, sharding):
468469
469470 do_prof_denoise = profile_target in ("all" , "denoise" )
470471 if do_prof_denoise :
471- jax .profiler .start_trace ("/tmp/xprof_denoise" )
472+ tb_dir = getattr (self ._config , "tensorboard_dir" , "/tmp" )
473+ jax .profiler .start_trace (os .path .join (tb_dir , "profile_denoise" ))
472474 with jax .named_scope ("fused_flux_denoise_loop" ):
473475 latents_jax = self ._jitted_fused_denoise_loop (
474476 params ,
@@ -519,7 +521,8 @@ def put_data_on_devices(x, sharding):
519521
520522 do_prof_vae = profile_target in ("all" , "vae" )
521523 if do_prof_vae :
522- jax .profiler .start_trace ("/tmp/xprof_vae" )
524+ tb_dir = getattr (self ._config , "tensorboard_dir" , "/tmp" )
525+ jax .profiler .start_trace (os .path .join (tb_dir , "profile_vae" ))
523526 with jax .named_scope ("vae_decoder" ):
524527 decoded_out = self ._jitted_vae_decode (vae_params , latents_jax , vae_bn_mean_jax , vae_bn_std_jax , height , width )
525528 images_rgb = decoded_out .sample
0 commit comments