Synchronize between uploading file and generating index thread#4443
Open
wwwjn wants to merge 64 commits into
Open
Synchronize between uploading file and generating index thread#4443wwwjn wants to merge 64 commits into
wwwjn wants to merge 64 commits into
Conversation
epicfaace
requested changes
Apr 26, 2023
epicfaace
left a comment
Member
There was a problem hiding this comment.
Can you please remove the .pyc files? Also let's add them to .gitignore
epicfaace
reviewed
May 31, 2023
| account_name=AZURE_BLOB_ACCOUNT_NAME, | ||
| container_name=AZURE_BLOB_CONTAINER_NAME, | ||
| account_key=AZURE_BLOB_ACCOUNT_KEY, | ||
| expiry=datetime.datetime.now() + datetime.timedelta(hours=1), |
Member
There was a problem hiding this comment.
Should we refactor this into a constant? Also, is 10 hours enough or might we need more for even larger files?
| self._current_max_buf_length = len(self._bufs[0]) | ||
| for i in range(1, self.NUM_READERS): | ||
| self._current_max_buf_length = max(self._current_max_buf_length, len(self._bufs[i])) | ||
| # print(f"find largest buffer: {self._current_max_buf_length} in thread: {threading.current_thread().name}") |
| """ | ||
| NUM_READERS = 2 | ||
|
|
||
| # MAX memory usage <= MAX_BUF_SIZE + max(num_bytes called in read) |
Member
There was a problem hiding this comment.
What does this comment mean? Can you add a description of what MAX_BUF_SIZE is used for?
| NUM_READERS = 2 | ||
|
|
||
| # MAX memory usage <= MAX_BUF_SIZE + max(num_bytes called in read) | ||
| MAX_BUF_SIZE = 1024 * 1024 * 1024 # 10 MiB for test |
Member
There was a problem hiding this comment.
What value should it be for non-test?
| self.find_largest_buffer() | ||
|
|
||
| def find_largest_buffer(self): | ||
| self._current_max_buf_length = len(self._bufs[0]) |
|
|
||
| def check_file_target_contents(self, target): | ||
| """Checks to make sure that the specified file has the contents 'hello world'.""" | ||
| # This can not be checked, Since |
…ksheets into parallel-upload-sync
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.
Reasons for making this change
#4370 does not have synchronization between threads (upload file thread and generate index thread), so it does not work for large files like imagenet (158 GB).
Related issues
Screenshots
Checklist