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 dependencies(&self) -> &[&str]
pub fn dependencies(&self) -> &[&str]
Get the list of required dependencies.
ONNX Runtime depends on ROCm.
Sourcepub fn format_rocm_version_for_ort(&self, rocm_version: &str) -> String
pub fn format_rocm_version_for_ort(&self, rocm_version: &str) -> String
Format ROCm version for ONNX Runtime (e.g., “7.2.0” -> “70200”).
The original script formats as Mmmpp: printf "%d%02d%02d" major minor patch.
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_wheel_url(&self) -> String
pub fn build_migraphx_wheel_url(&self) -> String
Construct the AMD manylinux repo URL for onnxruntime-migraphx.
Pattern: https://repo.radeon.com/rocm/manylinux/rocm-rel-{release}/
The URL points to a specific wheel matching the Python version and ROCm release. ROCm 7.2.4 ships onnxruntime_migraphx 1.23.2.
Sourcepub fn build_migraphx_install_command(&self) -> ShellCommand
pub fn build_migraphx_install_command(&self) -> ShellCommand
Construct the pip install command for onnxruntime-migraphx from AMD repo.
This is the default install method — the AMD-provided wheel includes the MIGraphX execution provider and is built against the matching ROCm version, avoiding ABI incompatibility issues with PyPI’s onnxruntime-rocm.
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 stable tag.
The original script checks out tag v1.20.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