Skip to content

Commit

Permalink
Merge branch 'main' into vaibhj/deprecatespark33
Browse files Browse the repository at this point in the history
  • Loading branch information
alanpo1 authored Dec 19, 2024
2 parents 76c91d2 + cd16bf8 commit 2589e9d
Show file tree
Hide file tree
Showing 37 changed files with 59 additions and 107 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: batch_output_formatter
version: 0.0.14
version: 0.0.15
display_name: Batch Output Formatter
is_deterministic: True
type: command
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ is_deterministic: False
name: batch_resource_manager
display_name: Batch Inference Resource Manager
description: Resource Manager for batch inference.
version: 0.0.7
version: 0.0.8

inputs:
wait_input:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ type: command
name: benchmark_embedding_model
display_name: Benchmark Embedding Model
description: Component for benchmarking an embedding model via MTEB.
version: 0.0.3
version: 0.0.4

inputs:
endpoint_url:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ type: command
name: benchmark_result_aggregator
display_name: Benchmark result aggregator
description: Aggregate quality metrics, performance metrics and all of the metadata from the pipeline. Also add them to the root run.
version: 0.0.13
version: 0.0.14
is_deterministic: false

inputs:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ type: command
name: compute_performance_metrics
display_name: Compute Performance Metrics
description: Performs performance metric post processing using data from a model inference run.
version: 0.0.10
version: 0.0.11
is_deterministic: true

inputs:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ type: command
name: dataset_downloader
display_name: Dataset Downloader
description: Downloads the dataset onto blob store.
version: 0.0.10
version: 0.0.11

inputs:
dataset_name:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ type: command
name: dataset_preprocessor
display_name: Dataset Preprocessor
description: Dataset Preprocessor
version: 0.0.10
version: 0.0.11
is_deterministic: true

inputs:
Expand Down
2 changes: 1 addition & 1 deletion assets/aml-benchmark/components/dataset_sampler/spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ type: command
name: dataset_sampler
display_name: Dataset Sampler
description: Samples a dataset containing JSONL file(s).
version: 0.0.10
version: 0.0.11

inputs:
dataset:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ type: command
name: inference_postprocessor
display_name: Inference Postprocessor
description: Inference Postprocessor
version: 0.0.11
version: 0.0.12
is_deterministic: true

inputs:
Expand Down
2 changes: 1 addition & 1 deletion assets/aml-benchmark/components/prompt_crafter/spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ display_name: Prompt Crafter
description: This component is used to create prompts from a given dataset. From a
given jinja prompt template, it will generate prompts. It can also create
few-shot prompts given a few-shot dataset and the number of shots.
version: 0.0.13
version: 0.0.14
is_deterministic: true

inputs:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ def test_minimal_cpu_inference():

env_docker_context = Environment(
build=BuildContext(path=this_dir / BUILD_CONTEXT),
name="minimal_cpu_inference",
name=env_name,
description="minimal 20.04 py39 cpu inference environment created from a Docker context.",
)
ml_client.environments.create_or_update(env_docker_context)
returned_env = ml_client.environments.create_or_update(env_docker_context)

# create the command
job = command(
Expand All @@ -44,7 +44,7 @@ def test_minimal_cpu_inference():
inputs=dict(
score="valid_score.py",
),
environment=f"{env_name}@latest",
environment=returned_env,
compute=os.environ.get("cpu_cluster"),
display_name="minimal-cpu-inference-example",
description="A test run of the minimal 20.04 py39 cpu inference curated environment",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
azure-ai-ml==0.1.0b4
azure.identity==1.10.0
requests==2.31.0
azure-ai-ml==1.2.0
azure.identity
requests
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ def test_minimal_cpu_inference():

env_docker_context = Environment(
build=BuildContext(path=this_dir / BUILD_CONTEXT),
name="minimal_cpu_inference",
name=env_name,
description="minimal 22.04 py311 cpu inference environment created from a Docker context.",
)
ml_client.environments.create_or_update(env_docker_context)
returned_env = ml_client.environments.create_or_update(env_docker_context)

# create the command
job = command(
Expand All @@ -44,7 +44,7 @@ def test_minimal_cpu_inference():
inputs=dict(
score="valid_score.py",
),
environment=f"{env_name}@latest",
environment=returned_env,
compute=os.environ.get("cpu_cluster"),
display_name="minimal-cpu-inference-example",
description="A test run of the minimal 22.04 py311 cpu inference curated environment",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
azure-ai-ml==0.1.0b4
azure.identity==1.10.0
azure-ai-ml==1.2.0
azure.identity
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,4 @@ dependencies:
- pip:
- azureml-inference-server-http=={{latest-pypi-version}}
- azureml-ai-monitoring=={{latest-pypi-version}}
- numpy
- mlflow
- azureml-contrib-services
- mlflow
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ def test_mlflow_cpu_inference():

env_docker_context = Environment(
build=BuildContext(path=this_dir / BUILD_CONTEXT),
name="mlflow_py39_inference",
name=env_name,
description="mlflow 20.04 py39 cpu inference environment created from a Docker context.",
)
ml_client.environments.create_or_update(env_docker_context)
returned_env = ml_client.environments.create_or_update(env_docker_context)

# create the command
job = command(
Expand All @@ -47,7 +47,7 @@ def test_mlflow_cpu_inference():
score_input="sample_2_0_input.txt",
model_dir="mlflow_2_0_model_folder"
),
environment=f"{env_name}@latest",
environment=returned_env,
compute=os.environ.get("cpu_cluster"),
display_name="mlflow-py39-inference-example",
description="A test run of the mlflow 20.04 py39 cpu inference curated environment",
Expand Down
1 change: 1 addition & 0 deletions assets/models/system/Phi-4/spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,6 @@ tags:
Standard_ND96asr_v4,
Standard_ND96amsr_A100_v4
]
benchmark: "quality"

version: 1
1 change: 1 addition & 0 deletions assets/models/system/financial-reports-analysis/spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ tags:
Featured: ""
languages: "en"
keywords: ""
industry: financial-services
inference_supported_envs:
- vllm
license: mit
Expand Down
64 changes: 5 additions & 59 deletions assets/models/system/microsoft-rad-dino/description.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,22 @@

# Model card for RAD-DINO

<!-- Provide a quick summary of what the model is/does. -->

## Model description

<!-- Provide a longer summary of what this model is. -->

RAD-DINO is a vision transformer model trained to encode chest X-rays using the self-supervised learning method [DINOv2](https://openreview.net/forum?id=a68SUt6zFt).

RAD-DINO is described in detail in [RAD-DINO: Exploring Scalable Medical Image Encoders Beyond Text Supervision (F. Pérez-García, H. Sharma, S. Bond-Taylor, et al., 2024)](https://arxiv.org/abs/2401.10815).

- **Developed by:** Microsoft Health Futures
- **Model type:** Vision transformer
- **License:** [MSRLA](./LICENSE)
- **License:** MSRLA
- **Finetuned from model:** [`dinov2-base`](https://huggingface.co/facebook/dinov2-base)

## Uses

<!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->

RAD-DINO is shared for research purposes only.
It is **not meant to be used for clinical practice**.

<!-- ### Downstream use -->

<!-- This section is for the model use when fine-tuned for a task, or when plugged into a larger ecosystem/app -->

The model is a vision backbone that can be plugged to other models for downstream tasks.
Some potential uses are:

Expand All @@ -39,14 +29,8 @@ Some potential uses are:

Fine-tuning RAD-DINO is typically not necessary to obtain good performance in downstream tasks.

<!-- ### Out-of-scope use -->

<!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->

## Biases, risks, and limitations

<!-- This section is meant to convey both technical and sociotechnical limitations. -->

RAD-DINO was trained with data from three countries, therefore it might be biased towards population in the training data.
Underlying biases of the training datasets may not be well characterized.

Expand Down Expand Up @@ -122,8 +106,6 @@ torch.Size([1, 768, 37, 37])

### Training data

<!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->

We used images from five public, deidentified chest X-ray datasets to train this checkpoint of RAD-DINO.

| Dataset | Num. images |
Expand All @@ -144,8 +126,6 @@ We used 16 nodes with 4 A100 GPUs each, and a batch size of 40 images per GPU.

### Training procedure

<!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->

We refer to the [manuscript](https://arxiv.org/abs/2401.10815) for a detailed description of the training procedure.

#### Preprocessing
Expand All @@ -156,45 +136,12 @@ All DICOM files were resized using B-spline interpolation so that their shorter

- **Training regime:** fp16 using PyTorch-FSDP mixed-precision.

<!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->

## Evaluation

<!-- This section describes the evaluation protocols and provides the results. -->

Our evaluation is best described in the [manuscript](https://arxiv.org/abs/2401.10815).

<!-- ### Testing data, factors & metrics
#### Testing Data
[More Information Needed]
#### Factors
[More Information Needed]
#### Metrics
[More Information Needed]
### Results
[More Information Needed]
#### Summary -->

## Environmental impact

<!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->

<!-- Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700). -->

<!-- Hardware type: A100 PCIe -->
<!-- Hours: 1d 16h = 40h -->
<!-- Cloud provider: Azure -->
<!-- Region: Italy North -->

- **Hardware type:** NVIDIA A100 GPUs
- **Hours used:** 40 hours/GPU × 16 nodes × 4 GPUs/node = 2560 GPU-hours
- **Cloud provider:** Azure
Expand All @@ -216,8 +163,6 @@ We used [SimpleITK](https://simpleitk.org/) and [Pydicom](https://pydicom.github

## Citation

<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->

**BibTeX:**

```bibtex
Expand All @@ -235,10 +180,11 @@ We used [SimpleITK](https://simpleitk.org/) and [Pydicom](https://pydicom.github

> Pérez-García, F., Sharma, H., Bond-Taylor, S., Bouzid, K., Salvatelli, V., Ilse, M., Bannur, S., Castro, D.C., Schwaighofer, A., Lungren, M.P., Wetscherek, M.T., Codella, N., Hyland, S.L., Alvarez-Valle, J., & Oktay, O. (2024). *RAD-DINO: Exploring Scalable Medical Image Encoders Beyond Text Supervision*. ArXiv, abs/2401.10815.
## Model card contact

Fernando Pérez-García ([`[email protected]`](mailto:[email protected])).
### Inference samples

Inference type|Python sample (Notebook)|CLI with YAML
|--|--|--|
Real time|<a href="https://aka.ms/azureml-infer-sdk-image-embeddings" target="_blank">image-embeddings-online-endpoint.ipynb</a>|<a href="https://aka.ms/azureml-infer-cli-image-embeddings" target="_blank">image-embeddings-online-endpoint.sh</a>

### Sample inputs and outputs

Expand Down
2 changes: 2 additions & 0 deletions assets/models/system/microsoft-rad-dino/spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,6 @@ tags:
license: msrla
author: Microsoft
task: embeddings
industry: health-and-life-sciences
hiddenlayerscanned: "true"
version: 1
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ tags:
Featured: ""
languages: "en"
keywords: ""
industry: manufacturing
inference_supported_envs:
- vllm
license: mit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ image:
- conda_dependencies.yaml
publish:
location: mcr
visibility: unlisted
visibility: public
2 changes: 1 addition & 1 deletion assets/pipelines/environments/mldesigner/environment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ image:
- conda_dependencies.yaml
publish:
location: mcr
visibility: unlisted
visibility: public
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ ENV ENABLE_METADATA=true
RUN mkdir -p /etc/OpenCL/vendors && echo "libnvidia-opencl.so.1" > /etc/OpenCL/vendors/nvidia.icd
RUN apt-get update && echo 'success updated apt-get!'
RUN apt-get install -y --no-install-recommends cmake libboost-dev libboost-system-dev libboost-filesystem-dev
RUN conda create -p $AZUREML_CONDA_ENVIRONMENT_PATH python=3.9 pip=22.1.2 -y
RUN conda create -p $AZUREML_CONDA_ENVIRONMENT_PATH python=3.9 pip=22.1.2 conda-forge::tzdata -y

RUN conda run -p $AZUREML_CONDA_ENVIRONMENT_PATH

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ RUN MAX_JOBS=4 pip install flash-attn==2.5.5 --no-build-isolation
# clean conda and pip caches
RUN rm -rf ~/.cache/pip

# dummy number to change when needing to force rebuild without changing the definition: 1
# dummy number to change when needing to force rebuild without changing the definition: 2
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
$schema: https://azuremlschemas.azureedge.net/latest/commandComponent.schema.json
type: command

version: 0.0.19
version: 0.0.20
name: mmdetection_image_objectdetection_instancesegmentation_finetune
display_name: Image Object Detection and Instance Segmentation MMDetection Model Finetune
description: Component to finetune MMDetection models for image object detection and instance segmentation.

is_deterministic: false

environment: azureml://registries/azureml/environments/acft-mmdetection-image-gpu/versions/46
environment: azureml://registries/azureml/environments/acft-mmdetection-image-gpu/versions/48

code: ../../../src/finetune

Expand Down
Loading

0 comments on commit 2589e9d

Please sign in to comment.