Provider configuration for SpacemiT
For the complete and authoritative provider option list, please refer to:
SpacemiT-ONNXRuntime ProviderOption documentation
This page only keeps the usage pattern in sherpa-onnx and a few commonly used options.
Basic usage
The simplest form is:
--provider=spacemit
sherpa-onnx also supports loading a provider config file by appending a
path after ::
--provider=spacemit:path/to/provider.config
The provider string is split into two parts:
The provider name, for example
spacemitThe config file path after
:
Config file format
The config file is a plain text file.
Empty lines are ignored
Lines starting with
#are ignoredEach entry uses
key: valueformat
For example:
# Example SpacemiT provider config
SPACEMIT_EP_INTRA_THREAD_NUM: 4
Common options
Please check the external SpacemiT-ONNXRuntime documentation for the full description. The options below are usually the most relevant when using sherpa-onnx.
SPACEMIT_EP_INTRA_THREAD_NUMControls the EP intra-thread count. This is the first option to tune when you want to adjust CPU utilization.
SPACEMIT_EP_USE_GLOBAL_INTRA_THREADLets multiple sessions share the same EP intra-thread pool in one process. This is useful only when you clearly control session scheduling.
SPACEMIT_EP_DUMP_SUBGRAPHSDumps EP subgraphs for debugging graph partition behavior.
SPACEMIT_EP_DEBUG_PROFILEWrites EP profiling data that can be inspected with timeline tools.
SPACEMIT_EP_DUMP_TENSORSDumps intermediate tensors for debugging correctness issues.
Threading behavior
When the SpacemiT execution provider is enabled, sherpa-onnx adjusts ORT threading internally:
Intra-op threads are set to
1Inter-op threads are set to
1If
SPACEMIT_EP_INTRA_THREAD_NUMis not present in the provider config, sherpa-onnx uses--num-threadsto populate it automatically
This means the following command is valid even without an explicit config file:
sherpa-onnx-offline --provider=spacemit --num-threads=4 ...
Common recommendations
- Start with
--provider=spacemitand--num-threads=Nbefore creating a custom config file.
- Start with
Add a config file only when you need explicit EP tuning or debugging.
- Use
SPACEMIT_EP_DUMP_SUBGRAPHSandSPACEMIT_EP_DEBUG_PROFILEwhen you investigate partition or performance issues.
- Use
- Use
SPACEMIT_EP_DISABLE_OP_TYPE_FILTERfor temporary compatibility workarounds when a specific operator type should fall back to CPU.
- Use
Starter template
You can create a minimal provider config file like this:
SPACEMIT_EP_INTRA_THREAD_NUM:4
SPACEMIT_EP_USE_GLOBAL_INTRA_THREAD:1