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

Fix __len__ of IterableDistributedAnnDataCollectionDataset #93

Merged
merged 5 commits into from
Oct 19, 2023

Conversation

ordabayevy
Copy link
Contributor

@ordabayevy ordabayevy commented Oct 17, 2023

The len of iterable dataset should return the number of batches per replica. This fixes the previous bug in the progress bar where it would show the total number of cell as the number of steps per epoch.

Another bug that is fixed is running multiple devices with new cellarium.ml.cli module. Instead of changing sys.argv this PR copies it and passes it to the model_cli as args.

Also enabled multi devices testing for scripts (#44).

@ordabayevy ordabayevy added bug Something isn't working awaiting review labels Oct 17, 2023
@ordabayevy ordabayevy linked an issue Oct 17, 2023 that may be closed by this pull request
@ordabayevy ordabayevy requested a review from mbabadi October 17, 2023 20:51
@@ -336,9 +337,13 @@ def main(args: ArgsType = None) -> None:
elif isinstance(args, list):
model_name = args.pop(0)
elif args is None:
model_name = sys.argv.pop(1)
args = sys.argv[1:].copy()
model_name = args.pop(0)
Copy link
Member

Choose a reason for hiding this comment

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

here and in other conditions, please assert that args (or argv) is well-formed (e.g. args has at least one element if it is a list, args has "model_name" key if it is a dict or Namespace, etc.) and produce an informative exception message. Also, check that model_name is in REGISTERED_MODELS and if not, produce another informative exception message (e.g. the provided model name "blah blah" is invalid. Valid options are: {list(REGISTERED_MODELS.keys())}).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Great suggestion!

Copy link
Member

@mbabadi mbabadi left a comment

Choose a reason for hiding this comment

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

Just a small thing.

mbabadi

This comment was marked as duplicate.

@ordabayevy ordabayevy requested a review from mbabadi October 19, 2023 17:53
@ordabayevy ordabayevy merged commit 224b3f2 into main Oct 19, 2023
@ordabayevy ordabayevy deleted the yo-fix-len-iterable-dataset branch October 19, 2023 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting review bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Re-enable _multi_device in test_examples
2 participants