# qairt.api.common.backends.htp

- *class* qairt.api.common.backends.htp.config.HtpConfigHelper

    - Bases: `object`

Helper class to convert HTP config to backend extension config needed by QAIRT Tools.

- *classmethod* from\_backend\_extension\_dict(*backend\_ext: Dict[str, Any]*) → Tuple[List[[HtpContextConfig](https://docs.qualcomm.com/doc/80-87189-2/topic/qairt-api-common-backends-htp.html#qairt.api.common.backends.htp.config.HtpContextConfig)], List[[HtpGraphConfig](https://docs.qualcomm.com/doc/80-87189-2/topic/qairt-api-common-backends-htp.html#qairt.api.common.backends.htp.config.HtpGraphConfig)], List[[HtpDeviceConfig](https://docs.qualcomm.com/doc/80-87189-2/topic/qairt-api-common-backends-htp.html#qairt.api.common.backends.htp.config.HtpDeviceConfig)], Optional[[HtpMemoryConfig](https://docs.qualcomm.com/doc/80-87189-2/topic/qairt-api-common-backends-htp.html#qairt.api.common.backends.htp.config.HtpMemoryConfig)], Optional[[HtpGroupContextConfig](https://docs.qualcomm.com/doc/80-87189-2/topic/qairt-api-common-backends-htp.html#qairt.api.common.backends.htp.config.HtpGroupContextConfig)], Dict[str, Any]]

    - Parse a backend extension dictionary into HTP config objects.

Handles reverse alias mapping (e.g. `"vtcm_mb"` -&gt; `vtcm_size_in_mb`,
`"O"` -&gt; `optimization_type`). Unknown fields within a known section are
stored in the config object’s `_extras`. Unknown top-level sections are
returned as `section_extras`.

For graph configs, `graph_names` lists with multiple entries are expanded
into one `HtpGraphConfig` per name, each sharing the same options.

- Parameters

    - **backend\_ext** – The raw backend extension dictionary (as loaded from JSON).

- Returns

    - A tuple of (context\_configs, graph\_configs, device\_configs, memory\_config,
group\_context\_config, section\_extras).

- *classmethod* list\_config\_options()

    - 

- *static* list\_options()

    - 

- *static* shared\_library\_path()

    - 

- *static* to\_backend\_extension\_dict(*context\_configs: Optional[List[[HtpContextConfig](https://docs.qualcomm.com/doc/80-87189-2/topic/qairt-api-common-backends-htp.html#qairt.api.common.backends.htp.config.HtpContextConfig)]] = None*, *graph\_configs: Optional[List[[HtpGraphConfig](https://docs.qualcomm.com/doc/80-87189-2/topic/qairt-api-common-backends-htp.html#qairt.api.common.backends.htp.config.HtpGraphConfig)]] = None*, *device\_configs: Optional[List[[HtpDeviceConfig](https://docs.qualcomm.com/doc/80-87189-2/topic/qairt-api-common-backends-htp.html#qairt.api.common.backends.htp.config.HtpDeviceConfig)]] = None*, *memory\_config: Optional[[HtpMemoryConfig](https://docs.qualcomm.com/doc/80-87189-2/topic/qairt-api-common-backends-htp.html#qairt.api.common.backends.htp.config.HtpMemoryConfig)] = None*, *group\_context: Optional[[HtpGroupContextConfig](https://docs.qualcomm.com/doc/80-87189-2/topic/qairt-api-common-backends-htp.html#qairt.api.common.backends.htp.config.HtpGroupContextConfig)] = None*) → Dict[str, Any]

    - Builds the backend extension dictionary based on the provided configurations.

- Parameters

    - - **context\_configs** – List of context configurations.
- **graph\_configs** – List of graph configurations.
- **device\_configs** – List of device configurations.
- **memory\_config** – Memory configuration.
- **group\_context** – Group context configuration.

Examples

>>> context_configs = [HtpContextConfig(weight_sharing_enabled=True)]
    >>> graph_configs = [HtpGraphConfig(name="graph1")]
    >>> HtpConfigHelper.to_backend_extension_dict(context_configs, graph_configs)
    Copy to clipboard

- Returns

    - Dictionary representing the backend extension.

- *pydantic model* qairt.api.common.backends.htp.config.HtpContextConfig

    - Bases: `BaseModel`

Context Configuration for HTP Backend

- Validators

    - - [`validate_group_id_max_spill_fill_buffer_for_group`](https://docs.qualcomm.com/doc/80-87189-2/topic/qairt-api-common-backends-htp.html#qairt.api.common.backends.htp.config.HtpContextConfig.validate_group_id_max_spill_fill_buffer_for_group) » `all fields`

- *field* extended\_udma*: bool*  *= False*

    - Enables user direct memory access (UDMA). Only supported on HTP v81 and above.

- Validated by

    - - [`validate_group_id_max_spill_fill_buffer_for_group`](https://docs.qualcomm.com/doc/80-87189-2/topic/qairt-api-common-backends-htp.html#qairt.api.common.backends.htp.config.HtpContextConfig.validate_group_id_max_spill_fill_buffer_for_group)

- *field* file\_read\_memory\_budget\_in\_mb*: int*  *= 0*

    - Allows users to configure the read memory budget of the deserialized binary in megabytes (Mb).
It gives a hint to the backend to load the binary in chunks,
instead of loading the entire binary to memory at once.

- Validated by

    - - [`validate_group_id_max_spill_fill_buffer_for_group`](https://docs.qualcomm.com/doc/80-87189-2/topic/qairt-api-common-backends-htp.html#qairt.api.common.backends.htp.config.HtpContextConfig.validate_group_id_max_spill_fill_buffer_for_group)

- *field* group\_id*: int*  *= 0*

    - Specifies the group id to which contexts can be associated.

- Validated by

    - - [`validate_group_id_max_spill_fill_buffer_for_group`](https://docs.qualcomm.com/doc/80-87189-2/topic/qairt-api-common-backends-htp.html#qairt.api.common.backends.htp.config.HtpContextConfig.validate_group_id_max_spill_fill_buffer_for_group)

- *field* init\_acceleration*: bool*  *= False*

    - Used to enable init acceleration when creating context from a serialized context binary.

- Validated by

    - - [`validate_group_id_max_spill_fill_buffer_for_group`](https://docs.qualcomm.com/doc/80-87189-2/topic/qairt-api-common-backends-htp.html#qairt.api.common.backends.htp.config.HtpContextConfig.validate_group_id_max_spill_fill_buffer_for_group)

- *field* io\_memory\_estimation*: bool*  *= False*

    - Enables I/O memory estimation when multiple PDs are available.
It estimates the total size of the I/O tensors required by the context to ensure sufficient space
on the PD before deserialization.

- Validated by

    - - [`validate_group_id_max_spill_fill_buffer_for_group`](https://docs.qualcomm.com/doc/80-87189-2/topic/qairt-api-common-backends-htp.html#qairt.api.common.backends.htp.config.HtpContextConfig.validate_group_id_max_spill_fill_buffer_for_group)

- *field* lora\_weight\_sharing*: bool*  *= False*

    - Used for enabling Lora Weight Sharing during offline preparation.

- Validated by

    - - [`validate_group_id_max_spill_fill_buffer_for_group`](https://docs.qualcomm.com/doc/80-87189-2/topic/qairt-api-common-backends-htp.html#qairt.api.common.backends.htp.config.HtpContextConfig.validate_group_id_max_spill_fill_buffer_for_group)

- *field* lora\_weight\_sharing\_ram\_preload*: bool*  *= False*

    - Used for enabling Lora Weight Sharing Ram Preload when creating context from a serialized
context binary.

- Validated by

    - - [`validate_group_id_max_spill_fill_buffer_for_group`](https://docs.qualcomm.com/doc/80-87189-2/topic/qairt-api-common-backends-htp.html#qairt.api.common.backends.htp.config.HtpContextConfig.validate_group_id_max_spill_fill_buffer_for_group)

- *field* max\_spill\_fill\_buffer\_for\_group*: int*  *= 0*

    - Used to associate max spill-fill buffer size across multiple contexts within a group.
Group\_id value must be set to 0 for this option to be used.

- Constraints

    - - **ge** = 0

- Validated by

    - - [`validate_group_id_max_spill_fill_buffer_for_group`](https://docs.qualcomm.com/doc/80-87189-2/topic/qairt-api-common-backends-htp.html#qairt.api.common.backends.htp.config.HtpContextConfig.validate_group_id_max_spill_fill_buffer_for_group)

- *field* weight\_sharing\_enabled*: bool*  *= False*

    - This feature allows common weights across graphs (max 64) to be shared and
stored in a single context binary.

- Validated by

    - - [`validate_group_id_max_spill_fill_buffer_for_group`](https://docs.qualcomm.com/doc/80-87189-2/topic/qairt-api-common-backends-htp.html#qairt.api.common.backends.htp.config.HtpContextConfig.validate_group_id_max_spill_fill_buffer_for_group)

- model\_post\_init(*context: Any*, */*) → None

    - This function is meant to behave like a BaseModel method to initialise private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

- Parameters

    - - **self** – The BaseModel instance.
- **context** – The context.

- *validator* validate\_group\_id\_max\_spill\_fill\_buffer\_for\_group*»* *all fields*

    - Validate group\_id vs max\_spill\_fill\_buffer\_for\_group

- *pydantic model* qairt.api.common.backends.htp.config.HtpDeviceConfig

    - Bases: `BaseModel`

Device Configuration for HTP Backend

- *field* core\_ids*: Optional[List[int]]*  *= None*

    - Select the core ids. Used to select among the cores available in a device.

- *field* core\_type*: int*  *= 0*

    - Select the available core type. 0 - NSP, 1 - HPASS.

- *field* cores*: List[[HtpDeviceCoreConfig](https://docs.qualcomm.com/doc/80-87189-2/topic/qairt-api-common-backends-htp.html#qairt.api.common.backends.htp.config.HtpDeviceCoreConfig)]*  *[Optional]*

    - List of core configurations.

- *field* dsp\_arch*: Optional[Union[[DspArchitecture](https://docs.qualcomm.com/doc/80-87189-2/topic/qairt-api-configs.html#qairt.api.configs.common.DspArchitecture), str]]*  *= None*

    - The DSP architecture version for this SOC. See DspArchitecture.list\_options() for all
available options

- *field* id*: int*  *= 0*

    - An optional id for the device configuration.

- *field* pd\_session*: Literal['signed', 'unsigned']*  *= 'unsigned'*

    - Specifies the user process domain attribute

- *field* profiling\_level*: Optional[Literal['linting']]*  *= 'linting'*

    - Used for linting profiling level.

- *field* soc\_id*: int*  *= 0*

    - Selection of the SoC.

- *field* soc\_model*: int*  *= 0*

    - The Snapdragon SOC family associated with the device. E.x. 69. The SOC model must be related to the dsp
architecture below.

- model\_post\_init(*context: Any*, */*) → None

    - This function is meant to behave like a BaseModel method to initialise private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

- Parameters

    - - **self** – The BaseModel instance.
- **context** – The context.

- *pydantic model* qairt.api.common.backends.htp.config.HtpDeviceCoreConfig

    - Bases: `BaseModel`

Core Configuration for HTP Backend

- *field* adaptive\_polling\_time*: int*  *= 0*

    - Adaptive polling time value in micro second.

- *field* hmx\_timeout\_us*: int*  *= 300000*

    - Hmx timeout value in micro second.

- *field* id*: int*  *= 0*

    - Unique identifier for the core configuration

- *field* perf\_profile*: [PerfProfile](https://docs.qualcomm.com/doc/80-87189-2/topic/qairt-api-configs.html#qairt.api.configs.common.PerfProfile)*  *= PerfProfile.BURST*

    - - Performance profile options. Use PerfProfile.list\_options() for all
    - available options

- *field* rpc\_control\_latency*: int*  *= 100*

    - Rpc control latency value in micro second.

- *field* rpc\_polling\_time*: int*  *= 9999*

    - Rpc polling time value in micro second.

- model\_post\_init(*context: Any*, */*) → None

    - This function is meant to behave like a BaseModel method to initialise private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

- Parameters

    - - **self** – The BaseModel instance.
- **context** – The context.

- *pydantic model* qairt.api.common.backends.htp.config.HtpGraphConfig

    - Bases: `BaseModel`

Graph configuration for HTP Backend

- Validators

    - - `_validate_optimization_type` » [`optimization_type`](https://docs.qualcomm.com/doc/80-87189-2/topic/qairt-api-common-backends-htp.html#qairt.api.common.backends.htp.config.HtpGraphConfig.optimization_type)

- *field* advanced\_activation\_fusion*: bool*  *= True*

    - Specifies whether to enable or disable fusion of convolution operations with advanced activation
functions such as sigmoid, tanh, gelu, and swish. When enabled, it may improve performance in
floating-point models. When disabled, it may improve accuracy at the cost of performance.
Note that this option has no effect on quantized graphs.

- *field* assume\_same\_quant*: bool*  *= False*

    - When set to True, assumes the same quantization is used across LoRA adapter tensors.
Required when LoRA adapters are used during compilation.

- *field* dlbc*: Literal[0, 1]*  *= 0*

    - Provide deep learning bandwidth compression value 0 or 1.

- *field* dlbc\_weights*: int*  *= 0*

    - Number of weights to use for compression. Only used when dlbc is set to 1.

- *field* finalize\_config*: Optional[dict]*  *= None*

    - Field to set the finalize config dict for backend extension

- *field* fold\_relu\_activation\_into\_conv\_off*: bool*  *= False*

    - Specifies whether to configure fold relu activation for the graph.

- *field* fp16\_relaxed\_precision*: int*  *= 0*

    - Used to perform computation with half precision i.e. 16 bits

- *field* hvx\_threads*: int*  *= 0*

    - Corresponds to the number of HVX threads to use for a particular graph during an inference.

- *field* monolithic\_lstm*: bool*  *= False*

    - Specifies whether to configure monolithic lstm for the graph.

- *field* name*: str*  *[Required]*

    - Corresponds to the graph name provided to QnnGraph\_create

- *field* num\_cores*: Optional[int]*  *= None*

    - Number of cores to use for this graph. Set from the cores: spec string entry.

- *field* optimization\_type*: Union[int, float]*  *= 2*

    - Set graph optimization value in range 1 to 3. As numbers increase, there is a tradeoff between preparation
times to graph optimality.

1 implies fastest preparation time, least optimal graph.
3. implies slowest preparation time, most optimal graph.

- Validated by

    - - `_validate_optimization_type`

- *field* short\_depth\_conv\_on\_hmx\_off*: bool*  *= False*

    - Specifies whether to configure short depth convolution for the graph.

- *field* use\_high\_precision\_fp16\_sigmoid*: bool*  *= False*

    - Specifies whether to configure use high precision fp16 sigmoid for the graph.

- *field* vtcm\_size*: int*  *= 0*

    - 0 means the MAX value of vtcm size by the soc\_id or the current device

- *field* vtcm\_size\_in\_mb*: int*  *= 0*

    - Provides performance infrastructure configuration options that are memory specific.
To use a device’s maximum VTCM amount, set the value to 0 (QNN\_HTP\_GRAPH\_CONFIG\_OPTION\_MAX) and
specify the target SoC through the device config.

- *field* weights\_packing*: bool*  *= False*

    - Specifies whether to enable weights packing.

- model\_post\_init(*context: Any*, */*) → None

    - This function is meant to behave like a BaseModel method to initialise private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

- Parameters

    - - **self** – The BaseModel instance.
- **context** – The context.

- *pydantic model* qairt.api.common.backends.htp.config.HtpGroupContextConfig

    - Bases: `BaseModel`

Group Context Configuration for HTP Backend

- *field* share\_resources*: bool*  *= False*

    - Enables resource sharing across different contexts during binary generation.
When enabled, it allows the backend to apply HTP virtual address space optimization.
Note: This feature cannot be used with graph switching.

- model\_post\_init(*context: Any*, */*) → None

    - This function is meant to behave like a BaseModel method to initialise private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

- Parameters

    - - **self** – The BaseModel instance.
- **context** – The context.

- *pydantic model* qairt.api.common.backends.htp.config.HtpMemoryConfig

    - Bases: `BaseModel`

Memory Configuration for HTP Backend

- *field* mem\_type*: Literal['shared\_buffer']*  *= 'shared\_buffer'*

    - 

- model\_post\_init(*context: Any*, */*) → None

    - This function is meant to behave like a BaseModel method to initialise private attributes.

It takes context as an argument since that’s what pydantic-core passes when calling it.

- Parameters

    - - **self** – The BaseModel instance.
- **context** – The context.

Last Published: Jun 19, 2026

[Previous Topic
qairt.api.common.backends.aic](https://docs.qualcomm.com/bundle/publicresource/80-87189-2/topics/qairt-api-common-backends-aic.md) [Next Topic
qairt.api.common.backends.htp\_mcp](https://docs.qualcomm.com/bundle/publicresource/80-87189-2/topics/qairt-api-common-backends-htp_mcp.md)