Skip to content

ariel-os/ariel-ml

Repository files navigation

Ariel-ML: Machine Learning Support with IREE for Ariel OS

Installing the prerequisites

  1. It is recommended to use Miniconda to set up the environment for reproducibility. All dependencies are listed in the environment.yml file included in this repository. Run the following command to create the same environment:

    conda env create --file environment.yml
  2. Set up Ariel OS Follow the official installation guide.

  3. Set up IREE We use a the Rust binding of IREE, provided by eerie: Clone the eerie repository and switch to the wip/ariel_ml branch:

    git switch wip/ariel_ml
    • 2.1 Install the IREE compiler

      pip install iree-compiler
    • 2.2 Initialize submodules (IREE runtime) The IREE runtime is embedded as a submodule under the Eerie repo. From the Eerie root, run:

      git submodule update --init --recursive

      ⚠️ This step may consume ~3 GiB of disk space.

  4. Configure package paths

    • Update the path field in laze-project.yml to point to your cloned Ariel OS repository.
    • Update the Eerie package path in Cargo.toml.
    • Update the IREE_PATH in .cargo/config.toml to point to the IREE repository. You may find it under eerie/eerie-sys, or you may use your own version.

Once these steps are complete, your playground environment is ready for experimenting with ML models.

Compile and Deploy Preset Models

Currently, we have tested two models under the native target:

  • Toy model: simple_mul
  • Real-world model: resnet50

You can select a model with the --features option:

laze build -b native run --features {resnet50,simple_mul}

The build system will automatically compile the chosen model.

Notes on ResNet50

The model file resnet50.mlir is quite large (~100 MB) and is not included in the repository. You can either:

  • Download it directly: Google Drive link

  • Or generate your own version using the script:

    python load_mlir.py cat115.jpg

Notes on simple_mul

This toy model performs an element-wise multiplication of two floating-point vectors (4 elements each).

⚠️ Limitation: It cannot currently run with no_std under native. The issue arises because the IREE runtime loads the model code into a memory section without execution permission (heap) and then attempts to execute it, causing a SIGSEGV on our testbed.

Workaround: To run it successfully, change the Eerie dependency features in Cargo.toml to:

eerie = { path = "/path/to/eerie", features = ["runtime, std"], default-features = false}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages