hls4ml.backends package
Subpackages
- hls4ml.backends.fpga package
- hls4ml.backends.quartus package
- hls4ml.backends.vivado package
- Subpackages
- hls4ml.backends.vivado.passes package
- Submodules
- hls4ml.backends.vivado.passes.bram_weights module
- hls4ml.backends.vivado.passes.clone module
- hls4ml.backends.vivado.passes.conv_same_pad module
- hls4ml.backends.vivado.passes.conv_stream module
- hls4ml.backends.vivado.passes.convolution_templates module
- hls4ml.backends.vivado.passes.core_templates module
- hls4ml.backends.vivado.passes.garnet_templates module
- hls4ml.backends.vivado.passes.merge_templates module
- hls4ml.backends.vivado.passes.pointwise module
- hls4ml.backends.vivado.passes.pooling_templates module
- hls4ml.backends.vivado.passes.quantization_templates module
- hls4ml.backends.vivado.passes.recurrent_templates module
- hls4ml.backends.vivado.passes.repack_stream module
- hls4ml.backends.vivado.passes.reshaping_templates module
- hls4ml.backends.vivado.passes.resource_strategy module
- hls4ml.backends.vivado.passes.transform_types module
- Module contents
- hls4ml.backends.vivado.passes package
- Submodules
- hls4ml.backends.vivado.vivado_backend module
- Module contents
- Subpackages
- hls4ml.backends.vivado_accelerator package
Submodules
hls4ml.backends.backend module
-
class
hls4ml.backends.backend.Backend(name) Bases:
object-
create_initial_config(**kwargs) Create the minimal conversion config for the backend.
Subclasses should implement this method to provide the initial configuration for the conversion.
-
create_layer_class(layer_class) Wrap the original layer class into the backend-specific layer class.
Backends should extend base layer classes with new attributes and variables as needed. These new classes are then used within the model.
- Parameters
layer_class (class) – Base class to extend
-
get_available_flows() Returns the list of flows registered for this backend.
- Returns
The list of registered flows.
- Return type
list
-
get_custom_source() Returns the registered custom source files.
- Returns
- Custom source files. Keys represent destination paths, values are absolute paths to registered source
files.
- Return type
dict
-
get_default_flow() The name of the default flow of the backend.
Default flow is used as the conversion target if the target flow has not been specified.
-
register_pass(name, opt_cls, flow=None) Register an optimizer path for the backend.
Note that user-provided optimizers registered without specifying any flow will not be invoked.
- Parameters
name (str) – Name of the optimizer
opt_cls (class) – Optimizer class
flow (str, list or tuple, optional) – Existing flow(s) to add the optimizer to. Defaults to None.
-
register_source(source_file, destination_dir='nnet_utils') Register custom source that is not part of the backend’s templates.
- Parameters
source_file (str or Path) – Absolute path to the source file.
destination_dir (str, optional) – The sub-directory of the output project to write the source file to. Defaults to ‘nnet_utils’.
- Raises
Exception – If the source file is not a str or Path, or if the path is not absolute
-
register_template(template_cls) Register a template “optimizer”.
E.g., function call template or op configuration template.
- Parameters
template_cls (class) – Template to register.
-
-
hls4ml.backends.backend.get_available_backends()
-
hls4ml.backends.backend.get_backend(name)
-
hls4ml.backends.backend.register_backend(name, backend_cls) Create the backend instance and add it to the registry.
- Parameters
name (str) – Name of the backend.
backend_cls (class) – Backend class to instantiate. Class must implement a constructor without parameters.
- Raises
Exception – If the backend has already been registered.
hls4ml.backends.template module
-
class
hls4ml.backends.template.FunctionCallTemplate(layer_class, include_header=None)
-
class
hls4ml.backends.template.LayerConfigTemplate(layer_class)