forked from mindspore-Ecosystem/mindspore
!6090 [MD] Temporarily disable DatasetCache for the current release
Merge pull request !6090 from lixiachen/disable_cache
This commit is contained in:
commit
f450d324bb
|
@ -37,10 +37,12 @@ int main(int argc, char **argv) {
|
|||
warningMsg += "WARNING:\n";
|
||||
warningMsg += "cache_admin and the cache server that it controls are currently only used for experimental research";
|
||||
warningMsg += " purposes at this time.\n";
|
||||
warningMsg += "It is not intended for general availability yet as it may not be stable. Use it at your own risk.\n";
|
||||
warningMsg += "This command is currently disabled. Quitting.\n";
|
||||
|
||||
// A warning message until the code is mature enough.
|
||||
std::cerr << warningMsg << std::endl;
|
||||
// temporary disable cache feature in the current release
|
||||
return 0;
|
||||
|
||||
if (argc == 1) {
|
||||
args.Help();
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
"""
|
||||
|
||||
import copy
|
||||
from mindspore._c_dataengine import CacheClient
|
||||
# from mindspore._c_dataengine import CacheClient
|
||||
|
||||
from ..core.validator_helpers import type_check, check_uint32, check_uint64
|
||||
|
||||
|
@ -38,7 +38,9 @@ class DatasetCache:
|
|||
self.hostname = hostname
|
||||
self.port = port
|
||||
self.prefetch_size = prefetch_size
|
||||
self.cache_client = CacheClient(session_id, size, spilling, hostname, port, prefetch_size)
|
||||
# temporary disable cache feature in the current release
|
||||
# self.cache_client = CacheClient(session_id, size, spilling, hostname, port, prefetch_size)
|
||||
self.cache_client = None
|
||||
|
||||
def GetStat(self):
|
||||
return self.cache_client.GetStat()
|
||||
|
|
|
@ -31,7 +31,7 @@ from ..core.validator_helpers import parse_user_args, type_check, type_check_lis
|
|||
|
||||
from . import datasets
|
||||
from . import samplers
|
||||
from . import cache_client
|
||||
# from . import cache_client
|
||||
from .. import callback
|
||||
|
||||
|
||||
|
@ -56,6 +56,9 @@ def check_imagefolderdataset(method):
|
|||
validate_dataset_param_value(nreq_param_dict, param_dict, dict)
|
||||
check_sampler_shuffle_shard_options(param_dict)
|
||||
|
||||
cache = param_dict.get('cache')
|
||||
check_cache_option(cache)
|
||||
|
||||
return method(self, *args, **kwargs)
|
||||
|
||||
return new_method
|
||||
|
@ -136,6 +139,9 @@ def check_tfrecorddataset(method):
|
|||
|
||||
check_sampler_shuffle_shard_options(param_dict)
|
||||
|
||||
cache = param_dict.get('cache')
|
||||
check_cache_option(cache)
|
||||
|
||||
return method(self, *args, **kwargs)
|
||||
|
||||
return new_method
|
||||
|
@ -389,6 +395,9 @@ def check_random_dataset(method):
|
|||
|
||||
check_sampler_shuffle_shard_options(param_dict)
|
||||
|
||||
cache = param_dict.get('cache')
|
||||
check_cache_option(cache)
|
||||
|
||||
return method(self, *args, **kwargs)
|
||||
|
||||
return new_method
|
||||
|
@ -568,8 +577,7 @@ def check_map(method):
|
|||
if num_parallel_workers is not None:
|
||||
check_num_parallel_workers(num_parallel_workers)
|
||||
type_check(python_multiprocessing, (bool,), "python_multiprocessing")
|
||||
if cache is not None:
|
||||
type_check(cache, (cache_client.DatasetCache,), "cache")
|
||||
check_cache_option(cache)
|
||||
|
||||
if callbacks is not None:
|
||||
if isinstance(callbacks, (list, tuple)):
|
||||
|
@ -1211,3 +1219,11 @@ def check_paddeddataset(method):
|
|||
return method(self, *args, **kwargs)
|
||||
|
||||
return new_method
|
||||
|
||||
|
||||
def check_cache_option(cache):
|
||||
"""Sanity check for cache parameter"""
|
||||
if cache is not None:
|
||||
# temporary disable cache feature in the current release
|
||||
# type_check(cache, (cache_client.DatasetCache,), "cache")
|
||||
raise ValueError("Caching is disabled in the current release")
|
||||
|
|
Loading…
Reference in New Issue