|
| 1 | +ML.NET is a modular set of libraries that enables building a pipeline from data loaders, trainers/estimators (in case of training), transformers (in case of inferencing), and various data structures to facilitate the building of pipelines and representing data. The core of ML.NET – the Microsoft.ML package has no external dependencies. It's largely managed code. |
| 2 | + |
| 3 | +Microsoft.ML does have a helper native math library CPUMath - which is only used on .NETFramework. .NET 6.0 and later have a managed implementation using intrinsics/TensorPrimitives and do not require the native build of CPUMath. |
| 4 | + |
| 5 | +Microsoft.ML contains one other native library, LDANative, which is used by the LatentDirichletAllocationEstimator/Transform to support the LightLDA algorithm. If this component is used it will require the LightLDA native library. The native library is built for linux-arm, linux-arm64, linux-x64, osx-arm64 (M1), osx-x64, win-arm64, win-x64, win-x86. This library has only platform/CRT dependencies. |
| 6 | + |
| 7 | +Some components that represent an algorithm or binding to another framework are factored into separate packages to allow opt-in to using those and their dependencies. |
| 8 | + |
| 9 | +ML.NET redistributes Intel MKL as Microsoft.ML.MKL.Redist in which is a minimized MKL library linked with just exports needed by ML.NET. This component follows the support matrix of Intel MKL and is only supported on x86 and x64 architectures: linux-x64, osx-x64 (no longer supported by Intel), win-x64, and win-x86. Similarly some components have light-up to use an Intel OneDAL implementation which is only supported on x64. |
| 10 | + |
| 11 | +| NuGet Package | Entry-Point Components | Native Dependencies | Status | Notes | |
| 12 | +|-------------------------------------|----------------------------------------------------------------|------------------------------------------------|----------|--------------------------------------------------------------------------------------------| |
| 13 | +| `Microsoft.ML` | `MLContext`, core transforms, trainers | None | Stable | | |
| 14 | +| `Microsoft.Extensions.ML` | `PredictionEnginePool` | None | Stable | | |
| 15 | +| `Microsoft.ML.AutoML` | `AutoCatalog` for AutoML | *As required by other components* | Preview | Support varies based on components used | |
| 16 | +| `Microsoft.ML.CodeGenerator` | | None | Preview | Part of AutoML | |
| 17 | +| `Microsoft.ML.CpuMath` | | Optional native | Stable | Internal implementation; only used on .NET Framework | |
| 18 | +| `Microsoft.ML.DataView` | `IDataView` | None | Stable | | |
| 19 | +| `Microsoft.ML.DnnImageFeaturizer.*` | | None | Preview | Data-only | |
| 20 | +| `Microsoft.ML.Ensemble` | | None | Preview | Supports ML.NET component catalog | |
| 21 | +| `Microsoft.ML.EntryPoints` | | None | Preview | Supports ML.NET component catalog | |
| 22 | +| `Microsoft.ML.Experimental` | | None | Preview | Experimental API | |
| 23 | +| `Microsoft.ML.FairLearn` | `FairlearnCatalog` | None | Preview | | |
| 24 | +| `Microsoft.ML.FastTree` | `FastTreeRankingTrainer` | Optional native acceleration | Stable | Native library used on x86/x64; managed fallback | |
| 25 | +| `Microsoft.ML.ImageAnalytics` | `MLImage` (image exchange type) | `libSkiaSharp` | Stable | Wrapper over SkiaSharp / Google Skia; supported where dependency is supported | |
| 26 | +| `Microsoft.ML.LightGBM` | `LightGbm\*Trainer` | `LightGBM` | Stable | Wrapper over LightGBM; supported where dependency is supported | |
| 27 | +| `Microsoft.ML.MKL.Components` | `SymbolicSgdLogisticRegressionBinaryTrainer` | Intel MKL | Stable | Only works where Intel MKL works | |
| 28 | +| `Microsoft.ML.MKL.Redist` | Internal native Intel MKL | `libomp` | Stable | Not for direct reference; win-x86/x64 only | |
| 29 | +| `Microsoft.ML.OneDal` | Internal native Intel OneDal | Intel OneDAL | Preview | Not for direct reference; x64 only | |
| 30 | +| `Microsoft.ML.OnnxConverter` | Adds ONNX export support | `Microsoft.ML.OnnxRuntime` | Stable | Wrapper over ONNX Runtime; supports "bring your own" runtime | |
| 31 | +| `Microsoft.ML.OnnxTransformer` | `OnnxCatalog` | `Microsoft.ML.OnnxRuntime` | Stable | Wrapper over ONNX Runtime; supports "bring your own" runtime | |
| 32 | +| `Microsoft.ML.Parquet` | `ParquetLoader` | None | Preview | Uses managed Parquet.Net (port of Apache Parquet) | |
| 33 | +| `Microsoft.ML.Recommender` | `MatrixFactorizationTrainer` | LIBMF (bundled) | Stable | Includes libmf built for all runtimes supported by ML.NET | |
| 34 | +| `Microsoft.ML.TensorFlow` | `TensorFlowModel`, `Transformer`, `Estimator` | TensorFlow via `TensorFlow.NET` | Stable | Wrapper over TensorFlow; supports "bring your own" runtime | |
| 35 | +| `Microsoft.ML.TimeSeries` | `ForecastingCatalog` | Intel MKL, `libomp` | Stable | Only works where Intel MKL works | |
| 36 | +| `Microsoft.ML.TorchSharp` | `QATrainer`, `TextClassificationTrainer`, `SentenceSimilarityTrainer` | libTorch via `TorchSharp` | Preview | Wrapper over libTorch; supported where TorchSharp is supported | |
| 37 | +| `Microsoft.ML.Vision` | `ImageClassificationTrainer` | TensorFlow | Stable | Depends on `Microsoft.ML.TensorFlow` for implementation | |
| 38 | + |
| 39 | + |
| 40 | +Other packages: |
| 41 | +| NuGet Package | Entry-Point Components | Native Dependencies | Status | Notes | |
| 42 | +|----------------------------------|--------------------------------------------------|-----------------------------------------------|------------|---------| |
| 43 | +| `Microsoft.Data.Analysis` | `DataFrame` | `Apache.Arrow` | Preview | | |
| 44 | +| `Microsoft.ML.GenAI.*` | | | Preview | | |
| 45 | +| `Microsoft.ML.Tokenizers.*` | `Tokenizer` | | Stable | | |
| 46 | +| `Microsoft.ML.SampleUtils` | | | Preview | | |
| 47 | + |
| 48 | + |
| 49 | +## Package Dependencies Diagram |
| 50 | + |
| 51 | +The following diagram shows the relationships between ML.NET packages and their external dependencies: |
| 52 | + |
| 53 | +```mermaid |
| 54 | +%%{init: {'theme':'base', 'themeVariables': {'fontSize':'18px'}, 'flowchart': {'useMaxWidth': false, 'htmlLabels': true, 'curve': 'linear'}, 'securityLevel': 'loose'}}%% |
| 55 | +graph TD |
| 56 | + %% Core packages - arranged vertically at top |
| 57 | + subgraph CorePackages["🔧 Core ML.NET Packages"] |
| 58 | + direction TB |
| 59 | + DataView["Microsoft.ML.DataView"] |
| 60 | + Core["Microsoft.ML"] |
| 61 | + Extensions["Microsoft.Extensions.ML"] |
| 62 | + CpuMath["Microsoft.ML.CpuMath"] |
| 63 | + end |
| 64 | + |
| 65 | + %% AutoML packages |
| 66 | + subgraph AutoMLPackages["🤖 AutoML Packages"] |
| 67 | + direction TB |
| 68 | + AutoML["Microsoft.ML.AutoML"] |
| 69 | + CodeGen["Microsoft.ML.CodeGenerator"] |
| 70 | + Ensemble["Microsoft.ML.Ensemble"] |
| 71 | + EntryPoints["Microsoft.ML.EntryPoints"] |
| 72 | + FairLearn["Microsoft.ML.FairLearn"] |
| 73 | + end |
| 74 | + |
| 75 | + %% Algorithm packages |
| 76 | + subgraph AlgorithmPackages["⚙️ ML Algorithm Packages"] |
| 77 | + direction TB |
| 78 | + FastTree["Microsoft.ML.FastTree"] |
| 79 | + LightGBM["Microsoft.ML.LightGBM"] |
| 80 | + Recommender["Microsoft.ML.Recommender"] |
| 81 | + TimeSeries["Microsoft.ML.TimeSeries"] |
| 82 | + TorchSharp["Microsoft.ML.TorchSharp"] |
| 83 | + end |
| 84 | + |
| 85 | + %% Image and vision packages |
| 86 | + subgraph ImagePackages["🖼️ Image & Vision Packages"] |
| 87 | + direction TB |
| 88 | + ImageAnalytics["Microsoft.ML.ImageAnalytics"] |
| 89 | + Vision["Microsoft.ML.Vision"] |
| 90 | + DnnFeaturizerAlexNet["Microsoft.ML.DnnImageFeaturizer.AlexNet"] |
| 91 | + DnnFeaturizerResNet18["Microsoft.ML.DnnImageFeaturizer.ResNet18"] |
| 92 | + DnnFeaturizerResNet50["Microsoft.ML.DnnImageFeaturizer.ResNet50"] |
| 93 | + DnnFeaturizerResNet101["Microsoft.ML.DnnImageFeaturizer.ResNet101"] |
| 94 | + DnnFeaturizerModelRedist["Microsoft.ML.DnnImageFeaturizer.ModelRedist"] |
| 95 | + end |
| 96 | + |
| 97 | + %% ONNX and TensorFlow packages |
| 98 | + subgraph FrameworkPackages["🔗 Framework Integration Packages"] |
| 99 | + direction TB |
| 100 | + OnnxConverter["Microsoft.ML.OnnxConverter"] |
| 101 | + OnnxTransformer["Microsoft.ML.OnnxTransformer"] |
| 102 | + TensorFlow["Microsoft.ML.TensorFlow"] |
| 103 | + end |
| 104 | + |
| 105 | + %% Intel MKL packages |
| 106 | + subgraph IntelPackages["⚡ Intel MKL Packages"] |
| 107 | + direction TB |
| 108 | + MKLComponents["Microsoft.ML.MKL.Components"] |
| 109 | + MKLRedist["Microsoft.ML.MKL.Redist"] |
| 110 | + OneDal["Microsoft.ML.OneDal"] |
| 111 | + end |
| 112 | + |
| 113 | + %% AI/GenAI packages |
| 114 | + subgraph AIPackages["🧠 AI & GenAI Packages"] |
| 115 | + direction TB |
| 116 | + GenAICore["Microsoft.ML.GenAI.Core"] |
| 117 | + GenAILLaMA["Microsoft.ML.GenAI.LLaMA"] |
| 118 | + GenAIMistral["Microsoft.ML.GenAI.Mistral"] |
| 119 | + GenAIPhi["Microsoft.ML.GenAI.Phi"] |
| 120 | + AutoGenCore["AutoGen.Core"] |
| 121 | + MSExtensionsAI["Microsoft.Extensions.AI.Abstractions"] |
| 122 | + SemanticKernel["Microsoft.SemanticKernel.Abstractions"] |
| 123 | + end |
| 124 | + |
| 125 | + %% Tokenizer packages |
| 126 | + subgraph TokenizerPackages["📝 Tokenizer Packages"] |
| 127 | + direction TB |
| 128 | + Tokenizers["Microsoft.ML.Tokenizers"] |
| 129 | + TokenizersGpt2["Microsoft.ML.Tokenizers.Data.Gpt2"] |
| 130 | + TokenizersR50k["Microsoft.ML.Tokenizers.Data.R50kBase"] |
| 131 | + TokenizersP50k["Microsoft.ML.Tokenizers.Data.P50kBase"] |
| 132 | + TokenizersO200k["Microsoft.ML.Tokenizers.Data.O200kBase"] |
| 133 | + TokenizersCl100k["Microsoft.ML.Tokenizers.Data.Cl100kBase"] |
| 134 | + end |
| 135 | + |
| 136 | + %% Data packages |
| 137 | + subgraph DataPackages["📊 Data Packages"] |
| 138 | + direction TB |
| 139 | + Parquet["Microsoft.ML.Parquet"] |
| 140 | + DataAnalysis["Microsoft.Data.Analysis"] |
| 141 | + end |
| 142 | + |
| 143 | + %% Other packages |
| 144 | + subgraph OtherPackages["🔧 Other Packages"] |
| 145 | + direction TB |
| 146 | + Experimental["Microsoft.ML.Experimental"] |
| 147 | + SampleUtils["Microsoft.ML.SampleUtils"] |
| 148 | + end |
| 149 | + |
| 150 | + %% External dependencies - arranged vertically at bottom |
| 151 | + subgraph ExternalDeps["🌐 External Dependencies"] |
| 152 | + direction TB |
| 153 | + SkiaSharp["SkiaSharp"] |
| 154 | + LightGBMNative["LightGBM"] |
| 155 | + OnnxRuntime["Microsoft.ML.OnnxRuntime"] |
| 156 | + TensorFlowNET["TensorFlow.NET"] |
| 157 | + TorchSharpLib["TorchSharp"] |
| 158 | + ApacheArrow["Apache.Arrow"] |
| 159 | + ParquetNet["Parquet.Net"] |
| 160 | + GoogleProtobuf["Google.Protobuf"] |
| 161 | + end |
| 162 | + |
| 163 | + %% Core dependencies |
| 164 | + Core --> DataView |
| 165 | + Core --> CpuMath |
| 166 | + Extensions --> Core |
| 167 | + |
| 168 | + %% AutoML dependencies |
| 169 | + AutoML --> Core |
| 170 | + AutoML --> CpuMath |
| 171 | + AutoML --> DnnFeaturizerAlexNet |
| 172 | + AutoML --> DnnFeaturizerResNet18 |
| 173 | + AutoML --> DnnFeaturizerResNet50 |
| 174 | + AutoML --> DnnFeaturizerResNet101 |
| 175 | + AutoML --> OnnxTransformer |
| 176 | + AutoML --> TimeSeries |
| 177 | + AutoML --> TorchSharp |
| 178 | + AutoML --> Vision |
| 179 | + AutoML --> ImageAnalytics |
| 180 | + AutoML --> LightGBM |
| 181 | + AutoML --> MKLComponents |
| 182 | + AutoML --> Recommender |
| 183 | + CodeGen --> AutoML |
| 184 | + |
| 185 | + %% Algorithm dependencies |
| 186 | + FastTree --> Core |
| 187 | + LightGBM --> Core |
| 188 | + LightGBM --> FastTree |
| 189 | + LightGBM --> LightGBMNative |
| 190 | + Recommender --> Core |
| 191 | + TimeSeries --> Core |
| 192 | + TimeSeries --> MKLRedist |
| 193 | + TorchSharp --> Core |
| 194 | + TorchSharp --> ImageAnalytics |
| 195 | + TorchSharp --> Tokenizers |
| 196 | + TorchSharp --> TorchSharpLib |
| 197 | + |
| 198 | + %% Image and vision dependencies |
| 199 | + ImageAnalytics --> Core |
| 200 | + ImageAnalytics --> SkiaSharp |
| 201 | + Vision --> Core |
| 202 | + Vision --> TensorFlow |
| 203 | + |
| 204 | + %% Framework dependencies |
| 205 | + OnnxConverter --> Core |
| 206 | + OnnxTransformer --> Core |
| 207 | + OnnxTransformer --> OnnxRuntime |
| 208 | + OnnxTransformer --> GoogleProtobuf |
| 209 | + TensorFlow --> Core |
| 210 | + TensorFlow --> ImageAnalytics |
| 211 | + TensorFlow --> TensorFlowNET |
| 212 | + |
| 213 | + %% Intel MKL dependencies |
| 214 | + MKLComponents --> Core |
| 215 | + MKLComponents --> MKLRedist |
| 216 | + MKLComponents --> OneDal |
| 217 | + |
| 218 | + %% Other package dependencies |
| 219 | + Ensemble --> Core |
| 220 | + EntryPoints --> Core |
| 221 | + Experimental --> Core |
| 222 | + FairLearn --> Core |
| 223 | + FairLearn --> DataAnalysis |
| 224 | + FairLearn --> AutoML |
| 225 | + Parquet --> Core |
| 226 | + Parquet --> ParquetNet |
| 227 | + DataAnalysis --> ApacheArrow |
| 228 | + |
| 229 | + %% GenAI dependencies |
| 230 | + GenAICore --> TorchSharpLib |
| 231 | + GenAICore --> AutoGenCore |
| 232 | + GenAICore --> MSExtensionsAI |
| 233 | + GenAICore --> SemanticKernel |
| 234 | + GenAILLaMA --> GenAICore |
| 235 | + GenAILLaMA --> TorchSharpLib |
| 236 | + GenAIMistral --> GenAICore |
| 237 | + GenAIPhi --> GenAICore |
| 238 | + |
| 239 | + %% DNN Image Featurizer dependencies |
| 240 | + DnnFeaturizerAlexNet --> OnnxTransformer |
| 241 | + DnnFeaturizerAlexNet --> DnnFeaturizerModelRedist |
| 242 | + DnnFeaturizerResNet18 --> OnnxTransformer |
| 243 | + DnnFeaturizerResNet18 --> DnnFeaturizerModelRedist |
| 244 | + DnnFeaturizerResNet50 --> OnnxTransformer |
| 245 | + DnnFeaturizerResNet50 --> DnnFeaturizerModelRedist |
| 246 | + DnnFeaturizerResNet101 --> OnnxTransformer |
| 247 | + DnnFeaturizerResNet101 --> DnnFeaturizerModelRedist |
| 248 | + |
| 249 | + %% Tokenizer dependencies |
| 250 | + Tokenizers --> GoogleProtobuf |
| 251 | + TokenizersGpt2 --> Tokenizers |
| 252 | + TokenizersR50k --> Tokenizers |
| 253 | + TokenizersP50k --> Tokenizers |
| 254 | + TokenizersO200k --> Tokenizers |
| 255 | + TokenizersCl100k --> Tokenizers |
| 256 | + |
| 257 | + %% Styling for readability and larger text |
| 258 | + classDef external fill:#ffebcd,stroke:#d2691e,stroke-width:4px,font-size:18px,font-weight:bold |
| 259 | + classDef core fill:#e6f3ff,stroke:#0066cc,stroke-width:4px,font-size:18px,font-weight:bold |
| 260 | + classDef algorithm fill:#f0f8e6,stroke:#228b22,stroke-width:4px,font-size:18px,font-weight:bold |
| 261 | + classDef bundled fill:#ffefd5,stroke:#ff8c00,stroke-width:4px,font-size:18px,font-weight:bold |
| 262 | + classDef subgraphStyle fill:#f9f9f9,stroke:#333,stroke-width:3px,font-size:20px,font-weight:bold |
| 263 | + |
| 264 | + class SkiaSharp,LightGBMNative,OnnxRuntime,TensorFlowNET,TorchSharpLib,ApacheArrow,ParquetNet,GoogleProtobuf,AutoGenCore,MSExtensionsAI,SemanticKernel external |
| 265 | + class DataView,Core,Extensions core |
| 266 | + class AutoML,CodeGen,FastTree,LightGBM,Recommender,TimeSeries,TorchSharp,ImageAnalytics,DnnFeaturizerAlexNet,DnnFeaturizerResNet18,DnnFeaturizerResNet50,DnnFeaturizerResNet101,DnnFeaturizerModelRedist,Vision,OnnxConverter,OnnxTransformer,TensorFlow,MKLComponents,Ensemble,EntryPoints,Experimental,FairLearn,Parquet,DataAnalysis,GenAICore,GenAILLaMA,GenAIMistral,GenAIPhi,Tokenizers,TokenizersGpt2,TokenizersR50k,TokenizersP50k,TokenizersO200k,TokenizersCl100k,SampleUtils algorithm |
| 267 | + class CpuMath,MKLRedist,OneDal bundled |
| 268 | +``` |
| 269 | + |
0 commit comments