chop.passes.graph#

Summary of MaseGraph Analysis Passes#

MaseGraph graph analysis passes#

Pass Name

Usage Example

Summary

init_metadata_analysis_pass()

test_add_common_metadata

Initialize each node with the MaseMetadata, this needs to run first before adding any metadata

add_common_metadata_analysis_pass()

test_add_common_metadata

Add metadata used for both software and hardware, this needs to run first before calling to add_software_metadata or add_hardware_metadata

add_software_metadata_analysis_pass()

test_add_software_metadata

Add hardware-specific metadata, such as which hardware IPs to map and hardware parameters. Details see the pass page

add_hardware_metadata_analysis_pass()

test_add_hardware_metadata

Add software-specific metadata, such as sparsity. Details see the pass page

report_graph_analysis_pass()

test_report_graph

Generates a report for the graph analysis and prints out an over the model in a table.

report_node_hardware_type_analysis_pass()

test_report_node_hardware_type

Generate a report on the hardware type of the nodes in the graph.

report_node_meta_param_analysis_pass()

test_report_node_meta_param

Generate a report on the meta parameters of the nodes in the graph.

report_node_shape_analysis_pass()

test_report_node_shape

Generate a report on the shape of the nodes in the graph.

report_node_type_analysis_pass()

test_report_node_type

Generate a report on the type of the nodes in the graph.

profile_statistics_analysis_pass()

test_profile_statistics

Perform profile statistics analysis on the given graph

calculate_avg_bits_mg_analysis_pass()

calculate_avg_bits_mg_analysis_pass

Calculate, on average, how many bits are spent on weights and activations

add_natural_sparsity_metadata_analysis_pass()

test_calculate_natural_sparsity

Add natural sparsity metadata analysis pass to the given MaseGraph.

add_pruning_metadata_analysis_pass()

test_prune

This pass computes weight and activation sparsity based on pruning masks

hook_inspection_analysis_pass()

test_hook_inspection_analysis_pass

Provide hook information of the modules

runtime_analysis_pass()

fill me

Perform runtime analysis on the given graph (MaseGraph, TensorRT, ONNX models)

verify_metadata_analysis_pass()

fill me

fill me

verify_common_metadata_analysis_pass()

fill me

fill me

verify_software_metadata_analysis_pass()

fill me

fill me

verify_hardware_metadata_analysis_pass()

fill me

fill me

Summary of MaseGraph Transform Passes#

MaseGraph graph transform passes#

Pass Name

Usage Example

Summary

prune_transform_pass()

test_prune

Prune the given graph

prune_detach_hook_transform_pass()

test_prune_detach_hook

Remove all pruning hooks

quantize_transform_pass()

test_quantize

Apply quantization, check the further documentation below

summarize_quantization_analysis_pass()

test_quantize

Summarizes the quantization with respect to the original graph

conv_bn_fusion_transform_pass()

test_conv_bn_fusion

Perform Conv-BN fusion on the given graph

logicnets_fusion_transform_pass()

test_logicnets_fusion (DEV, Disabled)

Perform LogicNets fusion on the given graph (DEV, Disabled)

onnx_annotate_transform_pass()

NA (DEV, Disabled)

Convert MaseGraph to ONNX and annotate the relevant layers with sparsity information (DEV, Disabled)

emit_verilog_top_transform_pass()

test_emit_verilog_linear

Emit the top-level model design in Verilog.

emit_verilog_tb_transform_pass()

Emit test bench and related files for simulation.

test_emit_verilog_linear

emit_bram_transform_pass()

Enumerate input parameters of the node and emit a ROM block with handshake interface for each parameter

test_emit_verilog_linear

emit_mlir_hls_transform_pass()

Emit the hardware components that generated from MLIR-HLS tools.

test_emit_verilog_linear

emit_internal_rtl_transform_pass()

Emit the hardware components that pre-defined in the mase internal library.

test_emit_verilog_linear

tensorrt_fake_quantize_transform_pass()

Apply TensorRT fake quantization to the given graph for INT8 quantization calibration

fille me

tensorrt_calibrate_transform_pass()

Apply TensorRT calibration to the given graph for INT8 quantization

fille me

tensorrt_fine_tune_transform_pass()

Apply TensorRT fine tune to the given graph for quantization aware training

fille me

Summary of MaseGraph Interface Passes#

A summary of all MaseGraph interface passes#

Pass Name

Usage Example

Summary

load_mase_graph_interface_pass()

fill me

fill me

save_mase_graph_interface_pass()

fill me

fill me

save_node_meta_param_interface_pass()

fill me

fill me

load_node_meta_param_interface_pass()

fill me

fill me

tensorrt_engine_interface_pass()

Converts the given graph to a TensorRT engine model

fill me

onnx_runtime_interface_pass()

Converts the given graph to a ONNXRuntime model

fill me