pub struct OnnxRuntimeInstaller { /* private fields */ }Expand description
The ONNX Runtime installer.
Implementations§
Source§impl OnnxRuntimeInstaller
impl OnnxRuntimeInstaller
Sourcepub fn new(config: OnnxRuntimeConfig) -> Self
pub fn new(config: OnnxRuntimeConfig) -> Self
Create a new ONNX Runtime installer with the given config.
Sourcepub fn with_defaults() -> Self
pub fn with_defaults() -> Self
Create with default config.
Sourcepub fn runtime_version(&self) -> &str
pub fn runtime_version(&self) -> &str
Get the requested/effective runtime version for status reporting.
Sourcepub fn prebuilt_version(&self) -> &str
pub fn prebuilt_version(&self) -> &str
Get the pinned prebuilt onnxruntime-migraphx version installed by the
default path.
Sourcepub fn dependencies(&self) -> &[&str]
pub fn dependencies(&self) -> &[&str]
Get the list of required dependencies.
ONNX Runtime depends on ROCm.
Sourcepub fn build_prebuilt_install_command(&self) -> ShellCommand
pub fn build_prebuilt_install_command(&self) -> ShellCommand
Construct the pip install command for prebuilt onnxruntime-rocm wheel.
The original script tries this first:
pip install --upgrade --prefer-binary onnxruntime-rocm
Sourcepub fn build_migraphx_install_command(&self) -> ShellCommand
pub fn build_migraphx_install_command(&self) -> ShellCommand
Construct the pip install command for the pinned onnxruntime-migraphx
wheel from PyPI.
This is the default install method. The Microsoft-published PyPI wheel
ships the MIGraphX execution provider built against ROCm. --no-deps
honors the No-CUDA hard-prime (prevents pulling nvidia/cuda runtime
transitive deps); --no-cache-dir forces a fresh fetch.
Sourcepub fn build_provider_validation_command(&self) -> ShellCommand
pub fn build_provider_validation_command(&self) -> ShellCommand
Construct a provider validation command for AMD ONNX Runtime.
Sourcepub fn build_model_optimizer_command(&self, model_path: &str) -> ShellCommand
pub fn build_model_optimizer_command(&self, model_path: &str) -> ShellCommand
Construct the Python command to run ORT graph optimization on an ONNX model.
Applies ORT_ENABLE_ALL optimization level which fuses quantized ops
(DynamicQuantizeLinear, MatMulInteger, etc.) into custom ops that bypass
MIGraphX’s broken kernels. The optimized model is saved alongside the original.
Sourcepub fn build_git_clone_command(&self) -> ShellCommand
pub fn build_git_clone_command(&self) -> ShellCommand
Construct the git clone command for ONNX Runtime.
The original script clones:
git clone --recursive https://github.com/microsoft/onnxruntime.git
Sourcepub fn build_git_checkout_command(&self) -> ShellCommand
pub fn build_git_checkout_command(&self) -> ShellCommand
Construct the git checkout command for the release tag matching the
configured runtime version (e.g. v1.27.1).
Sourcepub fn build_git_submodule_command(&self) -> ShellCommand
pub fn build_git_submodule_command(&self) -> ShellCommand
Construct the git submodule update command.
Sourcepub fn build_build_command(&self, rocm_env: &RocmEnv) -> ShellCommand
pub fn build_build_command(&self, rocm_env: &RocmEnv) -> ShellCommand
Construct the ONNX Runtime build.sh command with ROCm flags.
The original script runs ./build.sh with many flags:
--config Release--build_wheel--parallel $(nproc)-1--use_rocm --rocm_home /opt/rocm--rocm_version 70200--use_migraphx --migraphx_home /opt/rocm--cmake_extra_defines CMAKE_HIP_ARCHITECTURES=...- Various CMAKE isolation defines
--allow_running_as_root
Sourcepub fn build_uninstall_command(&self) -> ShellCommand
pub fn build_uninstall_command(&self) -> ShellCommand
Construct the pip uninstall command to remove all onnxruntime variants.
Sourcepub fn build_wheel_install_command(&self) -> ShellCommand
pub fn build_wheel_install_command(&self) -> ShellCommand
Construct the pip install command for the built wheel.
The original script installs from:
build/Linux/Release/dist/*.whl
Auto Trait Implementations§
impl Freeze for OnnxRuntimeInstaller
impl RefUnwindSafe for OnnxRuntimeInstaller
impl Send for OnnxRuntimeInstaller
impl Sync for OnnxRuntimeInstaller
impl Unpin for OnnxRuntimeInstaller
impl UnsafeUnpin for OnnxRuntimeInstaller
impl UnwindSafe for OnnxRuntimeInstaller
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more