The embedding models run on ONNX Runtime, which supports multiple hardware execution providers (EPs). Both the text engine (OnnxEmbeddingGenerator) and the image engine (OnnxImageEmbeddingGenerator) select the provider through their respective options (EmbeddingGeneratorOptions.ExecutionProvider / ImageEmbeddingGeneratorOptions.ExecutionProvider, see configuration), via a shared registration helper (OnnxExecutionProvider) — so the fallback behavior and build requirements below apply identically to both. The native ONNX Runtime package linked into the binary must match — selected at build time with the JigenOnnxRuntimeFlavor MSBuild property on Jigen.SemanticTools.csproj.
ExecutionProvider value |
Hardware / platform | Build flavor (JigenOnnxRuntimeFlavor) |
Notes |
|---|---|---|---|
cpu |
Any | Cpu (default) |
No native GPU package required; used when ExecutionProvider is empty or "cpu". |
cuda |
NVIDIA GPU, Linux/Windows | Gpu (-p:JigenOnnxRuntimeFlavor=Gpu, package Microsoft.ML.OnnxRuntime.Gpu) |
Registered via AppendExecutionProvider_CUDA(GpuDeviceId). Implemented, pending validation on target NVIDIA hardware. |
dml |
Windows GPU (DirectML) | DirectML (package Microsoft.ML.OnnxRuntime.DirectML) |
Registered via AppendExecutionProvider_DML(GpuDeviceId). |
openvino / openvino:DEVICE |
Intel CPU/GPU/NPU, Windows x64 only | OpenVino (package Intel.ML.OnnxRuntime.OpenVino, NuGet-only) |
Device defaults to GPU when omitted, e.g. openvino:GPU, openvino:CPU, openvino:NPU. |
coreml |
Apple Silicon (macOS) | Included in the default (Cpu) package |
Registered with ModelFormat=MLProgram, MLComputeUnits=ALL, letting CoreML choose between ANE, GPU and CPU per operator. |
rocm |
AMD GPU | None — requires a custom ONNX Runtime native build; no NuGet package | Registered via AppendExecutionProvider_ROCm(GpuDeviceId). Implemented, pending validation on target AMD hardware. |
migraphx |
AMD GPU (MIGraphX) | None — requires a custom ONNX Runtime native build; no NuGet package | Registered via AppendExecutionProvider_MIGraphX(GpuDeviceId). |
Vulkan is not available as an ONNX Runtime execution provider and is not planned.
Execution provider registration is defensive:
- An unrecognized
ExecutionProvidervalue logs a warning and silently uses CPU. - If registering the requested provider throws (e.g. the matching native runtime package was not linked in, or the hardware/driver is unavailable), Jigen logs a warning and falls back to CPU rather than failing to start.
This means requesting cuda, dml, rocm, migraphx, or openvino on a binary built with the Cpu flavor (or on a machine without the corresponding driver) does not crash the process — it just runs on CPU, typically much slower, so registration failures are worth monitoring in logs when a non-CPU provider is expected.
MaxBatchSize: keep at1on CPU (the default); intra-op parallelism already saturates CPU cores, and batching mixed-length inputs pads shorter sequences to the longest one in the batch, wasting compute. Raise it to somewhere in the 8–32 range on GPU providers, where fusing sequences into one inference call amortizes kernel launch and data-transfer overhead. For images the padding concern does not apply (fixed-size input), so batching is more useful than for text even on CPU.- Model precision: prefer the
int8quantized model on CPU (faster, no measurable ranking degradation in testing) and anfp16model on GPU. The same guidance applies to the vision model (nomic-embed-vision-v1.5). GpuDeviceIdselects the target device index forcuda,dml,rocm, andmigraphx.
See configuration for the full EmbeddingGeneratorOptions and ImageEmbeddingGeneratorOptions reference and a production configuration example.