diff --git a/cmake/external_libs/sentencepiece.cmake b/cmake/external_libs/sentencepiece.cmake index c3954df527..be17040000 100644 --- a/cmake/external_libs/sentencepiece.cmake +++ b/cmake/external_libs/sentencepiece.cmake @@ -15,7 +15,7 @@ if(WIN32) VER 0.1.92 LIBS sentencepiece sentencepiece_train URL ${REQ_URL} - CMAKE_OPTION -DCMAKE_BUILD_TYPE=Release -DSPM_USE_BUILTIN_PROTOBUF=ON + CMAKE_OPTION -DCMAKE_BUILD_TYPE=Release -DSPM_USE_BUILTIN_PROTOBUF=ON -DSPM_ENABLE_SHARED=OFF MD5 ${MD5} ) else() diff --git a/mindspore/ccsrc/debug/common.cc b/mindspore/ccsrc/debug/common.cc index d64cfd3256..2cfda34460 100644 --- a/mindspore/ccsrc/debug/common.cc +++ b/mindspore/ccsrc/debug/common.cc @@ -30,13 +30,10 @@ std::optional Common::GetRealPath(const std::string &input_path) { if (input_path.length() >= PATH_MAX) { MS_LOG(EXCEPTION) << "The length of path: " << input_path << " exceeds limit: " << PATH_MAX; } -#if defined(SYSTEM_ENV_POSIX) - size_t path_split_pos = input_path.find_last_of('/'); -#elif defined(SYSTEM_ENV_WINDOWS) - size_t path_split_pos = input_path.find_last_of('\\'); -#else - MS_LOG(EXCEPTION) << "Unsupported platform."; -#endif + auto path_split_pos = input_path.find_last_of('/'); + if (path_split_pos == std::string::npos) { + path_split_pos = input_path.find_last_of('\\'); + } // get real path char real_path[PATH_MAX] = {0}; // input_path is dir + file_name diff --git a/mindspore/dataset/core/config.py b/mindspore/dataset/core/config.py index 02137f128f..a4c1d0d15e 100644 --- a/mindspore/dataset/core/config.py +++ b/mindspore/dataset/core/config.py @@ -17,6 +17,7 @@ The configuration module provides various functions to set and get the supported configuration parameters, and read a configuration file. """ import os +import platform import random import time import numpy @@ -428,6 +429,10 @@ def get_enable_shared_mem(): >>> # Get the flag of shared memory feature. >>> shared_mem_flag = ds.config.get_enable_shared_mem() """ + # For windows we forbid shared mem function temporarily + if platform.system().lower() == 'windows': + logger.warning("For windows we forbid shared mem function temporarily.") + return False return _config.get_enable_shared_mem() diff --git a/mindspore/dataset/engine/datasets.py b/mindspore/dataset/engine/datasets.py index b1c892cbd6..38d0279698 100644 --- a/mindspore/dataset/engine/datasets.py +++ b/mindspore/dataset/engine/datasets.py @@ -2150,7 +2150,8 @@ class BatchDataset(Dataset): res_q_list = [] # Register clean zombie subprocesses signal here - signal.signal(signal.SIGCHLD, wait_child_processes) + if platform.system().lower() != "windows": + signal.signal(signal.SIGCHLD, wait_child_processes) # If user didn't specify num_parallel_workers, set it to default if self.num_parallel_workers is not None: @@ -2648,7 +2649,8 @@ class MapDataset(Dataset): if callable_list: # Register clean zombie subprocesses signal here - signal.signal(signal.SIGCHLD, wait_child_processes) + if platform.system().lower() != "windows": + signal.signal(signal.SIGCHLD, wait_child_processes) # Construct pool with the callable list # The callable list and _pyfunc_worker_init are used to pass lambda function in to subprocesses @@ -3594,7 +3596,8 @@ class SamplerFn: # Event for end of epoch if multi_process is True: # Register clean zombie subprocesses signal here - signal.signal(signal.SIGCHLD, wait_child_processes) + if platform.system().lower() != "windows": + signal.signal(signal.SIGCHLD, wait_child_processes) try: self.eof = multiprocessing.Event() diff --git a/tests/st/dump/test_data_dump.py b/tests/st/dump/test_data_dump.py index b52ce79284..0cedb6d583 100644 --- a/tests/st/dump/test_data_dump.py +++ b/tests/st/dump/test_data_dump.py @@ -113,7 +113,7 @@ def test_e2e_dump(): run_e2e_dump() -@pytest.mark.level0 +@pytest.mark.level1 @pytest.mark.platform_arm_ascend_training @pytest.mark.platform_x86_ascend_training @pytest.mark.env_onecard