[Hexagon] Experimental Qualcomm Hexagon DSP HAL driver (part 1: list and open devices) (#25188) This is the first part of upstreaming the Hexagon HAL driver that Roofline is developing in a separate plugin repository (https://github.com/RooflineAI/iree-hexagon-plugins). The driver runs on Android arm64 hosts and is compatible with Qualcomm Snapdragon SoCs, using FastRPC to drive the Hexagon DSP. It lives in `experimental/runtime/src/iree/hal/drivers/hexagon` and is neither included in the cmake build nor in the bazel build by default. This initial PR adds the part of the runtime for listing Hexagon devices and opening a Hexagon device. However, no functionality is provided by this device yet, so it immediately will fail with UNIMPLEMENTED. See `experimental/runtime/src/iree/hal/drivers/hexagon/README.md` for how to build the (partial) Hexagon runtime and how to test it. # Commits on this PR - **[Bazel] Add Android arm64 cross-compilation toolchain** Adds a C/C++ toolchain and platform for building the runtime for Android arm64 with the Android NDK r28 (API level 28): `bazel build --config=android_arm64 //tools:iree-run-module`. The NDK is located via the `ANDROID_NDK` (or `ANDROID_NDK_HOME`) environment variable. Without a configured NDK the repository is a stub and the toolchain targets are only analyzed for Android, so host builds are not affected. `iree_is_android` now also matches the Android platform in addition to `--define=iree_is_android=true`. - **[Hexagon] Add build support for the Hexagon SDK** Prepares building the experimental Hexagon HAL driver: - `@hexagon_sdk` repository (Bazel), downloading the free Hexagon SDK release or using an existing installation via `--repo_env=HEXAGON_SDK_ROOT`, and `iree_hexagon_sdk.cmake` (CMake, `HEXAGON_SDK_ROOT`). - `iree_hexagon_interface`: generates FastRPC stub/skel sources from IDL files with the SDK qaic compiler. - `iree_hexagon_dsp_library`: builds a FastRPC skeleton shared library for the DSP by invoking the SDK compiler directly. - `bazel_to_cmake` conversions for the above and for `experimental/runtime/src`, a package root mirroring `runtime/src`. - `experimental/runtime` is no longer ignored by Bazel. All Hexagon targets are restricted to Android aarch64, so host builds do not fetch the SDK. - **[Hexagon] Add FastRPC interface and DSP library** Adds the FastRPC interface between the Hexagon HAL driver on the Android host and the DSP (interface `hexagon_dsp : remote_handle64`, without any RPCs yet) and the DSP library `libhexagon_dsp_skel.so` for Hexagon v79, implementing opening and closing of the RPC session. - **[Hexagon] Add experimental Hexagon HAL driver** Adds the host side of the experimental Qualcomm Hexagon DSP HAL driver for Android aarch64. The driver lists the DSP domains supporting unsigned protection domains as devices. Creating a device opens a FastRPC session with the DSP, which loads `libhexagon_dsp_skel.so`. Allocation, executables, command buffers, and queue operations are not implemented yet and return `UNIMPLEMENTED`. Enable with: - `bazel build --config=hexagon //tools:iree-run-module` - `cmake ... -DIREE_EXTERNAL_HAL_DRIVERS=hexagon -DHEXAGON_SDK_ROOT=<path>` - **[Hexagon] Add README and code owners for the Hexagon HAL driver** Documents building, deploying, and manually verifying the experimental Hexagon HAL driver. # Local Testing Log of local testing with a OnePlus 13 phone: ``` ~/iree$ add push ../iree-build-android/tools/iree-run-module /data/local/tmp/schuermans-roofline/upstream/bin/ ../iree-build-android/tools/iree-run-module: 1 file pushed, 0 skipped. 333.6 MB/s (10283608 bytes in 0.029s) ~/iree$ adb push ../iree-build-android/experimental/runtime/src/iree/hal/drivers/hexagon/dsp/libhexagon_dsp_skel.so /data/local/tmp/schuermans-roofline/upstream/lib/hexagon ../iree-build-android/experimental/runtime/src/iree/hal/drivers/hexagon/dsp/libhexagon_dsp_skel.so: 1 file pushed, 0 skipped. 127.3 MB/s (9128 bytes in 0.000s) ~/iree$ adb shell 'cd /data/local/tmp/schuermans-roofline/upstream/; bin/iree-run-module --list_drivers' # ============================================================================ # Available HAL drivers # ============================================================================ # Use --list_devices={driver name} to enumerate available devices. local-sync: Local execution using a lightweight inline synchronous queue local-task: Local execution using the IREE multithreading task system vulkan: Vulkan HAL Rewrite Scaffold hexagon: Qualcomm Hexagon DSP (experimental) ~/iree$ adb shell 'cd /data/local/tmp/schuermans-roofline/upstream/; bin/iree-run-module --list_devices' local-sync:// local-task:// vulkan://GPU-435100000700000000d57000140000d5 hexagon://CDSP ~/iree$ adb shell 'cd /data/local/tmp/schuermans-roofline/upstream/; bin/iree-run-module --device=hexagon://CDSP --module=model.vmfb' iree/experimental/runtime/src/iree/hal/drivers/hexagon/device.c:586: UNIMPLEMENTED; hexagon executables not implemented; creating VM context; creating run context ~/iree$ ``` The last UNIMPLEMENTED error is expected for now, becuase the runtime implementation is still very incomplete. --------- Signed-off-by: Stefan Schuermans <schuermans@roofline.ai> Co-authored-by: L-roro <115032777+L-roro@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
IREE (Intermediate Representation Execution Environment, pronounced as “eerie”) is an MLIR-based end-to-end compiler and runtime that lowers Machine Learning (ML) models to a unified IR that scales up to meet the needs of the datacenter and down to satisfy the constraints and special considerations of mobile and edge deployments.
See our website for project details, user guides, and instructions on building from source.
Releases notes are published on GitHub releases.
| Package | Release status |
|---|---|
| GitHub release (stable) | |
| GitHub release (nightly) | |
iree-base-compiler | |
iree-base-runtime |
For more details on the release process, see https://iree.dev/developers/general/release-management/.
| Operating system | Build status |
|---|---|
| Linux | |
| macOS |
For the full list of workflows see https://iree.dev/developers/general/github-actions/.
See our website for more information.
Community meeting recordings: IREE YouTube channel
| Date | Title | Recording | Slides |
|---|---|---|---|
| 2025-06-10 | Data-Tiling in IREE: Achieving High Performance Through Compiler Design (AsiaLLVM) | recording | slides |
| 2025-05-17 | Introduction to GPU architecture and IREE's GPU CodeGen Pipeline | recording | slides |
| 2025-02-12 | The Long Tail of AI: SPIR-V in IREE and MLIR (Vulkanised) | recording | slides |
| 2024-10-01 | Unveiling the Inner Workings of IREE: An MLIR-Based Compiler for Diverse Hardware | recording | |
| 2021-06-09 | IREE Runtime Design Tech Talk | recording | slides |
| 2020-08-20 | IREE CodeGen (MLIR Open Design Meeting) | recording | slides |
| 2020-03-18 | Interactive HAL IR Walkthrough | recording | |
| 2020-01-31 | End-to-end MLIR Workflow in IREE (MLIR Open Design Meeting) | recording | slides |
IREE is licensed under the terms of the Apache 2.0 License with LLVM Exceptions. See LICENSE for more information.