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

update docstring and eval with overrides #6241

Closed
wants to merge 2 commits into from

Conversation

wyli
Copy link
Contributor

@wyli wyli commented Mar 27, 2023

  • docstring updates
  • Compose execute with start=None

Types of changes

  • Non-breaking change (fix or new feature that would not break existing functionality).
  • Breaking change (fix or new feature that would cause existing functionality to change).
  • New tests added to cover the changes.
  • Integration tests passed locally by running ./runtests.sh -f -u --net --coverage.
  • Quick tests passed locally by running ./runtests.sh --quick --unittests --disttests.
  • In-line docstrings updated.
  • Documentation updated, tested make html command in the docs/ folder.

@wyli wyli requested a review from atbenmurray March 27, 2023 11:58
@wyli wyli mentioned this pull request Mar 27, 2023
7 tasks
Signed-off-by: Wenqi Li <wenqil@nvidia.com>
Signed-off-by: Wenqi Li <wenqil@nvidia.com>
@ericspod
Copy link
Member

@atbenmurray is planning on making some changes to a number of aspects this PR touches so perhaps we wait on this one a bit.

@atbenmurray
Copy link
Contributor

Still need a pause on this one for the moment

@@ -345,8 +345,7 @@ def _post_transform(self, item_transformed):
first_random = self.transform.get_index_of_first(
lambda t: isinstance(t, RandomizableTrait) or not isinstance(t, Transform)
)
if first_random is not None:
item_transformed = self.transform(item_transformed, start=first_random)
item_transformed = self.transform(item_transformed, start=first_random)
Copy link
Contributor

Choose a reason for hiding this comment

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

execute shouldn't have to handle start is None I think

"""
end_ = len(transforms) if end is None else end
if start is None:
raise ValueError(f"'start' ({start}) cannot be None")
input_ = evaluate_with_overrides(
Copy link
Contributor

Choose a reason for hiding this comment

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

I am not sure this is the correct way to handle this issue. I know you are trying to isolate dataset from changes, but I don't understand why evaluate_with_overrides needs to be called

Copy link
Contributor

Choose a reason for hiding this comment

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

In any case, please hold off on this for now until I have assembled the PR that refactors some of this code for simplicity.

Copy link
Contributor Author

@wyli wyli Mar 28, 2023

Choose a reason for hiding this comment

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

mainly to replicate this line on the dev branch:

item_transformed = self.transform.evaluate_with_overrides(item_transformed, None)

so that the final transform always gets the pending operations evaluated

#6224 (comment)

Copy link
Contributor

Choose a reason for hiding this comment

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

If first_random is None, that means your entire compose was run before the item was cached, which would include the final evaluation. When the item is loaded from the cache, it has no pending transforms, so you have no way for pending transforms to be added that would then need to be evaluated

@atbenmurray
Copy link
Contributor

As per the review on #6244, if we agree that we aren't supporting caching of pending transforms, we can close this PR without a merge.

@wyli wyli closed this Mar 28, 2023
@wyli wyli deleted the resolves-lazy-eval branch March 28, 2023 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants