hls4ml.backends package
Subpackages
- hls4ml.backends.catapult package
- Subpackages
- hls4ml.backends.catapult.passes package
- Submodules
- hls4ml.backends.catapult.passes.bn_quant module
- hls4ml.backends.catapult.passes.broadcast_stream module
- hls4ml.backends.catapult.passes.conv_same_pad module
- hls4ml.backends.catapult.passes.conv_stream module
- hls4ml.backends.catapult.passes.convolution_templates module
- hls4ml.backends.catapult.passes.convolution_winograd module
- hls4ml.backends.catapult.passes.core_templates module
- hls4ml.backends.catapult.passes.fifo_depth_optimization module
- hls4ml.backends.catapult.passes.garnet_templates module
- hls4ml.backends.catapult.passes.merge_templates module
- hls4ml.backends.catapult.passes.pointwise module
- hls4ml.backends.catapult.passes.pooling_templates module
- hls4ml.backends.catapult.passes.quantization_templates module
- hls4ml.backends.catapult.passes.recurrent_templates module
- hls4ml.backends.catapult.passes.reshaping_templates module
- hls4ml.backends.catapult.passes.resource_strategy module
- hls4ml.backends.catapult.passes.transform_types module
- Module contents
- hls4ml.backends.catapult.passes package
- Submodules
- hls4ml.backends.catapult.catapult_backend module
CatapultBackend
CatapultBackend.build()
CatapultBackend.create_initial_config()
CatapultBackend.get_default_flow()
CatapultBackend.get_writer_flow()
CatapultBackend.init_base_layer()
CatapultBackend.init_conv1d()
CatapultBackend.init_conv2d()
CatapultBackend.init_dense()
CatapultBackend.init_depconv2d()
CatapultBackend.init_embed()
CatapultBackend.init_garnet()
CatapultBackend.init_garnet_stack()
CatapultBackend.init_global_pooling1d()
CatapultBackend.init_global_pooling2d()
CatapultBackend.init_gru()
CatapultBackend.init_lstm()
CatapultBackend.init_pooling1d()
CatapultBackend.init_pooling2d()
CatapultBackend.init_sepconv1d()
CatapultBackend.init_sepconv2d()
CatapultBackend.init_softmax()
- hls4ml.backends.catapult.catapult_types module
CatapultArrayVariableConverter
CatapultArrayVariableDefinition
CatapultInplaceArrayVariableConverter
CatapultInplaceArrayVariableDefinition
CatapultInplaceStreamVariableConverter
CatapultInplaceStreamVariableDefinition
CatapultStreamVariableConverter
CatapultStreamVariableDefinition
CatapultStructMemberVariableConverter
CatapultStructMemberVariableDefinition
- Module contents
- Subpackages
- hls4ml.backends.fpga package
- Subpackages
- hls4ml.backends.fpga.passes package
- Submodules
- hls4ml.backends.fpga.passes.bram_weights module
- hls4ml.backends.fpga.passes.clone module
- hls4ml.backends.fpga.passes.embedding module
- hls4ml.backends.fpga.passes.final_reshape module
- hls4ml.backends.fpga.passes.fix_softmax_table_size module
- hls4ml.backends.fpga.passes.hgq_proxy_model module
- hls4ml.backends.fpga.passes.im2col_codegen module
- hls4ml.backends.fpga.passes.inplace_parallel_reshape module
- hls4ml.backends.fpga.passes.inplace_stream_flatten module
- hls4ml.backends.fpga.passes.remove_softmax module
- hls4ml.backends.fpga.passes.repack_stream module
- hls4ml.backends.fpga.passes.xnor_pooling module
- Module contents
- hls4ml.backends.fpga.passes package
- Submodules
- hls4ml.backends.fpga.fpga_backend module
FPGABackend
FPGABackend.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
ACFixedPrecisionDefinition
ACIntegerPrecisionDefinition
ACTypeConverter
APFixedPrecisionDefinition
APIntegerPrecisionDefinition
APTypeConverter
ArrayVariableConverter
BramWeightVariableConverter
CompressedTypeConverter
ExponentTypeConverter
FixedPrecisionConverter
HLSTypeConverter
InplaceStreamVariableConverter
NamedTypeConverter
PackedTypeConverter
PrecisionConverter
PrecisionDefinition
StaticWeightVariableConverter
StaticWeightVariableDefinition
StreamVariableConverter
StructMemberVariableConverter
TypeDefinition
TypePrecisionConverter
VariableDefinition
- Module contents
- Subpackages
- hls4ml.backends.oneapi package
- Subpackages
- hls4ml.backends.oneapi.passes package
- Submodules
- hls4ml.backends.oneapi.passes.bn_quant module
- hls4ml.backends.oneapi.passes.clone_templates module
- hls4ml.backends.oneapi.passes.convolution_templates module
- hls4ml.backends.oneapi.passes.convolution_winograd module
- hls4ml.backends.oneapi.passes.core_templates module
- hls4ml.backends.oneapi.passes.embedding_templates module
- hls4ml.backends.oneapi.passes.merge_templates module
- hls4ml.backends.oneapi.passes.pointwise module
- hls4ml.backends.oneapi.passes.pooling_templates module
- hls4ml.backends.oneapi.passes.quantization_templates module
- hls4ml.backends.oneapi.passes.recurrent_templates module
- hls4ml.backends.oneapi.passes.reshaping_templates module
- hls4ml.backends.oneapi.passes.resource_strategy module
- hls4ml.backends.oneapi.passes.transform_types module
- Module contents
- hls4ml.backends.oneapi.passes package
- Submodules
- hls4ml.backends.oneapi.oneapi_backend module
OneAPIBackend
OneAPIBackend.build()
OneAPIBackend.compile()
OneAPIBackend.create_initial_config()
OneAPIBackend.get_default_flow()
OneAPIBackend.get_writer_flow()
OneAPIBackend.init_activation()
OneAPIBackend.init_base_layer()
OneAPIBackend.init_conv1d()
OneAPIBackend.init_conv2d()
OneAPIBackend.init_dense()
OneAPIBackend.init_embed()
OneAPIBackend.init_gru()
OneAPIBackend.init_lstm()
OneAPIBackend.init_simple_rnn()
OneAPIBackend.init_softmax()
- hls4ml.backends.oneapi.oneapi_template module
- hls4ml.backends.oneapi.oneapi_types module
ACExponentPrecisionDefinition
AggregratedArrayVariableConverter
OneAPIACTypeConverter
OneAPIArrayVariableConverter
OneAPIArrayVariableDefinition
OneAPICompressedTypeConverter
OneAPIExponentTypeConverter
OneAPIHLSTypeConverter
OneAPIInplaceArrayVariableConverter
OneAPIInplaceArrayVariableDefinition
OneAPIInplaceStreamVariableConverter
OneAPIInplaceStreamVariableDefinition
OneAPIInterfaceVariableConverter
OneAPIInterfaceVariableDefinition
OneAPIPackedTypeConverter
OneAPIStaticWeightVariableConverter
OneAPIStaticWeightVariableDefinition
OneAPIStreamVariableConverter
OneAPIStreamVariableDefinition
- Module contents
- Subpackages
- hls4ml.backends.quartus package
- Subpackages
- hls4ml.backends.quartus.passes package
- Submodules
- hls4ml.backends.quartus.passes.bn_quant module
- 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
QuartusBackend
QuartusBackend.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()
- hls4ml.backends.quartus.quartus_types module
QuartusArrayVariableConverter
QuartusArrayVariableDefinition
QuartusInplaceArrayVariableConverter
QuartusInplaceArrayVariableDefinition
QuartusInplaceStreamVariableConverter
QuartusInplaceStreamVariableDefinition
QuartusStreamVariableConverter
QuartusStreamVariableDefinition
QuartusStructMemberVariableConverter
QuartusStructMemberVariableDefinition
- Module contents
- Subpackages
- hls4ml.backends.symbolic package
- hls4ml.backends.vitis package
- hls4ml.backends.vivado package
- Subpackages
- hls4ml.backends.vivado.passes package
- Submodules
- hls4ml.backends.vivado.passes.bn_quant module
- hls4ml.backends.vivado.passes.broadcast_stream 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.pipeline_style module
- hls4ml.backends.vivado.passes.pointwise module
- hls4ml.backends.vivado.passes.pointwise_codegen 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.reshaping_templates module
- hls4ml.backends.vivado.passes.resource_strategy module
- hls4ml.backends.vivado.passes.transform_types module
- hls4ml.backends.vivado.passes.unrolled_codegen module
- Module contents
- hls4ml.backends.vivado.passes package
- Submodules
- hls4ml.backends.vivado.vivado_backend module
VivadoBackend
VivadoBackend.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_depconv1d()
VivadoBackend.init_depconv2d()
VivadoBackend.init_embed()
VivadoBackend.init_garnet()
VivadoBackend.init_garnet_stack()
VivadoBackend.init_gru()
VivadoBackend.init_lstm()
VivadoBackend.init_pooling1d()
VivadoBackend.init_pooling2d()
VivadoBackend.init_sepconv1d()
VivadoBackend.init_sepconv2d()
VivadoBackend.init_softmax()
- hls4ml.backends.vivado.vivado_types module
- 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
VivadoAcceleratorConfig
VivadoAcceleratorConfig.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
Base class for function call templates: provides the ‘function_cpp’ attribute
- Parameters:
layer_class (Layer or list, tuple, or set of Layers) – The Layers that this template handles.
include_header (list, tuple, or set of str, or None) – The list of needed include files
- 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.LayerConfigTemplate(layer_class)
Bases:
Template
Base class for layer config templates: provides the ‘config_cpp’ attribute
- Parameters:
layer_class (Layer or list, tuple, or set of Layers) – The Layers that this template handles.
- class hls4ml.backends.template.Template(name, layer_class, attribute_name)
Bases:
OptimizerPass
The Template base class, should not be instantiated directly
- Parameters:
name (str) – Name of the template.
layer_class (Layer or list, tuple, or aet of Layers) – The Layers that this template handles.
attribute_name (str) – The type of attribute provided
- 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.