hls4ml.backends.fpga.passes package

Submodules

hls4ml.backends.fpga.passes.bn_quant module

class hls4ml.backends.fpga.passes.bn_quant.BatchNormalizationQuantizedTanhConfigTemplate

Bases: hls4ml.backends.template.LayerConfigTemplate

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

Bases: hls4ml.backends.template.FunctionCallTemplate

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

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.fpga.passes.bn_quant.QuantizeDenseOutput

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.fpga.passes.bn_quant.register_bn_quant(backend)

hls4ml.backends.fpga.passes.clone module

class hls4ml.backends.fpga.passes.clone.Clone(model, name, attributes, inputs, outputs=None)

Bases: hls4ml.model.layers.Layer

Inserted after the layer whose output is used more than once.

initialize()
class hls4ml.backends.fpga.passes.clone.CloneFunctionTemplate

Bases: hls4ml.backends.template.FunctionCallTemplate

format(node)
class hls4ml.backends.fpga.passes.clone.CloneOutput

Bases: hls4ml.model.optimizer.optimizer.OptimizerPass

Clones streams that are used multiple times

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.fpga.passes.clone.register_clone(backend)

hls4ml.backends.fpga.passes.codegen module

class hls4ml.backends.fpga.passes.codegen.GenerateConvIm2col

Bases: hls4ml.model.optimizer.optimizer.OptimizerPass

Generates tcode for im2col step of 1D/2d convolution

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.fpga.passes.embedding module

class hls4ml.backends.fpga.passes.embedding.EmbeddingConfigTemplate

Bases: hls4ml.backends.template.LayerConfigTemplate

format(node)
class hls4ml.backends.fpga.passes.embedding.EmbeddingFunctionTemplate

Bases: hls4ml.backends.template.FunctionCallTemplate

format(node)

hls4ml.backends.fpga.passes.final_reshape module

class hls4ml.backends.fpga.passes.final_reshape.RemoveFinalReshape

Bases: hls4ml.model.optimizer.optimizer.OptimizerPass

Remove reshape if final 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.

Module contents