Table of Contents
Fetching ...

WCDT: Systematic WCET Optimization for Decision Tree Implementations

Nils Hölscher, Christian Hakert, Georg von der Brüggen, Jian-Jia Chen, Kuan-Hsun Chen, Jan Reineke

TL;DR

This work tackles the challenge of providing WCET guarantees for decision-tree inferences on resource-constrained embedded devices. It introduces a linear surrogate model, $WCET_{surrogate}(d,t)=\sigma+\delta\cdot d+\gamma\cdot t$, that estimates per-path WCET from path length $d$ and taken-branch count $t$, and a greedy algorithm, SurrogateOpt, that constructs WCET-optimal if-else-tree realizations under this model. Empirical results show the surrogate aligns well with analyzed WCETs on real and synthetic trees, enabling reductions of up to 17% in analytically determined WCET for deep trees, and up to 15–17% in actual WCET compared to naïve implementations and some ACET-based baselines. The findings demonstrate a practical, model-driven approach to predictable timing for tree-based ML on edge devices, with promising avenues for refining the surrogate and extending to additional WCET drivers.

Abstract

Machine-learning models are increasingly deployed on resource-constrained embedded systems with strict timing constraints. In such scenarios, the worst-case execution time (WCET) of the models is required to ensure safe operation. Specifically, decision trees are a prominent class of machine-learning models and the main building blocks of tree-based ensemble models (e.g., random forests), which are commonly employed in resource-constrained embedded systems. In this paper, we develop a systematic approach for WCET optimization of decision tree implementations. To this end, we introduce a linear surrogate model that estimates the execution time of individual paths through a decision tree based on the path's length and the number of taken branches. We provide an optimization algorithm that constructively builds a WCET-optimal implementation of a given decision tree with respect to this surrogate model. We experimentally evaluate both the surrogate model and the WCET-optimization algorithm. The evaluation shows that the optimization algorithm improves analytically determined WCET by up to $17\%$ compared to an unoptimized implementation.

WCDT: Systematic WCET Optimization for Decision Tree Implementations

TL;DR

This work tackles the challenge of providing WCET guarantees for decision-tree inferences on resource-constrained embedded devices. It introduces a linear surrogate model, , that estimates per-path WCET from path length and taken-branch count , and a greedy algorithm, SurrogateOpt, that constructs WCET-optimal if-else-tree realizations under this model. Empirical results show the surrogate aligns well with analyzed WCETs on real and synthetic trees, enabling reductions of up to 17% in analytically determined WCET for deep trees, and up to 15–17% in actual WCET compared to naïve implementations and some ACET-based baselines. The findings demonstrate a practical, model-driven approach to predictable timing for tree-based ML on edge devices, with promising avenues for refining the surrogate and extending to additional WCET drivers.

Abstract

Machine-learning models are increasingly deployed on resource-constrained embedded systems with strict timing constraints. In such scenarios, the worst-case execution time (WCET) of the models is required to ensure safe operation. Specifically, decision trees are a prominent class of machine-learning models and the main building blocks of tree-based ensemble models (e.g., random forests), which are commonly employed in resource-constrained embedded systems. In this paper, we develop a systematic approach for WCET optimization of decision tree implementations. To this end, we introduce a linear surrogate model that estimates the execution time of individual paths through a decision tree based on the path's length and the number of taken branches. We provide an optimization algorithm that constructively builds a WCET-optimal implementation of a given decision tree with respect to this surrogate model. We experimentally evaluate both the surrogate model and the WCET-optimization algorithm. The evaluation shows that the optimization algorithm improves analytically determined WCET by up to compared to an unoptimized implementation.

Paper Structure

This paper contains 12 sections, 3 theorems, 8 equations, 4 figures, 2 tables, 1 algorithm.

Key Result

Lemma 1

For a given surrogate model of the WCET defined in Eq. (eq:wcet-surrogate-reduced-pi) with $\pi \geq \delta \geq 0$ and two labeling functions $\lambda_1$ for the subtree rooted at $c_1$ and $\lambda_2$ for the subtree rooted at $c_2$, the condition implies that Therefore, if $C(ST(c_1), \lambda_1) \leq C(ST(c_2), \lambda_2)$, then $\lambda((r,c_1))$ should be taken and $\lambda((r,c_2))$ should

Figures (4)

  • Figure 1: Determination of the Surrogate Model for Real Datasets
  • Figure 2: Optimization of Decision Trees
  • Figure 3: Normalized estimated WCET based on the surrogate model (denoted as Normalized SM) for all datasets.
  • Figure 4: Normalized analyzed WCET results (based on LLVMTA) for all data sets.

Theorems & Definitions (5)

  • Lemma 1
  • proof
  • Theorem 1: Best-Case Labeling
  • proof : Proof
  • Corollary 1: Worst-Case Labeling