Conversation
…llection for retrieval
- Added concurrent processing for batch computations using ThreadPoolExecutor. documentation. - Indexed `positive_pairs` directly instead of creating a one-hot tensor.
fcogidi
approved these changes
Feb 19, 2025
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.
PR Type
Feature
Short Description
Reduces RAM usage by the retrieval pipeline by:
mmlearn/modules/metrics/retrieval_recall.pyin batches instead of all at once.MetricCollectioninmmlearn/tasks/zero_shot_retrieval.pyfor all modality-pairs to avoid duplicate tensors creations.TODOs:
retrieval_recall.pyandzero_shot_retrieval.pywithout providing an option to use the previous implementation. This option needs to be added.Tests Added
You can run retrieval by:
mmlearn_run 'hydra.searchpath=[pkg://projects.med_benchmarking.configs]' +experiment=baseline experiment_name=test_eval job_type=eval datasets@datasets.test=ROCO datasets.test.split=test +datasets/tokenizers@dataloader.test.collate_fn.batch_processors.text=HFCLIPTokenizer +datasets/transforms@datasets.test.transform=med_clip_vision_transform datasets.test.transform.job_type=eval dataloader.test.batch_size=32 dataloader.test.num_workers=4However, W&B does not log RAM usage during recall@k calculation. You need to manually add logging lines and compare RAM usage of this implementation vs. the previous one.