From 57360bec8a5923c00c564dbcd417499f491ef9b6 Mon Sep 17 00:00:00 2001 From: Zchen <161216199+ZH-CEN@users.noreply.github.com> Date: Fri, 17 Oct 2025 11:45:20 +0800 Subject: [PATCH] Remove CPU optimization call and add logging for TPU strategy and data pipeline performance --- model_training_nnn_tpu/trainer_tf.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/model_training_nnn_tpu/trainer_tf.py b/model_training_nnn_tpu/trainer_tf.py index 32feeb0..58e49ea 100644 --- a/model_training_nnn_tpu/trainer_tf.py +++ b/model_training_nnn_tpu/trainer_tf.py @@ -50,9 +50,6 @@ class BrainToTextDecoderTrainerTF: self.args = args self.logger = None - # Optimize CPU utilization for data pipeline (利用224核心) - self._configure_cpu_optimization() - # Initialize TPU strategy self.strategy = create_tpu_strategy() if self.strategy is None: @@ -60,6 +57,8 @@ class BrainToTextDecoderTrainerTF: print(f"Training on {self.strategy.num_replicas_in_sync} TPU cores") print(f"Strategy type: {type(self.strategy).__name__}") + print("💡 Using tf.data.AUTOTUNE for optimal data pipeline performance") + print("📝 Ensure create_input_fn uses AUTOTUNE for .map() and .prefetch() operations") # Configure mixed precision for TPU v5e-8 if args.get('use_amp', True):