Skip to content
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

PyTorch adapter: add a way to disable cache updates #5549

Merged
merged 5 commits into from
Jan 6, 2023

Conversation

SpecLad
Copy link
Contributor

@SpecLad SpecLad commented Jan 4, 2023

Motivation and context

This will let users to run their PyTorch code without network access, provided that they have already cached the data.

How has this been tested?

Unit tests.

Checklist

License

  • I submit my code changes under the same MIT License that covers the project.
    Feel free to contact the maintainers if that's a concern.

@SpecLad SpecLad marked this pull request as ready for review January 4, 2023 17:33
@nmanovic nmanovic removed the request for review from azhavoro January 5, 2023 09:12
@SpecLad SpecLad force-pushed the cache-only-mode branch 2 times, most recently from 170fad2 to 5f507d3 Compare January 5, 2023 11:33
@@ -42,6 +42,7 @@ def __init__(
label_name_to_index: Mapping[str, int] = None,
task_filter: Optional[Callable[[models.ITaskRead], bool]] = None,
include_subsets: Optional[Container[str]] = None,
update_policy: UpdatePolicy = UpdatePolicy.IF_MISSING_OR_STALE,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest to allow CacheManager instances too, especially in the TaskVisionDataset class. This should simplify testing, using custom cache controllers, and, the most important, will allow to use a single cache controller in the multi-threaded scenario.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't want to expose the CacheManager interface to the public; it's pretty ad-hoc, and I didn't design it to be user-extensible.

and, the most important, will allow to use a single cache controller in the multi-threaded scenario.

Can you elaborate on this?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I understand this. I've also double-checked the cache object calls, they seem to be safe. It's just that the users need to think if these operations are thread-safe or not.

Copy link
Contributor

@nmanovic nmanovic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@nmanovic nmanovic merged commit 33c624a into cvat-ai:develop Jan 6, 2023
@SpecLad SpecLad deleted the cache-only-mode branch March 16, 2023 18:04
mikhail-treskin pushed a commit to retailnext/cvat that referenced this pull request Jul 1, 2023
This will let users to run their PyTorch code without network access,
provided that they have already cached the data.

### How has this been tested?
<!-- Please describe in detail how you tested your changes.
Include details of your testing environment, and the tests you ran to
see how your change affects other areas of the code, etc. -->
Unit tests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants