embedl_deploy.backend package#

Module contents:

Backend discovery and selection.

class embedl_deploy.backend.Backend(name: str, conversion_patterns: Sequence[Pattern], fusion_patterns: Sequence[Pattern], smooth_patterns: Sequence[Pattern], quantized_patterns: Sequence[Pattern])[source]#

Bases: object

A collection of patterns for a specific hardware target.

conversion_patterns: Sequence[Pattern]#

Structural rewrite patterns, applied iteratively.

fusion_patterns: Sequence[Pattern]#

Fusion patterns, applied in a single pass after conversions.

name: str#

Short identifier, matching the package directory name.

quantized_patterns: Sequence[Pattern]#

Q/DQ stub insertion patterns for quantization.

smooth_patterns: Sequence[Pattern]#

SmoothQuant preparation patterns.

embedl_deploy.backend.discover_backends() list[Backend][source]#

Return all installed backends.

Results are cached after the first call.

Returns:

List of discovered Backend instances.

embedl_deploy.backend.get_backend() Backend[source]#

Return the active backend, discovering it if necessary.

If no backend has been set via set_backend(), the installed backends are discovered automatically. When exactly one is found it becomes the active backend.

Returns:

The active Backend.

Raises:

RuntimeError – If no backends are installed, or if multiple backends are installed and none has been explicitly selected.

embedl_deploy.backend.set_backend(name: str) None[source]#

Select the active backend by name.

Parameters:

name – The name of a discovered backend (e.g. "tensorrt").

Raises:

ValueError – If name does not match any installed backend.