SessionConfig class
Configuration for ONNX Runtime session performance tuning.
These settings control threading, graph optimization, and execution mode. They are applied to the session options before creating a session.
Android Big.LITTLE Recommendations
- intraOpThreads: 2–4 is optimal. Excess threads cause contention.
- interOpThreads: 1 for sequential mode, 2 for parallel mode.
- graphOptimizationLevel: 99 (all) for maximum optimization.
- executionMode: Sequential (0) is usually better on mobile.
Constructors
- SessionConfig({int intraOpThreads = 0, int interOpThreads = 0, GraphOptLevel graphOptimizationLevel = GraphOptLevel.all, ExecutionMode executionMode = ExecutionMode.sequential})
-
const
Properties
- executionMode → ExecutionMode
-
Execution mode: sequential or parallel.
final
- graphOptimizationLevel → GraphOptLevel
-
Graph optimization level.
See GraphOptLevel for values.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- interOpThreads → int
-
Number of threads for inter-op parallelism (across nodes).
Only effective when executionMode is ExecutionMode.parallel.
0 = ORT default.
final
- intraOpThreads → int
-
Number of threads for intra-op parallelism (within a single node).
0 = ORT default, 1 = single-threaded, 2–4 recommended for mobile.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Constants
- androidOptimized → const SessionConfig
- Recommended config for Android devices with Big.LITTLE architecture.
- defaults → const SessionConfig
- Default config (ORT defaults, no tuning).