hls4ml.backends.vivado.passes package

Submodules

hls4ml.backends.vivado.passes.bram_weights module

class hls4ml.backends.vivado.passes.bram_weights.RegisterBramWeights

Bases: hls4ml.model.optimizer.optimizer.OptimizerPass

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.

hls4ml.backends.vivado.passes.conv_same_pad module

class hls4ml.backends.vivado.passes.conv_same_pad.InsertZeroPaddingBeforeConv1D

Bases: hls4ml.model.optimizer.optimizer.OptimizerPass

match(node)

Predicate to match on a given node.

Parameters

node (Layer) – Node in the model graph to try matching the optimizer on.

name = 'insert_zero_padding_before_conv1d'
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.vivado.passes.conv_same_pad.InsertZeroPaddingBeforeConv2D

Bases: hls4ml.model.optimizer.optimizer.OptimizerPass

match(node)

Predicate to match on a given node.

Parameters

node (Layer) – Node in the model graph to try matching the optimizer on.

name = 'insert_zero_padding_before_conv2d'
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.

hls4ml.backends.vivado.passes.conv_stream module

class hls4ml.backends.vivado.passes.conv_stream.GenerateConvStreamingInstructions

Bases: hls4ml.model.optimizer.optimizer.OptimizerPass

Generates the instructions for streaming implementation of CNNs

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.

hls4ml.backends.vivado.passes.convolution_templates module

class hls4ml.backends.vivado.passes.convolution_templates.Conv1DConfigTemplate

Bases: hls4ml.backends.template.LayerConfigTemplate

format(node)
class hls4ml.backends.vivado.passes.convolution_templates.Conv1DFunctionTemplate

Bases: hls4ml.backends.template.FunctionCallTemplate

format(node)
class hls4ml.backends.vivado.passes.convolution_templates.Conv2DConfigTemplate

Bases: hls4ml.backends.template.LayerConfigTemplate

format(node)
class hls4ml.backends.vivado.passes.convolution_templates.Conv2DFunctionTemplate

Bases: hls4ml.backends.template.FunctionCallTemplate

format(node)
class hls4ml.backends.vivado.passes.convolution_templates.DepthwiseConv2DFunctionTemplate

Bases: hls4ml.backends.vivado.passes.convolution_templates.Conv2DFunctionTemplate

class hls4ml.backends.vivado.passes.convolution_templates.SeparableConv1DConfigTemplate

Bases: hls4ml.backends.template.LayerConfigTemplate

format(node)
class hls4ml.backends.vivado.passes.convolution_templates.SeparableConv1DFunctionTemplate

Bases: hls4ml.backends.template.FunctionCallTemplate

format(node)
class hls4ml.backends.vivado.passes.convolution_templates.SeparableConv2DConfigTemplate

Bases: hls4ml.backends.template.LayerConfigTemplate

format(node)
class hls4ml.backends.vivado.passes.convolution_templates.SeparableConv2DFunctionTemplate

Bases: hls4ml.backends.template.FunctionCallTemplate

format(node)

hls4ml.backends.vivado.passes.core_templates module

class hls4ml.backends.vivado.passes.core_templates.ActivationConfigTemplate

Bases: hls4ml.backends.template.LayerConfigTemplate

format(node)
class hls4ml.backends.vivado.passes.core_templates.ActivationFunctionTemplate

Bases: hls4ml.backends.template.FunctionCallTemplate

format(node)
class hls4ml.backends.vivado.passes.core_templates.BatchNormalizationConfigTemplate

Bases: hls4ml.backends.template.LayerConfigTemplate

format(node)
class hls4ml.backends.vivado.passes.core_templates.BatchNormalizationFunctionTemplate

Bases: hls4ml.backends.template.FunctionCallTemplate

format(node)
class hls4ml.backends.vivado.passes.core_templates.DenseConfigTemplate

Bases: hls4ml.backends.template.LayerConfigTemplate

format(node)
class hls4ml.backends.vivado.passes.core_templates.DenseFunctionTemplate

Bases: hls4ml.backends.template.FunctionCallTemplate

format(node)
class hls4ml.backends.vivado.passes.core_templates.PReLUFunctionTemplate

Bases: hls4ml.backends.template.FunctionCallTemplate

format(node)
class hls4ml.backends.vivado.passes.core_templates.ParametrizedActivationFunctionTemplate

Bases: hls4ml.backends.template.FunctionCallTemplate

format(node)
class hls4ml.backends.vivado.passes.core_templates.SoftmaxConfigTemplate

Bases: hls4ml.backends.vivado.passes.core_templates.ActivationConfigTemplate

hls4ml.backends.vivado.passes.fifo_depth_optimization module

hls4ml.backends.vivado.passes.garnet_templates module

class hls4ml.backends.vivado.passes.garnet_templates.GarNetConfigTemplate

Bases: hls4ml.backends.template.LayerConfigTemplate

format(node)
get_transforms_config(node, params)
class hls4ml.backends.vivado.passes.garnet_templates.GarNetFunctionTemplate

Bases: hls4ml.backends.template.FunctionCallTemplate

format(node)
class hls4ml.backends.vivado.passes.garnet_templates.GarNetStackConfigTemplate

Bases: hls4ml.backends.vivado.passes.garnet_templates.GarNetConfigTemplate

get_transforms_config(node, params)
class hls4ml.backends.vivado.passes.garnet_templates.GarNetStackFunctionTemplate

Bases: hls4ml.backends.vivado.passes.garnet_templates.GarNetFunctionTemplate

hls4ml.backends.vivado.passes.merge_templates module

class hls4ml.backends.vivado.passes.merge_templates.ConcatenateConfigTemplate

Bases: hls4ml.backends.template.LayerConfigTemplate

format(node)
class hls4ml.backends.vivado.passes.merge_templates.DotConfigTemplate

Bases: hls4ml.backends.template.LayerConfigTemplate

format(node)
class hls4ml.backends.vivado.passes.merge_templates.MergeConfigTemplate

Bases: hls4ml.backends.template.LayerConfigTemplate

format(node)
class hls4ml.backends.vivado.passes.merge_templates.MergeFunctionTemplate

Bases: hls4ml.backends.template.FunctionCallTemplate

format(node)

hls4ml.backends.vivado.passes.pointwise module

class hls4ml.backends.vivado.passes.pointwise.OptimizePointwiseConv

Bases: hls4ml.model.optimizer.optimizer.OptimizerPass

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.

class hls4ml.backends.vivado.passes.pointwise.PointwiseConv1DConfigTemplate

Bases: hls4ml.backends.vivado.passes.convolution_templates.Conv1DConfigTemplate

class hls4ml.backends.vivado.passes.pointwise.PointwiseConv1DFunctionTemplate

Bases: hls4ml.backends.vivado.passes.convolution_templates.Conv1DFunctionTemplate

class hls4ml.backends.vivado.passes.pointwise.PointwiseConv2DConfigTemplate

Bases: hls4ml.backends.vivado.passes.convolution_templates.Conv2DConfigTemplate

class hls4ml.backends.vivado.passes.pointwise.PointwiseConv2DFunctionTemplate

Bases: hls4ml.backends.vivado.passes.convolution_templates.Conv2DFunctionTemplate

hls4ml.backends.vivado.passes.pointwise.register_pointwise(backend)

hls4ml.backends.vivado.passes.pooling_templates module

class hls4ml.backends.vivado.passes.pooling_templates.PoolingConfigTemplate

Bases: hls4ml.backends.template.LayerConfigTemplate

format(node)
class hls4ml.backends.vivado.passes.pooling_templates.PoolingFunctionTemplate

Bases: hls4ml.backends.template.FunctionCallTemplate

format(node)

hls4ml.backends.vivado.passes.quantization_templates module

hls4ml.backends.vivado.passes.recurrent_templates module

class hls4ml.backends.vivado.passes.recurrent_templates.RecurrentConfigTemplate

Bases: hls4ml.backends.template.LayerConfigTemplate

format(node)
class hls4ml.backends.vivado.passes.recurrent_templates.RecurrentFunctionTemplate

Bases: hls4ml.backends.template.FunctionCallTemplate

format(node)

hls4ml.backends.vivado.passes.repack_stream module

class hls4ml.backends.vivado.passes.repack_stream.Broadcast(model, name, attributes, inputs, outputs=None)

Bases: hls4ml.model.layers.Layer

Inserted between layers for broadcasting.

initialize()
class hls4ml.backends.vivado.passes.repack_stream.BroadcastConfigTemplate

Bases: hls4ml.backends.template.LayerConfigTemplate

format(node)
class hls4ml.backends.vivado.passes.repack_stream.BroadcastFunctionTemplate

Bases: hls4ml.backends.template.FunctionCallTemplate

format(node)
class hls4ml.backends.vivado.passes.repack_stream.BroadcastStream

Bases: hls4ml.model.optimizer.optimizer.OptimizerPass

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.

class hls4ml.backends.vivado.passes.repack_stream.Repack(model, name, attributes, inputs, outputs=None)

Bases: hls4ml.model.layers.Layer

Inserted between layers with different packing factors.

initialize()
class hls4ml.backends.vivado.passes.repack_stream.RepackFunctionTemplate

Bases: hls4ml.backends.template.FunctionCallTemplate

format(node)
class hls4ml.backends.vivado.passes.repack_stream.ReshapeStream

Bases: hls4ml.model.optimizer.optimizer.OptimizerPass

Repacks stream for Reshape layer

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.

hls4ml.backends.vivado.passes.repack_stream.register_repack_stream(backend)

hls4ml.backends.vivado.passes.reshaping_templates module

class hls4ml.backends.vivado.passes.reshaping_templates.ResizeConfigTemplate

Bases: hls4ml.backends.template.LayerConfigTemplate

format(node)
class hls4ml.backends.vivado.passes.reshaping_templates.ResizeFunctionTemplate

Bases: hls4ml.backends.template.FunctionCallTemplate

format(node)
class hls4ml.backends.vivado.passes.reshaping_templates.TransposeConfigTemplate

Bases: hls4ml.backends.template.LayerConfigTemplate

format(node)
class hls4ml.backends.vivado.passes.reshaping_templates.TransposeFunctionTemplate

Bases: hls4ml.backends.template.FunctionCallTemplate

format(node)
class hls4ml.backends.vivado.passes.reshaping_templates.ZeroPaddingConfigTemplate

Bases: hls4ml.backends.template.LayerConfigTemplate

format(node)
class hls4ml.backends.vivado.passes.reshaping_templates.ZeroPaddingFunctionTemplate

Bases: hls4ml.backends.template.FunctionCallTemplate

format(node)

hls4ml.backends.vivado.passes.resource_strategy module

class hls4ml.backends.vivado.passes.resource_strategy.ApplyResourceStrategy

Bases: hls4ml.model.optimizer.optimizer.OptimizerPass

Transposes the weights to use the dense_resource matrix multiply routine

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.

hls4ml.backends.vivado.passes.transform_types module

class hls4ml.backends.vivado.passes.transform_types.TransformTypes

Bases: hls4ml.model.optimizer.optimizer.GlobalOptimizerPass

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.

Module contents