-
Notifications
You must be signed in to change notification settings - Fork 178
Makes prefetcher none cache default #992
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -2313,7 +2313,7 @@ def __init__( | |||||||||||||||||||||||||||||||||||||||||||||||||
| mode="rb", | ||||||||||||||||||||||||||||||||||||||||||||||||||
| block_size=DEFAULT_BLOCK_SIZE, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| autocommit=True, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| cache_type="readahead", | ||||||||||||||||||||||||||||||||||||||||||||||||||
| cache_type=None, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| cache_options=None, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| acl=None, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| consistency="md5", | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -2376,6 +2376,24 @@ def __init__( | |||||||||||||||||||||||||||||||||||||||||||||||||
| raise OSError("Attempt to open a bucket") | ||||||||||||||||||||||||||||||||||||||||||||||||||
| self.generation = _coalesce_generation(generation, path_generation) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| self.concurrency = kwargs.get("concurrency", DEFAULT_CONCURRENCY) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| # Ideally, all of these fields should be part of `cache_options`. Because current | ||||||||||||||||||||||||||||||||||||||||||||||||||
| # `fsspec` caches do not accept arbitrary `*args` and `**kwargs`, passing them | ||||||||||||||||||||||||||||||||||||||||||||||||||
| # there currently causes instantiation errors. We are holding off on introducing | ||||||||||||||||||||||||||||||||||||||||||||||||||
| # them as explicit keyword arguments to ensure existing user workloads are not | ||||||||||||||||||||||||||||||||||||||||||||||||||
| # disrupted. This will be refactored once the upstream `fsspec` changes are merged. | ||||||||||||||||||||||||||||||||||||||||||||||||||
| if "use_experimental_adaptive_prefetching" in kwargs: | ||||||||||||||||||||||||||||||||||||||||||||||||||
| use_prefetch_reader = bool(kwargs["use_experimental_adaptive_prefetching"]) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| else: | ||||||||||||||||||||||||||||||||||||||||||||||||||
| use_prefetch_reader = os.environ.get( | ||||||||||||||||||||||||||||||||||||||||||||||||||
| "USE_EXPERIMENTAL_ADAPTIVE_PREFETCHING", "true" | ||||||||||||||||||||||||||||||||||||||||||||||||||
| ).lower() in ( | ||||||||||||||||||||||||||||||||||||||||||||||||||
| "true", | ||||||||||||||||||||||||||||||||||||||||||||||||||
| "1", | ||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+2384
to
+2395
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is a discrepancy in how
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| if cache_type is None: | ||||||||||||||||||||||||||||||||||||||||||||||||||
| cache_type = "none" if use_prefetch_reader else "readahead" | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
ankitaluthra1 marked this conversation as resolved.
|
||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| super().__init__( | ||||||||||||||||||||||||||||||||||||||||||||||||||
| gcsfs, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| path, | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -2394,20 +2412,6 @@ def __init__( | |||||||||||||||||||||||||||||||||||||||||||||||||
| self.consistency = consistency | ||||||||||||||||||||||||||||||||||||||||||||||||||
| self.checker = get_consistency_checker(consistency) | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| # Ideally, all of these fields should be part of `cache_options`. Because current | ||||||||||||||||||||||||||||||||||||||||||||||||||
| # `fsspec` caches do not accept arbitrary `*args` and `**kwargs`, passing them | ||||||||||||||||||||||||||||||||||||||||||||||||||
| # there currently causes instantiation errors. We are holding off on introducing | ||||||||||||||||||||||||||||||||||||||||||||||||||
| # them as explicit keyword arguments to ensure existing user workloads are not | ||||||||||||||||||||||||||||||||||||||||||||||||||
| # disrupted. This will be refactored once the upstream `fsspec` changes are merged. | ||||||||||||||||||||||||||||||||||||||||||||||||||
| use_prefetch_reader = kwargs.get( | ||||||||||||||||||||||||||||||||||||||||||||||||||
| "use_experimental_adaptive_prefetching", False | ||||||||||||||||||||||||||||||||||||||||||||||||||
| ) or os.environ.get( | ||||||||||||||||||||||||||||||||||||||||||||||||||
| "USE_EXPERIMENTAL_ADAPTIVE_PREFETCHING", "false" | ||||||||||||||||||||||||||||||||||||||||||||||||||
| ).lower() in ( | ||||||||||||||||||||||||||||||||||||||||||||||||||
| "true", | ||||||||||||||||||||||||||||||||||||||||||||||||||
| "1", | ||||||||||||||||||||||||||||||||||||||||||||||||||
| ) | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| if "r" in mode and use_prefetch_reader: | ||||||||||||||||||||||||||||||||||||||||||||||||||
| max_prefetch_size = kwargs.get("max_prefetch_size", MAX_PREFETCH_SIZE) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| from .prefetcher import BackgroundPrefetcher | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.