Changing 1-to-M behaviour of on_disk_cache.#810
Closed
VitalyFedyunin wants to merge 3 commits intogh/VitalyFedyunin/23/basefrom
Closed
Changing 1-to-M behaviour of on_disk_cache.#810VitalyFedyunin wants to merge 3 commits intogh/VitalyFedyunin/23/basefrom
VitalyFedyunin wants to merge 3 commits intogh/VitalyFedyunin/23/basefrom
Conversation
[ghstack-poisoned]
Contributor
Author
|
@VitalyFedyunin has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
ejguan
approved these changes
Oct 6, 2022
| if filepath_fn is not None: | ||
| _check_unpickable_fn(filepath_fn) | ||
| filepath_fn = _generator_to_list(filepath_fn) if inspect.isgeneratorfunction(filepath_fn) else filepath_fn | ||
| assert not inspect.isgeneratorfunction(filepath_fn) # BC breaking, now only str is accepted as return |
Contributor
There was a problem hiding this comment.
Then, we need to change the dataset implementation from TorchText side. e.g.: https://github.com/pytorch/text/blob/ff1fdfce8ac030a11638b2d94d54364144586253/torchtext/datasets/imdb.py#L107
Comment on lines
+274
to
+276
| todo_dp: Any | ||
| cached_dp: Any | ||
| one_many_cached_dp: Any |
Contributor
There was a problem hiding this comment.
nit: annotated as IterDataPipe
TLDR: If filename_fn of on_disk_cache ( filename_fn'1 ) generates different name from filename_fn of end_caching, it is considered 1 to many situation. In this case additional listing file would be created at filename_fn'1 position and it will be used to check cache consistency between runs. BC breaking, on_disk_cache no longer accept generators as `filename_fn` Differential Revision: [D40148560](https://our.internmc.facebook.com/intern/diff/D40148560) [ghstack-poisoned]
Contributor
Author
|
@VitalyFedyunin has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
TLDR: If filename_fn of on_disk_cache ( filename_fn'1 ) generates different name from filename_fn of end_caching, it is considered 1 to many situation. In this case additional listing file would be created at filename_fn'1 position and it will be used to check cache consistency between runs. BC breaking, on_disk_cache no longer accept generators as `filename_fn` Differential Revision: [D40148560](https://our.internmc.facebook.com/intern/diff/D40148560) [ghstack-poisoned]
Contributor
Author
|
@VitalyFedyunin has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
VitalyFedyunin
added a commit
to pytorch/text
that referenced
this pull request
Oct 12, 2022
Fixed issues with cache locks and cache files overwrites. Required to be compatible with meta-pytorch/data#810 [ghstack-poisoned]
VitalyFedyunin
added a commit
to pytorch/text
that referenced
this pull request
Oct 13, 2022
Fixed issues with cache locks and cache files overwrites. Required to be compatible with meta-pytorch/data#810 [ghstack-poisoned]
Nayef211
pushed a commit
to pytorch/text
that referenced
this pull request
Oct 13, 2022
* Fixed on_disk_cache issues [ghstack-poisoned] * Update on "Fixed on_disk_cache issues" Fixed issues with cache locks and cache files overwrites. Required to be compatible with meta-pytorch/data#810 [ghstack-poisoned] * Update on "Fixed on_disk_cache issues" Fixed issues with cache locks and cache files overwrites. Required to be compatible with meta-pytorch/data#810 [ghstack-poisoned]
joecummings
added a commit
to pytorch/text
that referenced
this pull request
Oct 14, 2022
* Fixed on_disk_cache issues [ghstack-poisoned] * Update on "Fixed on_disk_cache issues" Fixed issues with cache locks and cache files overwrites. Required to be compatible with meta-pytorch/data#810 [ghstack-poisoned] * Update on "Fixed on_disk_cache issues" Fixed issues with cache locks and cache files overwrites. Required to be compatible with meta-pytorch/data#810 [ghstack-poisoned] Co-authored-by: Vitaly Fedyunin <vitalyf@fb.com>
This was referenced Oct 20, 2022
ejguan
pushed a commit
to ejguan/text
that referenced
this pull request
Oct 20, 2022
* Fixed on_disk_cache issues [ghstack-poisoned] * Update on "Fixed on_disk_cache issues" Fixed issues with cache locks and cache files overwrites. Required to be compatible with meta-pytorch/data#810 [ghstack-poisoned] * Update on "Fixed on_disk_cache issues" Fixed issues with cache locks and cache files overwrites. Required to be compatible with meta-pytorch/data#810 [ghstack-poisoned] Co-authored-by: Vitaly Fedyunin <vitalyf@fb.com>
ejguan
pushed a commit
to ejguan/data
that referenced
this pull request
Oct 20, 2022
Summary: Pull Request resolved: meta-pytorch#810 TLDR: If filename_fn of on_disk_cache ( filename_fn'1 ) generates different name from filename_fn of end_caching, it is considered 1 to many situation. In this case additional listing file would be created at filename_fn'1 position and it will be used to check cache consistency between runs. BC breaking, on_disk_cache no longer accept generators as `filename_fn` Test Plan: Imported from OSS Reviewed By: ejguan Differential Revision: D40148560 Pulled By: VitalyFedyunin fbshipit-source-id: 3bb9c5f32546a3d4859cff6bda0cc84234312ab7
ejguan
pushed a commit
that referenced
this pull request
Oct 20, 2022
Summary: Pull Request resolved: #810 TLDR: If filename_fn of on_disk_cache ( filename_fn'1 ) generates different name from filename_fn of end_caching, it is considered 1 to many situation. In this case additional listing file would be created at filename_fn'1 position and it will be used to check cache consistency between runs. BC breaking, on_disk_cache no longer accept generators as `filename_fn` Test Plan: Imported from OSS Reviewed By: ejguan Differential Revision: D40148560 Pulled By: VitalyFedyunin fbshipit-source-id: 3bb9c5f32546a3d4859cff6bda0cc84234312ab7
abhinavarora
pushed a commit
to pytorch/text
that referenced
this pull request
Oct 21, 2022
* Fixed on_disk_cache issues [ghstack-poisoned] * Update on "Fixed on_disk_cache issues" Fixed issues with cache locks and cache files overwrites. Required to be compatible with meta-pytorch/data#810 [ghstack-poisoned] * Update on "Fixed on_disk_cache issues" Fixed issues with cache locks and cache files overwrites. Required to be compatible with meta-pytorch/data#810 [ghstack-poisoned] Co-authored-by: Vitaly Fedyunin <vitalyf@fb.com> Co-authored-by: Joe Cummings <jrcummings@fb.com> Co-authored-by: Vitaly Fedyunin <vitalyf@fb.com>
ejguan
pushed a commit
to ejguan/data
that referenced
this pull request
Oct 23, 2022
Summary: Pull Request resolved: meta-pytorch#810 TLDR: If filename_fn of on_disk_cache ( filename_fn'1 ) generates different name from filename_fn of end_caching, it is considered 1 to many situation. In this case additional listing file would be created at filename_fn'1 position and it will be used to check cache consistency between runs. BC breaking, on_disk_cache no longer accept generators as `filename_fn` Test Plan: Imported from OSS Reviewed By: ejguan Differential Revision: D40148560 Pulled By: VitalyFedyunin fbshipit-source-id: 3bb9c5f32546a3d4859cff6bda0cc84234312ab7
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TLDR: If filename_fn of on_disk_cache ( filename_fn'1 ) generates different name from filename_fn of end_caching, it is considered 1 to many situation. In this case additional listing file would be created at filename_fn'1 position and it will be used to check cache consistency between runs.
BC breaking, on_disk_cache no longer accept generators as
filename_fnStack from ghstack (oldest at bottom):
Differential Revision: D40148560