Граф коммитов

558 Коммитов

Автор SHA1 Сообщение Дата
dependabot[bot] 163f6f7792
Bump torch from 1.11 to 2.2.0 in /hi-ml-cpath
Bumps [torch](https://github.com/pytorch/pytorch) from 1.11 to 2.2.0.
- [Release notes](https://github.com/pytorch/pytorch/releases)
- [Changelog](https://github.com/pytorch/pytorch/blob/main/RELEASE.md)
- [Commits](https://github.com/pytorch/pytorch/compare/v1.11.0...v2.2.0)

---
updated-dependencies:
- dependency-name: torch
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-25 10:25:40 +00:00
Anton Schwaighofer 3ecea4b23f
ENH: Changes after removing storage account access keys (#946)
Removed storage account keys from AML datastores. This PR handles the
consequences of that.
- Testing with an uploaded private wheel had to be removed because AML
SDK v1 will change a user delegation SAS token to a access-key SAS
token.
- Switch download of test datasets for cpath to mounting of datasets
- Skip some flaky distributed tests
- Use of `AzureCliCredential` rather than `DefaultAzureCredential`
2024-06-28 11:12:00 +01:00
Fernando Pérez-García 664ac09578
ENH: Add support to pass a prefix for hyperparam args (#936)
When `hyperparam_args` is passed, the command is modified to add the
argument in the settings. For example, if the looks like
`{learning_rate: [1, 2, 3]}`, something like
`--learning_rate=${{inputs.learning_rate}}` will be added to the
command. But sometimes we wouldn't want the dashes, e.g., when using
Hydra (`learning_rate=${{inputs.learning_rate}}` or maybe
`+learning_rate=${{inputs.learning_rate}}`). This PR adds support to
specify the prefix for the argument (default: `"--"`). For Hydra, we
might want, e.g., `""` or `"+"`.

<!--
## Guidelines

Please follow the guidelines for pull requests (PRs) in
[CONTRIBUTING](/CONTRIBUTING.md). Checklist:

- Ensure that your PR is small, and implements one change
- Give your PR title one of the prefixes listed in
[CONTRIBUTING](../docs/source/coding_guidelines.md#pull-request-titles)
to indicate what type of change that is
- Link the correct GitHub issue for tracking
- Add unit tests for all functions that you introduced or modified
- Run automatic code formatting / linting on all files ("Format
Document" Shift-Alt-F in VSCode)
- Ensure that documentation renders correctly in Sphinx by running `make
html` in the `docs` folder

## Change the default merge message

When completing your PR, you will be asked for a title and an optional
extended description. By default, the extended description will be a
concatenation of the individual
commit messages. Please DELETE/REPLACE that with a human readable
extended description for non-trivial PRs.
-->
2024-05-15 09:51:11 +01:00
Fernando Pérez-García e31ac35d11
MNT: Bump `hi-ml-multimodal` version (#929)
Publish new version after unpinning dependencies to improve usability.

```shell
make bump_version part=patch
make publish
```
2024-05-13 13:03:50 +01:00
Anton Schwaighofer 9ec8fd4426
MNT: Upgrade to password-free authentication (#925)
Remove the use of Service Principal authentication.
To make this work, I also had to add to modify the Service Principal. In
the "Clients & Secrets" section, add "Federated Credentials". Choose
"Scenario: GitHub Action". Fill in repo details, "Entity Type: Pull
Request". Name does not matter.
2024-04-12 13:26:41 +01:00
Fernando Pérez-García 61a2c4d330
MNT: Update `hi-ml-multimodal` (#928)
Users (including ourselves) keep having issues installing
`hi-ml-multimodal`. I've unpinned the requirements so it's easy to
install and use. I've had to update some bits that were using ancient
versions of e.g. TorchVision. I've checked the notebook and it's working
fine.

Related issues:
- https://github.com/microsoft/hi-ml/issues/927
- https://github.com/microsoft/hi-ml/issues/916
- https://github.com/microsoft/hi-ml/issues/850

Fixes #850.
Fixes #916.
Fixes #927.
2024-04-11 10:16:03 +01:00
Anton Schwaighofer f4e21b78af
ENH: Relax package requirements for hi-ml-azure (#924) 2024-03-21 13:55:10 +00:00
Anton Schwaighofer 97ea3be53e
ENH: Add AzureCLI authentication for SDK v1 codepath (#922)
At present, only ServicePrincipal and InteractiveAuthentication are
supported for AzureML SDK v1. This PR adds AzureCLI as a third option.
This sets the stage for password-free authentication in pipelines
2024-03-19 13:51:35 +00:00
Anton Schwaighofer aebaf3e91e
ENH: Make logging consistent (#921)
Within `hi-ml-azure`, clean up all calls to `logging` and replace with
correctly created module-level logger objects
2024-03-07 12:52:40 +00:00
Anton Schwaighofer 60819a2244
MNT: Delete workflows and switch to built-in tooling (#920) 2024-03-05 11:34:39 +00:00
Anton Schwaighofer 1f9658c8cd
ENH: Remove mount context imports (#919)
Newer versions of the AzureML SDK do not have the `MountContext` object
anymore. Remove any imports of that class.
2024-02-29 16:13:27 +00:00
Anton Schwaighofer c606808b20
ENH: Enable single-node MPI jobs with SDK v1 (#914)
Extend the `use_mpi_run_for_single_node_jobs` flag to SDK v1 jobs
2023-11-13 10:48:44 +00:00
Anton Schwaighofer 1cf19cce04
ENH: Upgrade to Python 3.9 and package update (#910)
- Upgrade to Python 3.9 as a minimum
- Upgrade pillow because of security alerts. This required some API
changes and update of test result images
- The behaviour of the `LogCaptureFixture` changed, requiring changes
from `logging.info` to `logger.info`
- Downgraded `black` from 23 to 22 because of version constraints
- Changes in calls to `WorkflowParams` because of `mypy` issues that
were not detected until now
- `hi-ml-azure` now also has its own minimal Conda dev environment
2023-11-09 13:17:38 +00:00
Anton Schwaighofer 2d8a380108
ENH: Allow command in script run config (#909) 2023-11-08 12:41:46 +00:00
Anton Schwaighofer 83df149051
ENH: Apply security fixes (#912) 2023-11-07 09:26:29 +00:00
Anton Schwaighofer f3525192e1
BUG: Allow relative path for entry script for SDK v2 submission (#904)
When submitting a script with a path relative to current working
directory, SDK v2 raises an error, even though the script exists.

Closes #890
2023-11-02 14:40:27 +00:00
Anton Schwaighofer 1a754d8fcc
MNT: Disable PyRight (#906)
Remove pyright from PR builds. At present, this constantly fails because
the disk is full. This blocks the release of new packages
2023-07-28 10:27:39 +01:00
Anton Schwaighofer f51a40860c
ENH: Single node runs for SDK v2 can be non-distributed (#905)
Add an option to make single node SDK v2 jobs not run as distributed
jobs. At the moment distributed is the default to support Kubernetes
compute.
2023-07-27 14:45:37 +01:00
Anton Schwaighofer 036e2311f8
BUG: Enable submitting jobs to compute instances (#902)
This PR removes the check for available number of nodes, meaning the
code will run just fine on any type of compute.
Closes #901
2023-07-19 12:03:20 +01:00
Anton Schwaighofer 85754780a7
BUG: AmlIgnore file should not lose its last linebreak (#903)
Fixes #899
2023-07-19 10:24:34 +01:00
Harshita Sharma a297512e77
ENH: Add Macenko stain normalization (#896)
In this PR, Macenko stain normalization is added in
`hi-ml/hi-ml-cpath/src/health_cpath/models/transforms.py`. Corresponding
test is also added.
2023-06-19 11:05:26 +01:00
Kenza Bouzid 7003cdd464
ENH: Add DenseNet encoder (#892)
Add densenet encoder to supported encoder for deepmil

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-06-01 13:43:47 +01:00
Kenza Bouzid 3f0ae71042
BUG: Fix KeyError when converting svs to tiff (#891)
svs has different metadata properties than Tiff and NDPI. This fix
handles the case when get_mpp from monai fails with a KeyError exception
missing "Tiff.XResolution" and "Tiff.YResolution"
2023-05-30 10:08:52 +01:00
Anton Schwaighofer e8f6b44638
BUG: DeepMIL model uses training data even when running in eval mode (#889)
Instantiating the DeepMIL classifier in `create_model` always relies on
the training dataset and module, which is not available when doing
evaluation.
2023-05-25 17:55:20 +01:00
Anton Schwaighofer 26ff7d0d94
BUG: TIFF conversion enforces resolution unit to be centimeter (#887)
TIFF conversion fails if input resolution is not in centimeters, but we
don't rely on that being the case. Hence, remove the error message and
just print an info line
2023-05-18 10:03:44 +01:00
Anton Schwaighofer f46f60e7fa
BUG: Fix for duplicate authentication (#878)
Resolve issues with AML SDK v1/v2: Even in the v2 code path we are
creating v1 workspaces, leading to duplicate authentication requests.
To achieve that, a couple of other changes were necessary:
* Deprecate the use of the default datastore, which was read out of an
SDK v1 Workspace object even if SDK v2 was chosen
* No longer allowing SDK v2 when mounting datasets for local runs (v2
Datasets can't be mounted at all).

Also added more detailed logging for dataset creation, and a commandline
flag to control logging level.
2023-05-16 20:26:48 +01:00
Fernando Pérez-García 683def950a
FIX: Fix env variables not passed to AML SDK v2 jobs (#885)
Co-authored-by: Anton Schwaighofer <antonsc@microsoft.com>
2023-05-11 08:52:18 +01:00
Fernando Pérez-García 6b25f43ea0
FIX: Stop replacing dashes with underscores in experiment name (#884) 2023-05-11 08:23:07 +01:00
Fernando Pérez-García 0baf1d150d
FIX: Fix empty list of script params not used (#881)
Fix so no arguments are passed to the submitted script when an empty
list is explicitly passed to `script_params` in
`submit_to_azure_if_needed`.
2023-05-05 18:19:57 +01:00
Anton Schwaighofer 7e8c8a0548
ENH: Add tests for use of checkpoints in inference_only mode (#876)
Ensure that the test set metrics are correctly reproduced when using the
runner in inference-only mode
2023-05-03 11:29:43 +01:00
Anton Schwaighofer abf36f5d2e
ENH: Clean up design of slides dataset (#875)
Metadata columns are presently set via class variables, rather than in
the constructor. Hence, we can't have several datasets that use
different metadata columns, without them interfering with each other.
This caused odd test failures because test results now depend on the
order in which tests are executed.
2023-04-20 21:51:40 +01:00
Fernando Pérez-García da5547c726
MNT: Bump hi-ml-multimodal version: 0.2.0 → 0.2.1 (#869)
```shell
cd hi-ml-multimodal
```

Bump version:

```shell
make bump_version_dry part=patch  # testing
make bump_version part=patch
```

Publish:
```shell
make bump_version_dry part=patch  # username: "__token__". password: [your TestPyPI token]
make bump_version part=patch  # username: [your PyPI username]. password: [your PyPI password]
```
2023-04-20 14:53:39 +01:00
Kenza Bouzid f7e91a6a51
ENH: Add account key argument to generate checkpoint URL script (#874)
Some datastores don't have access to account key, so we need a way of
specifying it via commandline
2023-04-20 08:51:16 +01:00
Kenza Bouzid 122cd12215
BUG: Fix extra validation epoch hook call order (#873)
Fix the order of hook call. on_run_extra_val_epoch needs to be run
before super().init_inference to account for any changes in datamodule
params before re-instantiation
2023-04-18 13:01:38 +01:00
Anton Schwaighofer 5746042f68
ENH: Add a class_weights argument to the data module (#871) 2023-04-17 20:48:32 +01:00
markpinnock 8dbd3249cc
ENH: Improve support for choosing image model weights (#807)
This PR allows the user to determine whether to use ResNet weights
pre-trained on ImageNet or BioViL, or whether to have a randomly
initialised model: fixes #617 .
2023-04-12 15:43:49 +01:00
maxilse d6ea7acdde
ENH: Add normalized confusion matrix key to metrics keys (#868)
Add normalized confusion matrix key to metrics keys
2023-04-12 15:21:23 +02:00
Peter Hessey 2a11d5f665
BUG: Prevent creating v2 data asset without specifying datastore (#854)
Closes #786 

It should now be impossible to create data new data assets without also
specifying a datastore by its specific name, in both v1 and v2 pathways.

Default datastore interactions in all other code paths have been left
unchanged.
2023-04-07 09:59:49 +01:00
Jubin Mathew 2613b2eaeb
FIX: Fix target names in Makefile (#865)
Fix target names in the makefile to resolve make rules error.
2023-04-06 13:00:24 +01:00
pre-commit-ci[bot] dc3448be0a
ENH: Autoupdate hooks [pre-commit.ci] (#864) 2023-04-04 17:28:34 +01:00
dependabot[bot] 8fab5a7f34
MNT: Bump pypa/gh-action-pypi-publish from 1.8.3 to 1.8.5 (#863) 2023-04-04 17:27:53 +01:00
Anton Schwaighofer e73c92649d
ENH: Ability to evaluate model on a new dataset (#859)
Renamed the `MLRunner` to `TrainingRunner`. Introduced a new
`EvalRunner`. Shared functionality moved from `MLRunner` to
`RunnerBase`.
2023-04-04 17:24:15 +01:00
Anton Schwaighofer 2cc2511efd
ENH: Better commandline parsing of Enums (#861)
Enum values are now parsed without matching case. 
Also moved all parsing-related code out of `utils.py` into `argparsing.py`.
2023-04-03 10:23:41 +01:00
Kenza Bouzid 5c09c280a8
ENH: Add diagnosis for Tiff Conversion (#862) 2023-03-31 15:10:16 +01:00
Peter Hessey f3ea7173d7
ENH: Expose v1 dataset overwrite (#853)
Closes #839
2023-03-31 10:35:23 +01:00
Fernando Pérez-García 190e8d4312
MNT: Bump hi-ml-multimodal version (#849) 2023-03-29 14:13:50 +01:00
dependabot[bot] 4b07a3e082
MNT: Bump pypa/gh-action-pypi-publish from 1.8.1 to 1.8.3 (#856) 2023-03-29 13:04:39 +01:00
Fernando Pérez-García 0ed16e3b4f
FIX: Fix notebook not working on Binder (#852)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-03-23 17:47:48 +00:00
Peter Hessey 30dad42613
STY: Add Black pre-commit hook (#782)
More info at
- #777
2023-03-23 16:29:27 +00:00
Peter Hessey 64511b92b5 STY: Ignore styling in git blame 2023-03-23 15:43:37 +00:00