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

Make convert_time as State method #2431

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

priba
Copy link
Contributor

@priba priba commented Aug 13, 2023

What does this PR do?

This PR exposes _convert_time into the API. As discussed in the related issue, it has been converted into a State method.

What issue(s) does this change relate to?

Addresses issue #2426

Before submitting

  • [ x] Have you read the contributor guidelines?
  • Is this change a documentation change or typo fix? If so, skip the rest of this checklist.
  • Was this change discussed/approved in a GitHub issue first? It is much more likely to be merged if so.
  • Did you update any related docs and document your change?
  • Did you update any related tests and add any new tests related to your change? (see testing)
  • Did you run the tests locally to make sure they pass?
  • Did you run pre-commit on your change? (see the pre-commit section of prerequisites)

@priba priba requested a review from a team as a code owner August 13, 2023 22:24
if self.dataloader_len is None:
raise RuntimeError('Cannot convert time, as state.dataloader_len is None.')
return Time(
int(time.value * int(self.dataloader_len) * self.max_duration.value),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mvpatel2000, I am not sure if we should apply ssr here. I decided to keep the original implementation but I do not see any reason to apply this scaling once the TimeUnit has changed to BATCH. Similarly to the elif case.

Copy link
Contributor

Choose a reason for hiding this comment

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

Hm... i think we probably shouldn't apply SSR here.

Do you mind if I directly touch your PR? There's a few other places we use a similar function (eg runtime estimator) and I think it could be good to consolidate into this API.

Also, apologies for the delay in review. We're in the middle of a release so we're freezing everything but bug fixes. I'll make sure this gets into the next release (0.16.1) which will come very soon after 0.16 (likely a weekish?)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No worries, feel free to edit the PR 😄

Thanks for your efforts. I am happy to keep contributing with PRs or Issues if I find something.

Let me know if I can help.

Copy link
Contributor

Choose a reason for hiding this comment

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

@priba apologies for the delay, this might be on the backburner for a few weeks. Really slammed with other things. If this is a blocker, please let me know and we can try landing a smaller solution. However, I'd really like to get to the full solution and make this much easier for everyone.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No problem, we already have a workaround. Although it would be a nice feature, I understand it is not a high priority :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @mvpatel2000 , are there any news regarding this PR?

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry, I wasn't able to get to it yet. I will make sure to prioritize over next 2-3 weeks!

Copy link
Contributor

Choose a reason for hiding this comment

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

@priba sorry for delay, I still haven't gotten to it. I will make sure to do in January though. I keep getting pre-empted with higher priority items

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.

2 participants