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

Add inference to runner #186

Merged
merged 14 commits into from
Feb 22, 2022
Merged

Add inference to runner #186

merged 14 commits into from
Feb 22, 2022

Conversation

mebristo
Copy link
Member

@mebristo mebristo commented Feb 17, 2022

Add inference to the hi-ml runner.

Also in this PR: lightning-bolts is downgraded to 0.4.0 in line with InnerEye, since we are not ready to move over yet

Please follow the guidelines for PRs contained here. Checklist:

  • Ensure that your PR is small, and implements one change.
  • Add unit tests for all functions that you introduced or modified.
  • Run PyCharm's code cleanup tools on your Python files.
  • Ensure that documentation renders correctly in Sphinx (run Sphinx via make html in the `docs folder)
  • Link the correct GitHub issue for tracking.
  • Update the Changelog file: Describe your change in terms of
    Added/Changed/Removed/... in the "Upcoming" section.
  • When merging your PR, replace the default merge message with a brief description of your PR,
    and if needed a motivation why that change was required.

hi-ml/testhiml/testhiml/test_run_ml.py Outdated Show resolved Hide resolved
hi-ml/src/health_ml/run_ml.py Outdated Show resolved Hide resolved
Comment on lines +36 to +38
@dataclass(frozen=True)
class RunRecovery:
"""
Copy link
Collaborator

Choose a reason for hiding this comment

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

Which of the bits are really essential? Can we simplify? At the moment, it seems to be a glorified list, even though we use at most 1 checkpoint, or?

Copy link
Member Author

Choose a reason for hiding this comment

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

@ant0nsc - can I propose to look into this and the CheckpointHandler today, but make changes in a separate PR when I am back?

hi-ml/src/health_ml/model_inference_config.py Outdated Show resolved Hide resolved
hi-ml/src/health_ml/utils/checkpoint_utils.py Outdated Show resolved Hide resolved
for p in self.checkpoints_roots:
logging.info(str(p))


class CheckpointHandler:
Copy link
Collaborator

Choose a reason for hiding this comment

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

The dreaded checkpointhandler... (or at least I dread it). which parts of that could we strip out? I never fully got the purpose of this class.

hi-ml/src/health_ml/run_ml.py Outdated Show resolved Hide resolved
@mebristo mebristo merged commit fed8220 into main Feb 22, 2022
@mebristo mebristo deleted the mebristo/add_inference branch February 22, 2022 13:31
@@ -11,46 +11,31 @@ dependencies:
- python-blosc==1.7.0
- torchvision=0.11.1
- pip:
- -r ../test_requirements.txt
Copy link
Contributor

@vale-salvatelli vale-salvatelli Feb 22, 2022

Choose a reason for hiding this comment

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

shouldn't be the other way round? I think test_requirements should include all the requirements of the package plus optionally other packages required for testing.
I think a developer will naturally update the package environment if something new is needed while developing and the current setup will not ensure the tests environment will also be updated

Copy link
Contributor

Choose a reason for hiding this comment

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

or maybe I don't understand correctly what test_requirements.txt is used for? if it's more of a generic hi-ml package requirement file maybe we can rename it?

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