From d53e5fa3b66f9e01f43b220e0263279468f0a339 Mon Sep 17 00:00:00 2001 From: OutisLi Date: Thu, 31 Jul 2025 16:32:07 +0800 Subject: [PATCH 1/4] fix:error when both enable_profiler and profiling are true --- deepmd/pt/train/training.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deepmd/pt/train/training.py b/deepmd/pt/train/training.py index 193dcd8cb9..12db5f73e3 100644 --- a/deepmd/pt/train/training.py +++ b/deepmd/pt/train/training.py @@ -1061,7 +1061,7 @@ def log_loss_valid(_task_key="Default"): log.info( f"The profiling trace has been saved under {self.tensorboard_log_dir}" ) - if self.profiling: + if not self.enable_profiler and self.profiling: prof.export_chrome_trace(self.profiling_file) log.info( f"The profiling trace has been saved to: {self.profiling_file}" From 03af5fc7df73a69f33bd39d76785afe963f8d3f3 Mon Sep 17 00:00:00 2001 From: OutisLi Date: Thu, 31 Jul 2025 17:22:26 +0800 Subject: [PATCH 2/4] fix:docstring for profiling --- deepmd/utils/argcheck.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deepmd/utils/argcheck.py b/deepmd/utils/argcheck.py index fb911550dd..e1a6887489 100644 --- a/deepmd/utils/argcheck.py +++ b/deepmd/utils/argcheck.py @@ -3137,7 +3137,7 @@ def training_args( ) doc_disp_training = "Displaying verbose information during training." doc_time_training = "Timing during training." - doc_profiling = "Export the profiling results to the Chrome JSON file for performance analysis, driven by the legacy TensorFlow profiling API or PyTorch Profiler. The output file will be saved to `profiling_file`." + doc_profiling = "Export the profiling results to the Chrome JSON file for performance analysis, driven by the legacy TensorFlow profiling API or PyTorch Profiler. The output file will be saved to `profiling_file`. When enable_profiler is True, this option is ignored, since the profiling results will be saved to the TensorBoard log." doc_profiling_file = "Output file for profiling." doc_enable_profiler = "Export the profiling results to the TensorBoard log for performance analysis, driven by TensorFlow Profiler (available in TensorFlow 2.3) or PyTorch Profiler. The log will be saved to `tensorboard_log_dir`." doc_tensorboard = "Enable tensorboard" From a6a96e7f6e836038790fa35742979680c4753b74 Mon Sep 17 00:00:00 2001 From: LI TIANCHENG <137472077+OutisLi@users.noreply.github.com> Date: Fri, 1 Aug 2025 15:07:33 +0800 Subject: [PATCH 3/4] doc: specify pytorch backend Co-authored-by: Jinzhe Zeng Signed-off-by: LI TIANCHENG <137472077+OutisLi@users.noreply.github.com> --- deepmd/utils/argcheck.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deepmd/utils/argcheck.py b/deepmd/utils/argcheck.py index e1a6887489..d7fc0fc537 100644 --- a/deepmd/utils/argcheck.py +++ b/deepmd/utils/argcheck.py @@ -3137,7 +3137,7 @@ def training_args( ) doc_disp_training = "Displaying verbose information during training." doc_time_training = "Timing during training." - doc_profiling = "Export the profiling results to the Chrome JSON file for performance analysis, driven by the legacy TensorFlow profiling API or PyTorch Profiler. The output file will be saved to `profiling_file`. When enable_profiler is True, this option is ignored, since the profiling results will be saved to the TensorBoard log." + doc_profiling = "Export the profiling results to the Chrome JSON file for performance analysis, driven by the legacy TensorFlow profiling API or PyTorch Profiler. The output file will be saved to `profiling_file`. In the PyTorch backend, when enable_profiler is True, this option is ignored, since the profiling results will be saved to the TensorBoard log." doc_profiling_file = "Output file for profiling." doc_enable_profiler = "Export the profiling results to the TensorBoard log for performance analysis, driven by TensorFlow Profiler (available in TensorFlow 2.3) or PyTorch Profiler. The log will be saved to `tensorboard_log_dir`." doc_tensorboard = "Enable tensorboard" From 92496f44e535d66d794d15ce8980886b6cc425ff Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sun, 10 Aug 2025 08:14:57 +0000 Subject: [PATCH 4/4] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- deepmd/utils/argcheck.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/deepmd/utils/argcheck.py b/deepmd/utils/argcheck.py index c8772db038..e446674db7 100644 --- a/deepmd/utils/argcheck.py +++ b/deepmd/utils/argcheck.py @@ -3137,7 +3137,9 @@ def training_args( ) doc_disp_training = "Displaying verbose information during training." doc_time_training = "Timing during training." - doc_disp_avg = "Display the average loss over the display interval for training sets." + doc_disp_avg = ( + "Display the average loss over the display interval for training sets." + ) doc_profiling = "Export the profiling results to the Chrome JSON file for performance analysis, driven by the legacy TensorFlow profiling API or PyTorch Profiler. The output file will be saved to `profiling_file`. In the PyTorch backend, when enable_profiler is True, this option is ignored, since the profiling results will be saved to the TensorBoard log." doc_profiling_file = "Output file for profiling." doc_enable_profiler = "Export the profiling results to the TensorBoard log for performance analysis, driven by TensorFlow Profiler (available in TensorFlow 2.3) or PyTorch Profiler. The log will be saved to `tensorboard_log_dir`."