!2965 [pytorch][cleancode]cleancode for parallel_state

Merge pull request !2965 from jzh/2.1.0
This commit is contained in:
jzh
2025-07-05 02:56:48 +00:00
committed by i-robot
parent bcc5f2dbc7
commit 80dca6c59d

View File

@@ -51,13 +51,13 @@ logging.basicConfig(level=logging.WARN, format='%(asctime)s - %(levelname)s - %(
try:
from mindspeed.core.pipeline_parallel.dualpipev.dualpipev_schedules import get_post_process_flag
except Exception as e:
logging.warning(f"Failed to import get_post_process_flag: {e}")
except Exception as warn_get_post_process_flag:
logging.warning(f"Failed to import get_post_process_flag: {warn_get_post_process_flag}")
try:
_torch_version = PkgVersion(torch.__version__)
except Exception as e:
logging.warning(f"Failed to get torch version: {e}")
except Exception as warn_torch_ver:
logging.warning(f"Failed to get torch version: {warn_torch_ver}")
# 这是一个特殊情况用于构建文档时torch未被导入
_torch_version = PkgVersion("0.0.0")
logging.warning("Using default torch version '0.0.0' for documentation build.")