hls4ml.backends.catapult.passes package

Submodules

hls4ml.backends.catapult.passes.bn_quant module

class hls4ml.backends.catapult.passes.bn_quant.BatchNormalizationQuantizedTanhConfigTemplate

Bases: LayerConfigTemplate

format(node)
class hls4ml.backends.catapult.passes.bn_quant.BatchNormalizationQuantizedTanhFunctionTemplate

Bases: FunctionCallTemplate

format(node)
class hls4ml.backends.catapult.passes.bn_quant.MergeBatchNormAndQuantizedTanh

Bases: 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.catapult.passes.bn_quant.QuantizeDenseOutput

Bases: 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.catapult.passes.bn_quant.register_bn_quant(backend)

hls4ml.backends.catapult.passes.broadcast_stream module

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

Bases: Layer

Inserted between layers for broadcasting.

initialize()
class hls4ml.backends.catapult.passes.broadcast_stream.BroadcastConfigTemplate

Bases: LayerConfigTemplate

format(node)
class hls4ml.backends.catapult.passes.broadcast_stream.BroadcastFunctionTemplate

Bases: FunctionCallTemplate

format(node)
class hls4ml.backends.catapult.passes.broadcast_stream.BroadcastStream

Bases: 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.catapult.passes.broadcast_stream.register_broadcast_stream(backend)

hls4ml.backends.catapult.passes.conv_same_pad module

class hls4ml.backends.catapult.passes.conv_same_pad.InsertZeroPaddingBeforeConv1D

Bases: 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.catapult.passes.conv_same_pad.InsertZeroPaddingBeforeConv2D

Bases: 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.catapult.passes.conv_stream module

class hls4ml.backends.catapult.passes.conv_stream.GenerateConvStreamingInstructions

Bases: 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.catapult.passes.convolution_templates module

class hls4ml.backends.catapult.passes.convolution_templates.Conv1DConfigTemplate

Bases: LayerConfigTemplate

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

Bases: FunctionCallTemplate

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

Bases: LayerConfigTemplate

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

Bases: FunctionCallTemplate

format(node)
class hls4ml.backends.catapult.passes.convolution_templates.DepthwiseConv1DFunctionTemplate

Bases: Conv1DFunctionTemplate

class hls4ml.backends.catapult.passes.convolution_templates.DepthwiseConv2DFunctionTemplate

Bases: Conv2DFunctionTemplate

class hls4ml.backends.catapult.passes.convolution_templates.SeparableConv1DConfigTemplate

Bases: LayerConfigTemplate

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

Bases: FunctionCallTemplate

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

Bases: LayerConfigTemplate

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

Bases: FunctionCallTemplate

format(node)

hls4ml.backends.catapult.passes.convolution_winograd module

class hls4ml.backends.catapult.passes.convolution_winograd.ApplyWinogradKernelTransformation

Bases: OptimizerPass

Transforms the weights of a Conv2D kernel to a format suitable for Wingorad convolution For further information, refer to Lavin & Gray, 2015 - Fast Algorithms for Convolutional Neural Networks

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.catapult.passes.core_templates module

class hls4ml.backends.catapult.passes.core_templates.ActivationConfigTemplate

Bases: LayerConfigTemplate

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

Bases: FunctionCallTemplate

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

Bases: LayerConfigTemplate

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

Bases: FunctionCallTemplate

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

Bases: LayerConfigTemplate

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

Bases: FunctionCallTemplate

format(node)
class hls4ml.backends.catapult.passes.core_templates.HardActivationConfigTemplate

Bases: LayerConfigTemplate

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

Bases: FunctionCallTemplate

format(node)
class hls4ml.backends.catapult.passes.core_templates.ParamActivationConfigTemplate

Bases: LayerConfigTemplate

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

Bases: FunctionCallTemplate

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

Bases: ActivationConfigTemplate

hls4ml.backends.catapult.passes.fifo_depth_optimization module

class hls4ml.backends.catapult.passes.fifo_depth_optimization.FifoDepthOptimization

Bases: ConfigurableOptimizerPass, ModelOptimizerPass

transform(model)

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.catapult.passes.fifo_depth_optimization.generate_max_depth_file(model, maxs)
hls4ml.backends.catapult.passes.fifo_depth_optimization.get_vcd_data(model)
hls4ml.backends.catapult.passes.fifo_depth_optimization.populate_values(values, name, data, depth)
hls4ml.backends.catapult.passes.fifo_depth_optimization.set_big_fifos(vars_to_profile, profiling_fifo_depth)
hls4ml.backends.catapult.passes.fifo_depth_optimization.set_fifo_depth(model, maxs)

hls4ml.backends.catapult.passes.garnet_templates module

class hls4ml.backends.catapult.passes.garnet_templates.GarNetConfigTemplate

Bases: LayerConfigTemplate

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

Bases: FunctionCallTemplate

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

Bases: GarNetConfigTemplate

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

Bases: GarNetFunctionTemplate

hls4ml.backends.catapult.passes.merge_templates module

class hls4ml.backends.catapult.passes.merge_templates.ConcatenateConfigTemplate

Bases: LayerConfigTemplate

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

Bases: LayerConfigTemplate

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

Bases: LayerConfigTemplate

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

Bases: FunctionCallTemplate

format(node)

hls4ml.backends.catapult.passes.pointwise module

class hls4ml.backends.catapult.passes.pointwise.OptimizePointwiseConv

Bases: 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.catapult.passes.pointwise.PointwiseConv1DConfigTemplate

Bases: Conv1DConfigTemplate

class hls4ml.backends.catapult.passes.pointwise.PointwiseConv1DFunctionTemplate

Bases: Conv1DFunctionTemplate

class hls4ml.backends.catapult.passes.pointwise.PointwiseConv2DConfigTemplate

Bases: Conv2DConfigTemplate

class hls4ml.backends.catapult.passes.pointwise.PointwiseConv2DFunctionTemplate

Bases: Conv2DFunctionTemplate

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

hls4ml.backends.catapult.passes.pooling_templates module

class hls4ml.backends.catapult.passes.pooling_templates.PoolingConfigTemplate

Bases: LayerConfigTemplate

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

Bases: FunctionCallTemplate

format(node)

hls4ml.backends.catapult.passes.quantization_templates module

class hls4ml.backends.catapult.passes.quantization_templates.ApplyAlphaConfigTemplate

Bases: LayerConfigTemplate

format(node)
class hls4ml.backends.catapult.passes.quantization_templates.ApplyAlphaFunctionTemplate

Bases: FunctionCallTemplate

format(node)

hls4ml.backends.catapult.passes.recurrent_templates module

class hls4ml.backends.catapult.passes.recurrent_templates.RecurrentConfigTemplate

Bases: LayerConfigTemplate

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

Bases: FunctionCallTemplate

format(node)

hls4ml.backends.catapult.passes.reshaping_templates module

class hls4ml.backends.catapult.passes.reshaping_templates.ResizeConfigTemplate

Bases: LayerConfigTemplate

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

Bases: FunctionCallTemplate

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

Bases: LayerConfigTemplate

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

Bases: FunctionCallTemplate

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

Bases: LayerConfigTemplate

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

Bases: FunctionCallTemplate

format(node)

hls4ml.backends.catapult.passes.resource_strategy module

class hls4ml.backends.catapult.passes.resource_strategy.ApplyResourceStrategy

Bases: 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.catapult.passes.transform_types module

class hls4ml.backends.catapult.passes.transform_types.TransformTypes

Bases: 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