hls4ml.backends package
Subpackages
- hls4ml.backends.fpga package
- Subpackages
- Submodules
- hls4ml.backends.fpga.fpga_backend module
FPGABackendFPGABackend.compile()FPGABackend.compute_conv1d_instructions()FPGABackend.compute_conv2d_instructions()FPGABackend.convert_precision_string()FPGABackend.create_layer_class()FPGABackend.generate_conv1d_line_buffer_fn()FPGABackend.generate_conv2d_line_buffer_fn()FPGABackend.get_closest_reuse_factor()FPGABackend.get_layer_mult_size()FPGABackend.get_valid_conv_partition_splits()FPGABackend.get_valid_reuse_factors()FPGABackend.get_writer_flow()FPGABackend.product_type()FPGABackend.set_closest_reuse_factor()FPGABackend.set_target_reuse_factor()FPGABackend.write()FPGABackend.write_hls()
- hls4ml.backends.fpga.fpga_layers module
- hls4ml.backends.fpga.fpga_types module
ACFixedPrecisionDefinitionACIntegerPrecisionDefinitionACTypeConverterAPFixedPrecisionDefinitionAPIntegerPrecisionDefinitionAPTypeConverterArrayVariableConverterBramWeightVariableConverterCompressedTypeConverterExponentTypeConverterFixedPrecisionConverterHLSTypeConverterInplaceVariableConverterNamedTypeConverterPackedTypeConverterPrecisionConverterPrecisionDefinitionQuartusArrayVariableConverterQuartusArrayVariableDefinitionQuartusInplaceVariableConverterQuartusStreamVariableConverterQuartusStreamVariableDefinitionQuartusStructMemberVariableConverterQuartusStructMemberVariableDefinitionStaticWeightVariableConverterStaticWeightVariableDefinitionStreamVariableConverterStructMemberVariableConverterTypeDefinitionTypePrecisionConverterVariableDefinitionVivadoArrayVariableConverterVivadoArrayVariableDefinitionVivadoInplaceVariableConverterVivadoStreamVariableConverterVivadoStreamVariableDefinition
- Module contents
- hls4ml.backends.quartus package
- Subpackages
- hls4ml.backends.quartus.passes package
- Submodules
- hls4ml.backends.quartus.passes.convolution_templates module
- hls4ml.backends.quartus.passes.convolution_winograd module
- hls4ml.backends.quartus.passes.core_templates module
- hls4ml.backends.quartus.passes.merge_templates module
- hls4ml.backends.quartus.passes.pointwise module
- hls4ml.backends.quartus.passes.pooling_templates module
- hls4ml.backends.quartus.passes.quantization_templates module
- hls4ml.backends.quartus.passes.recurrent_templates module
- hls4ml.backends.quartus.passes.reshaping_templates module
- hls4ml.backends.quartus.passes.resource_strategy module
- hls4ml.backends.quartus.passes.transform_types module
- Module contents
- hls4ml.backends.quartus.passes package
- Submodules
- hls4ml.backends.quartus.quartus_backend module
QuartusBackendQuartusBackend.build()QuartusBackend.create_initial_config()QuartusBackend.get_default_flow()QuartusBackend.get_writer_flow()QuartusBackend.init_activation()QuartusBackend.init_base_layer()QuartusBackend.init_conv1d()QuartusBackend.init_conv2d()QuartusBackend.init_dense()QuartusBackend.init_embed()QuartusBackend.init_gru()QuartusBackend.init_lstm()QuartusBackend.init_simple_rnn()QuartusBackend.init_softmax()
chdir()
- Module contents
- Subpackages
- hls4ml.backends.vivado package
- Subpackages
- hls4ml.backends.vivado.passes package
- Submodules
- hls4ml.backends.vivado.passes.bram_weights 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.fifo_depth_optimization 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
VivadoBackendVivadoBackend.build()VivadoBackend.create_initial_config()VivadoBackend.get_default_flow()VivadoBackend.get_writer_flow()VivadoBackend.init_base_layer()VivadoBackend.init_conv1d()VivadoBackend.init_conv2d()VivadoBackend.init_dense()VivadoBackend.init_depconv2d()VivadoBackend.init_embed()VivadoBackend.init_garnet()VivadoBackend.init_garnet_stack()VivadoBackend.init_global_pooling1d()VivadoBackend.init_global_pooling2d()VivadoBackend.init_gru()VivadoBackend.init_lstm()VivadoBackend.init_pooling1d()VivadoBackend.init_pooling2d()VivadoBackend.init_sepconv1d()VivadoBackend.init_sepconv2d()VivadoBackend.init_softmax()
- Module contents
- Subpackages
- hls4ml.backends.vivado_accelerator package
- Subpackages
- Submodules
- hls4ml.backends.vivado_accelerator.vivado_accelerator_backend module
- hls4ml.backends.vivado_accelerator.vivado_accelerator_config module
VivadoAcceleratorConfigVivadoAcceleratorConfig.get_board()VivadoAcceleratorConfig.get_board_info()VivadoAcceleratorConfig.get_clock_period()VivadoAcceleratorConfig.get_corrected_types()VivadoAcceleratorConfig.get_driver()VivadoAcceleratorConfig.get_driver_file()VivadoAcceleratorConfig.get_driver_path()VivadoAcceleratorConfig.get_input_type()VivadoAcceleratorConfig.get_interface()VivadoAcceleratorConfig.get_io_bitwidth()VivadoAcceleratorConfig.get_krnl_rtl_src_dir()VivadoAcceleratorConfig.get_output_type()VivadoAcceleratorConfig.get_part()VivadoAcceleratorConfig.get_platform()VivadoAcceleratorConfig.get_tcl_file_path()
- Module contents
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)
Bases:
Template- transform(model, node)
Transformation to apply if matching was successful.
Transform should return a boolean value indicating if the model graph was altered (by adding/removing nodes).
- Parameters
model (ModelGraph) – Model to optimize
node (Layer) – The matched node in the model graph.
- class hls4ml.backends.template.Template(name, layer_class, attribute_name)
Bases:
OptimizerPass- format(node)
- get_name()
- match(node)
Predicate to match on a given node.
- Parameters
node (Layer) – Node in the model graph to try matching the optimizer on.
- transform(model, node)
Transformation to apply if matching was successful.
Transform should return a boolean value indicating if the model graph was altered (by adding/removing nodes).
- Parameters
model (ModelGraph) – Model to optimize
node (Layer) – The matched node in the model graph.