From d55133848559e74d8421f64a5b73fcff06e46f3c Mon Sep 17 00:00:00 2001 From: Jianyi Cheng Date: Mon, 15 Jul 2024 10:36:08 +0000 Subject: [PATCH 1/5] Added init latency printing so we can observe and reduce test cases --- justfile | 188 +++++++++++++++++++++++++++---------------------------- 1 file changed, 94 insertions(+), 94 deletions(-) diff --git a/justfile b/justfile index b03f91cc3..3ab379389 100644 --- a/justfile +++ b/justfile @@ -14,130 +14,130 @@ test-sw: test-hw: # Activation_layers - # python3 scripts/build-components.py - python3 src/mase_components/activation_layers/test/fixed_gelu_tb.py - python3 src/mase_components/activation_layers/test/fixed_leaky_relu_tb.py - python3 src/mase_components/activation_layers/test/fixed_relu_tb.py - python3 src/mase_components/activation_layers/test/fixed_selu_tb.py - # python3 src/mase_components/activation_layers/test/fixed_sigmoid_tb.py - # python3 src/mase_components/activation_layers/test/fixed_softermax_1d_tb.py - # python3 src/mase_components/activation_layers/test/fixed_softermax_tb.py - # python3 src/mase_components/activation_layers/test/fixed_softmax_tb.py - python3 src/mase_components/activation_layers/test/fixed_softplus_tb.py - python3 src/mase_components/activation_layers/test/fixed_softsign_tb.py - python3 src/mase_components/activation_layers/test/fixed_tanh_tb.py - # python3 src/mase_components/activation_layers/test/softermax_global_norm_tb.py - # python3 src/mase_components/activation_layers/test/softermax_local_window_tb.py - # python3 src/mase_components/activation_layers/test/softermax_lpw_pow2_tb.py - # python3 src/mase_components/activation_layers/test/softermax_lpw_reciprocal_tb.py - # python3 src/mase_components/activation_layers/test/test_lint_activation_layers.py - # python3 src/mase_components/activation_layers/test/test_synth_activation_layers.py + # time python3 scripts/build-components.py + time python3 src/mase_components/activation_layers/test/fixed_gelu_tb.py + time python3 src/mase_components/activation_layers/test/fixed_leaky_relu_tb.py + time python3 src/mase_components/activation_layers/test/fixed_relu_tb.py + time python3 src/mase_components/activation_layers/test/fixed_selu_tb.py + # time python3 src/mase_components/activation_layers/test/fixed_sigmoid_tb.py + # time python3 src/mase_components/activation_layers/test/fixed_softermax_1d_tb.py + # time python3 src/mase_components/activation_layers/test/fixed_softermax_tb.py + # time python3 src/mase_components/activation_layers/test/fixed_softmax_tb.py + time python3 src/mase_components/activation_layers/test/fixed_softplus_tb.py + time python3 src/mase_components/activation_layers/test/fixed_softsign_tb.py + time python3 src/mase_components/activation_layers/test/fixed_tanh_tb.py + # time python3 src/mase_components/activation_layers/test/softermax_global_norm_tb.py + # time python3 src/mase_components/activation_layers/test/softermax_local_window_tb.py + # time python3 src/mase_components/activation_layers/test/softermax_lpw_pow2_tb.py + # time python3 src/mase_components/activation_layers/test/softermax_lpw_reciprocal_tb.py + # time python3 src/mase_components/activation_layers/test/test_lint_activation_layers.py + # time python3 src/mase_components/activation_layers/test/test_synth_activation_layers.py # DEV mode (no intention to fix) - # python3 src/mase_components/activation_layers/test/fixed_elu_tb.py - # python3 src/mase_components/activation_layers/test/fixed_hardshrink_tb.py - # python3 src/mase_components/activation_layers/test/fixed_hardswish_tb.py - # python3 src/mase_components/activation_layers/test/fixed_logsigmoid_tb.py - # python3 src/mase_components/activation_layers/test/fixed_silu_tb.py - # python3 src/mase_components/activation_layers/test/fixed_softshrink_tb.py + # time python3 src/mase_components/activation_layers/test/fixed_elu_tb.py + # time python3 src/mase_components/activation_layers/test/fixed_hardshrink_tb.py + # time python3 src/mase_components/activation_layers/test/fixed_hardswish_tb.py + # time python3 src/mase_components/activation_layers/test/fixed_logsigmoid_tb.py + # time python3 src/mase_components/activation_layers/test/fixed_silu_tb.py + # time python3 src/mase_components/activation_layers/test/fixed_softshrink_tb.py # Cast - python3 src/mase_components/cast/test/fixed_cast_tb.py - python3 src/mase_components/cast/test/fixed_rounding_tb.py - python3 src/mase_components/cast/test/fixed_signed_cast_tb.py - # python3 src/mase_components/cast/test/fixed_unsigned_cast_tb.py + time python3 src/mase_components/cast/test/fixed_cast_tb.py + time python3 src/mase_components/cast/test/fixed_rounding_tb.py + time python3 src/mase_components/cast/test/fixed_signed_cast_tb.py + # time python3 src/mase_components/cast/test/fixed_unsigned_cast_tb.py # Common - python3 src/mase_components/common/test/comparator_accumulator_tb.py - python3 src/mase_components/common/test/cut_data_tb.py - python3 src/mase_components/common/test/lut_tb.py - python3 src/mase_components/common/test/wrap_data_tb.py - # python3 src/mase_components/common/test/register_slice_tb.py - # python3 src/mase_components/common/test/test_lint_common.py + time python3 src/mase_components/common/test/comparator_accumulator_tb.py + time python3 src/mase_components/common/test/cut_data_tb.py + time python3 src/mase_components/common/test/lut_tb.py + time python3 src/mase_components/common/test/wrap_data_tb.py + # time python3 src/mase_components/common/test/register_slice_tb.py + # time python3 src/mase_components/common/test/test_lint_common.py # DEV - # python3 src/mase_components/common/test/comparator_tree_tb.py - # python3 src/mase_components/common/test/single_element_repeat_tb.py + # time python3 src/mase_components/common/test/comparator_tree_tb.py + # time python3 src/mase_components/common/test/single_element_repeat_tb.py # Convolution_layers - python3 src/mase_components/convolution_layers/test/convolution_tb.py + time python3 src/mase_components/convolution_layers/test/convolution_tb.py # Inteface - python3 src/mase_components/interface/axi/test/test_lint_axi.py - # python3 src/mase_components/interface/axi/test/test_synth_axi.py + time python3 src/mase_components/interface/axi/test/test_lint_axi.py + # time python3 src/mase_components/interface/axi/test/test_synth_axi.py # Language models llmint8 - python3 src/mase_components/language_models/llmint8/test/find_max_tb.py - python3 src/mase_components/language_models/llmint8/test/fixed_comparator_tree_layer_tb.py - python3 src/mase_components/language_models/llmint8/test/fixed_comparator_tree_tb.py - python3 src/mase_components/language_models/llmint8/test/quantized_matmul_tb.py - python3 src/mase_components/language_models/llmint8/test/quantizer_top_tb.py - python3 src/mase_components/language_models/llmint8/test/scatter_tb.py + time python3 src/mase_components/language_models/llmint8/test/find_max_tb.py + time python3 src/mase_components/language_models/llmint8/test/fixed_comparator_tree_layer_tb.py + time python3 src/mase_components/language_models/llmint8/test/fixed_comparator_tree_tb.py + time python3 src/mase_components/language_models/llmint8/test/quantized_matmul_tb.py + time python3 src/mase_components/language_models/llmint8/test/quantizer_top_tb.py + time python3 src/mase_components/language_models/llmint8/test/scatter_tb.py # DEV - # python3 src/mase_components/language_models/llmint8/test/llm_int8_top_tb.py + # time python3 src/mase_components/language_models/llmint8/test/llm_int8_top_tb.py # Linear layers # Linear Layer - fixed_linear_layer DEBUG: use bias causes crash - python3 src/mase_components/linear_layers/fixed_linear_layer/test/fixed_linear_tb.py - # python3 src/mase_components/linear_layers/fixed_linear_layer/test/binary_activation_binary_linear_tb.py - # python3 src/mase_components/linear_layers/fixed_linear_layer/test/fixed_activation_binary_linear_tb.py + time python3 src/mase_components/linear_layers/fixed_linear_layer/test/fixed_linear_tb.py + # time python3 src/mase_components/linear_layers/fixed_linear_layer/test/binary_activation_binary_linear_tb.py + # time python3 src/mase_components/linear_layers/fixed_linear_layer/test/fixed_activation_binary_linear_tb.py # Linear Layer - fixed_operators - python3 src/mase_components/linear_layers/fixed_operators/test/fixed_accumulator_tb.py - # python3 src/mase_components/linear_layers/fixed_operators/test/fixed_adder_tree_layer_tb.py - python3 src/mase_components/linear_layers/fixed_operators/test/fixed_adder_tree_tb.py - python3 src/mase_components/linear_layers/fixed_operators/test/fixed_dot_product_tb.py - python3 src/mase_components/linear_layers/fixed_operators/test/fixed_lut_index_tb.py - # python3 src/mase_components/linear_layers/fixed_operators/test/fixed_matmul_core_tb.py - python3 src/mase_components/linear_layers/fixed_operators/test/fixed_mult_tb.py - python3 src/mase_components/linear_layers/fixed_operators/test/fixed_range_augmentation_tb.py - # python3 src/mase_components/linear_layers/fixed_operators/test/fixed_range_reduction_tb.py + time python3 src/mase_components/linear_layers/fixed_operators/test/fixed_accumulator_tb.py + # time python3 src/mase_components/linear_layers/fixed_operators/test/fixed_adder_tree_layer_tb.py + time python3 src/mase_components/linear_layers/fixed_operators/test/fixed_adder_tree_tb.py + time python3 src/mase_components/linear_layers/fixed_operators/test/fixed_dot_product_tb.py + time python3 src/mase_components/linear_layers/fixed_operators/test/fixed_lut_index_tb.py + # time python3 src/mase_components/linear_layers/fixed_operators/test/fixed_matmul_core_tb.py + time python3 src/mase_components/linear_layers/fixed_operators/test/fixed_mult_tb.py + time python3 src/mase_components/linear_layers/fixed_operators/test/fixed_range_augmentation_tb.py + # time python3 src/mase_components/linear_layers/fixed_operators/test/fixed_range_reduction_tb.py # Linear Layer - matmul - # python3 src/mase_components/linear_layers/matmul/test/chain_matmul_tb.py - # python3 src/mase_components/linear_layers/matmul/test/fixed_mamul_tb.py - # python3 src/mase_components/linear_layers/matmul/test/matmul_tb.py - # python3 src/mase_components/linear_layers/matmul/test/matrix_stream_transpose_tb.py - # python3 src/mase_components/linear_layers/matmul/test/transpose_tb.py + # time python3 src/mase_components/linear_layers/matmul/test/chain_matmul_tb.py + # time python3 src/mase_components/linear_layers/matmul/test/fixed_mamul_tb.py + # time python3 src/mase_components/linear_layers/matmul/test/matmul_tb.py + # time python3 src/mase_components/linear_layers/matmul/test/matrix_stream_transpose_tb.py + # time python3 src/mase_components/linear_layers/matmul/test/transpose_tb.py # DEV Linear Layer - binary_operators - python3 src/mase_components/linear_layers/binarized_operators/test/binary_activation_binary_adder_tree_layer_tb.py - # python3 src/mase_components/linear_layers/binarized_operators/test/binary_activation_binary_adder_tree_tb.py - # python3 src/mase_components/linear_layers/binarized_operators/test/binary_activation_binary_dot_product_tb.py - # python3 src/mase_components/linear_layers/binarized_operators/test/binary_activation_binary_matmul_core_tb.py - # python3 src/mase_components/linear_layers/binarized_operators/test/binary_activation_binary_mult_tb.py - # python3 src/mase_components/linear_layers/binarized_operators/test/binary_activation_binary_vector_mult_tb.py - # python3 src/mase_components/linear_layers/binarized_operators/test/fixed_activation_binary_dot_product_tb.py - # python3 src/mase_components/linear_layers/binarized_operators/test/fixed_activation_binary_mult_tb.py - # python3 src/mase_components/linear_layers/binarized_operators/test/fixed_activation_binary_vector_mult_tb.py - # python3 src/mase_components/linear_layers/binarized_operators/test/test_lint_binary_arith.py + time python3 src/mase_components/linear_layers/binarized_operators/test/binary_activation_binary_adder_tree_layer_tb.py + # time python3 src/mase_components/linear_layers/binarized_operators/test/binary_activation_binary_adder_tree_tb.py + # time python3 src/mase_components/linear_layers/binarized_operators/test/binary_activation_binary_dot_product_tb.py + # time python3 src/mase_components/linear_layers/binarized_operators/test/binary_activation_binary_matmul_core_tb.py + # time python3 src/mase_components/linear_layers/binarized_operators/test/binary_activation_binary_mult_tb.py + # time python3 src/mase_components/linear_layers/binarized_operators/test/binary_activation_binary_vector_mult_tb.py + # time python3 src/mase_components/linear_layers/binarized_operators/test/fixed_activation_binary_dot_product_tb.py + # time python3 src/mase_components/linear_layers/binarized_operators/test/fixed_activation_binary_mult_tb.py + # time python3 src/mase_components/linear_layers/binarized_operators/test/fixed_activation_binary_vector_mult_tb.py + # time python3 src/mase_components/linear_layers/binarized_operators/test/test_lint_binary_arith.py # Memory - python3 src/mase_components/memory/test/fifo_tb.py - # python3 src/mase_components/memory/test/input_buffer_tb.py - python3 src/mase_components/memory/test/skid_buffer_tb.py - # python3 src/mase_components/memory/test/unpacked_fifo_tb.py - # python3 src/mase_components/memory/test/repeat_circular_buffer_tb.py - # python3 src/mase_components/memory/test/test_lint_memory.py + time python3 src/mase_components/memory/test/fifo_tb.py + # time python3 src/mase_components/memory/test/input_buffer_tb.py + time python3 src/mase_components/memory/test/skid_buffer_tb.py + # time python3 src/mase_components/memory/test/unpacked_fifo_tb.py + # time python3 src/mase_components/memory/test/repeat_circular_buffer_tb.py + # time python3 src/mase_components/memory/test/test_lint_memory.py # Normalization_layers - python3 src/mase_components/normalization_layers/test/batch_norm_2d_tb.py - python3 src/mase_components/normalization_layers/test/group_norm_2d_tb.py + time python3 src/mase_components/normalization_layers/test/batch_norm_2d_tb.py + time python3 src/mase_components/normalization_layers/test/group_norm_2d_tb.py # DEV - # python3 src/mase_components/normalization_layers/test/channel_selection_tb.py - # python3 src/mase_components/normalization_layers/test/rms_norm_2d_tb.py - # python3 src/mase_components/normalization_layers/test/test_lint_norm.py + # time python3 src/mase_components/normalization_layers/test/channel_selection_tb.py + # time python3 src/mase_components/normalization_layers/test/rms_norm_2d_tb.py + # time python3 src/mase_components/normalization_layers/test/test_lint_norm.py # Scalar operators - python3 src/mase_components/scalar_operators/fixed/test/fixed_isqrt_tb.py - python3 src/mase_components/scalar_operators/fixed/test/isqrt_sw.py - # python3 src/mase_components/scalar_operators/float/test/test_lint_float_arithmetic.py - # python3 src/mase_components/scalar_operators/fixed/test/fixed_nr_stage_tb.py - # python3 src/mase_components/scalar_operators/fixed/test/test_lint_fixed_math.py + time python3 src/mase_components/scalar_operators/fixed/test/fixed_isqrt_tb.py + time python3 src/mase_components/scalar_operators/fixed/test/isqrt_sw.py + # time python3 src/mase_components/scalar_operators/float/test/test_lint_float_arithmetic.py + # time python3 src/mase_components/scalar_operators/fixed/test/fixed_nr_stage_tb.py + # time python3 src/mase_components/scalar_operators/fixed/test/test_lint_fixed_math.py # Systolic array - # python3 src/mase_components/systolic_arrays/test/test_lint_systolic_arrays.py + # time python3 src/mase_components/systolic_arrays/test/test_lint_systolic_arrays.py # Transformer_layers - python3 src/mase_components/transformer_layers/test/fixed_self_attention_head_tb.py - # python3 src/mase_components/transformer_layers/test/fixed_gqa_head_tb.py - # python3 src/mase_components/transformer_layers/test/fixed_self_attention_tb.py - # python3 src/mase_components/transformer_layers/test/test_lint_attention.py + time python3 src/mase_components/transformer_layers/test/fixed_self_attention_head_tb.py + # time python3 src/mase_components/transformer_layers/test/fixed_gqa_head_tb.py + # time python3 src/mase_components/transformer_layers/test/fixed_self_attention_tb.py + # time python3 src/mase_components/transformer_layers/test/test_lint_attention.py reformat: # format python files From 876e96da1198e4b32f06d46ec4219d20fb3c3215 Mon Sep 17 00:00:00 2001 From: Jianyi Cheng Date: Tue, 16 Jul 2024 21:15:27 +0000 Subject: [PATCH 2/5] Reduced test cases and move commands to a bash file (to detect error exit) --- justfile | 126 +--------------- scripts/test-hardware.sh | 141 ++++++++++++++++++ .../cast/test/fixed_signed_cast_tb.py | 8 +- .../common/test/comparator_accumulator_tb.py | 8 +- .../common/test/comparator_tree_tb.py | 7 +- .../test/fixed_lut_index_tb.py | 4 +- .../test/fixed_range_augmentation_tb.py | 4 +- src/mase_components/memory/test/fifo_tb.py | 6 +- .../test/batch_norm_2d_tb.py | 26 ++-- .../fixed/test/fixed_isqrt_tb.py | 4 +- 10 files changed, 179 insertions(+), 155 deletions(-) create mode 100644 scripts/test-hardware.sh diff --git a/justfile b/justfile index 3ab379389..f4cbba99c 100644 --- a/justfile +++ b/justfile @@ -13,131 +13,7 @@ test-sw: test/ test-hw: - # Activation_layers - # time python3 scripts/build-components.py - time python3 src/mase_components/activation_layers/test/fixed_gelu_tb.py - time python3 src/mase_components/activation_layers/test/fixed_leaky_relu_tb.py - time python3 src/mase_components/activation_layers/test/fixed_relu_tb.py - time python3 src/mase_components/activation_layers/test/fixed_selu_tb.py - # time python3 src/mase_components/activation_layers/test/fixed_sigmoid_tb.py - # time python3 src/mase_components/activation_layers/test/fixed_softermax_1d_tb.py - # time python3 src/mase_components/activation_layers/test/fixed_softermax_tb.py - # time python3 src/mase_components/activation_layers/test/fixed_softmax_tb.py - time python3 src/mase_components/activation_layers/test/fixed_softplus_tb.py - time python3 src/mase_components/activation_layers/test/fixed_softsign_tb.py - time python3 src/mase_components/activation_layers/test/fixed_tanh_tb.py - # time python3 src/mase_components/activation_layers/test/softermax_global_norm_tb.py - # time python3 src/mase_components/activation_layers/test/softermax_local_window_tb.py - # time python3 src/mase_components/activation_layers/test/softermax_lpw_pow2_tb.py - # time python3 src/mase_components/activation_layers/test/softermax_lpw_reciprocal_tb.py - # time python3 src/mase_components/activation_layers/test/test_lint_activation_layers.py - # time python3 src/mase_components/activation_layers/test/test_synth_activation_layers.py - # DEV mode (no intention to fix) - # time python3 src/mase_components/activation_layers/test/fixed_elu_tb.py - # time python3 src/mase_components/activation_layers/test/fixed_hardshrink_tb.py - # time python3 src/mase_components/activation_layers/test/fixed_hardswish_tb.py - # time python3 src/mase_components/activation_layers/test/fixed_logsigmoid_tb.py - # time python3 src/mase_components/activation_layers/test/fixed_silu_tb.py - # time python3 src/mase_components/activation_layers/test/fixed_softshrink_tb.py - - # Cast - time python3 src/mase_components/cast/test/fixed_cast_tb.py - time python3 src/mase_components/cast/test/fixed_rounding_tb.py - time python3 src/mase_components/cast/test/fixed_signed_cast_tb.py - # time python3 src/mase_components/cast/test/fixed_unsigned_cast_tb.py - - # Common - time python3 src/mase_components/common/test/comparator_accumulator_tb.py - time python3 src/mase_components/common/test/cut_data_tb.py - time python3 src/mase_components/common/test/lut_tb.py - time python3 src/mase_components/common/test/wrap_data_tb.py - # time python3 src/mase_components/common/test/register_slice_tb.py - # time python3 src/mase_components/common/test/test_lint_common.py - # DEV - # time python3 src/mase_components/common/test/comparator_tree_tb.py - # time python3 src/mase_components/common/test/single_element_repeat_tb.py - - # Convolution_layers - time python3 src/mase_components/convolution_layers/test/convolution_tb.py - - # Inteface - time python3 src/mase_components/interface/axi/test/test_lint_axi.py - # time python3 src/mase_components/interface/axi/test/test_synth_axi.py - - # Language models llmint8 - time python3 src/mase_components/language_models/llmint8/test/find_max_tb.py - time python3 src/mase_components/language_models/llmint8/test/fixed_comparator_tree_layer_tb.py - time python3 src/mase_components/language_models/llmint8/test/fixed_comparator_tree_tb.py - time python3 src/mase_components/language_models/llmint8/test/quantized_matmul_tb.py - time python3 src/mase_components/language_models/llmint8/test/quantizer_top_tb.py - time python3 src/mase_components/language_models/llmint8/test/scatter_tb.py - # DEV - # time python3 src/mase_components/language_models/llmint8/test/llm_int8_top_tb.py - - # Linear layers - # Linear Layer - fixed_linear_layer DEBUG: use bias causes crash - time python3 src/mase_components/linear_layers/fixed_linear_layer/test/fixed_linear_tb.py - # time python3 src/mase_components/linear_layers/fixed_linear_layer/test/binary_activation_binary_linear_tb.py - # time python3 src/mase_components/linear_layers/fixed_linear_layer/test/fixed_activation_binary_linear_tb.py - # Linear Layer - fixed_operators - time python3 src/mase_components/linear_layers/fixed_operators/test/fixed_accumulator_tb.py - # time python3 src/mase_components/linear_layers/fixed_operators/test/fixed_adder_tree_layer_tb.py - time python3 src/mase_components/linear_layers/fixed_operators/test/fixed_adder_tree_tb.py - time python3 src/mase_components/linear_layers/fixed_operators/test/fixed_dot_product_tb.py - time python3 src/mase_components/linear_layers/fixed_operators/test/fixed_lut_index_tb.py - # time python3 src/mase_components/linear_layers/fixed_operators/test/fixed_matmul_core_tb.py - time python3 src/mase_components/linear_layers/fixed_operators/test/fixed_mult_tb.py - time python3 src/mase_components/linear_layers/fixed_operators/test/fixed_range_augmentation_tb.py - # time python3 src/mase_components/linear_layers/fixed_operators/test/fixed_range_reduction_tb.py - # Linear Layer - matmul - # time python3 src/mase_components/linear_layers/matmul/test/chain_matmul_tb.py - # time python3 src/mase_components/linear_layers/matmul/test/fixed_mamul_tb.py - # time python3 src/mase_components/linear_layers/matmul/test/matmul_tb.py - # time python3 src/mase_components/linear_layers/matmul/test/matrix_stream_transpose_tb.py - # time python3 src/mase_components/linear_layers/matmul/test/transpose_tb.py - # DEV Linear Layer - binary_operators - time python3 src/mase_components/linear_layers/binarized_operators/test/binary_activation_binary_adder_tree_layer_tb.py - # time python3 src/mase_components/linear_layers/binarized_operators/test/binary_activation_binary_adder_tree_tb.py - # time python3 src/mase_components/linear_layers/binarized_operators/test/binary_activation_binary_dot_product_tb.py - # time python3 src/mase_components/linear_layers/binarized_operators/test/binary_activation_binary_matmul_core_tb.py - # time python3 src/mase_components/linear_layers/binarized_operators/test/binary_activation_binary_mult_tb.py - # time python3 src/mase_components/linear_layers/binarized_operators/test/binary_activation_binary_vector_mult_tb.py - # time python3 src/mase_components/linear_layers/binarized_operators/test/fixed_activation_binary_dot_product_tb.py - # time python3 src/mase_components/linear_layers/binarized_operators/test/fixed_activation_binary_mult_tb.py - # time python3 src/mase_components/linear_layers/binarized_operators/test/fixed_activation_binary_vector_mult_tb.py - # time python3 src/mase_components/linear_layers/binarized_operators/test/test_lint_binary_arith.py - - # Memory - time python3 src/mase_components/memory/test/fifo_tb.py - # time python3 src/mase_components/memory/test/input_buffer_tb.py - time python3 src/mase_components/memory/test/skid_buffer_tb.py - # time python3 src/mase_components/memory/test/unpacked_fifo_tb.py - # time python3 src/mase_components/memory/test/repeat_circular_buffer_tb.py - # time python3 src/mase_components/memory/test/test_lint_memory.py - - # Normalization_layers - time python3 src/mase_components/normalization_layers/test/batch_norm_2d_tb.py - time python3 src/mase_components/normalization_layers/test/group_norm_2d_tb.py - # DEV - # time python3 src/mase_components/normalization_layers/test/channel_selection_tb.py - # time python3 src/mase_components/normalization_layers/test/rms_norm_2d_tb.py - # time python3 src/mase_components/normalization_layers/test/test_lint_norm.py - - # Scalar operators - time python3 src/mase_components/scalar_operators/fixed/test/fixed_isqrt_tb.py - time python3 src/mase_components/scalar_operators/fixed/test/isqrt_sw.py - # time python3 src/mase_components/scalar_operators/float/test/test_lint_float_arithmetic.py - # time python3 src/mase_components/scalar_operators/fixed/test/fixed_nr_stage_tb.py - # time python3 src/mase_components/scalar_operators/fixed/test/test_lint_fixed_math.py - - # Systolic array - # time python3 src/mase_components/systolic_arrays/test/test_lint_systolic_arrays.py - - # Transformer_layers - time python3 src/mase_components/transformer_layers/test/fixed_self_attention_head_tb.py - # time python3 src/mase_components/transformer_layers/test/fixed_gqa_head_tb.py - # time python3 src/mase_components/transformer_layers/test/fixed_self_attention_tb.py - # time python3 src/mase_components/transformer_layers/test/test_lint_attention.py + time bash scripts/test-hardware.sh reformat: # format python files diff --git a/scripts/test-hardware.sh b/scripts/test-hardware.sh new file mode 100644 index 000000000..4584260e9 --- /dev/null +++ b/scripts/test-hardware.sh @@ -0,0 +1,141 @@ +#!/usr/bin/env bash +# -------------------------------------------------------------------- +# This is a script to test hardware components +# -------------------------------------------------------------------- + +set -o errexit +set -o pipefail +set -o nounset + +# The absolute path to the directory of this script. +SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" +MASE=$SCRIPT_DIR/.. + +cd $MASE + +# Activation_layers +# time python3 scripts/build-components.py +time python3 src/mase_components/activation_layers/test/fixed_gelu_tb.py +time python3 src/mase_components/activation_layers/test/fixed_leaky_relu_tb.py +time python3 src/mase_components/activation_layers/test/fixed_relu_tb.py +time python3 src/mase_components/activation_layers/test/fixed_selu_tb.py +# time python3 src/mase_components/activation_layers/test/fixed_sigmoid_tb.py +# time python3 src/mase_components/activation_layers/test/fixed_softermax_1d_tb.py +# time python3 src/mase_components/activation_layers/test/fixed_softermax_tb.py +# time python3 src/mase_components/activation_layers/test/fixed_softmax_tb.py +time python3 src/mase_components/activation_layers/test/fixed_softplus_tb.py +time python3 src/mase_components/activation_layers/test/fixed_softsign_tb.py +time python3 src/mase_components/activation_layers/test/fixed_tanh_tb.py +# time python3 src/mase_components/activation_layers/test/softermax_global_norm_tb.py +# time python3 src/mase_components/activation_layers/test/softermax_local_window_tb.py +# time python3 src/mase_components/activation_layers/test/softermax_lpw_pow2_tb.py +# time python3 src/mase_components/activation_layers/test/softermax_lpw_reciprocal_tb.py +# time python3 src/mase_components/activation_layers/test/test_lint_activation_layers.py +# time python3 src/mase_components/activation_layers/test/test_synth_activation_layers.py +# DEV mode (no intention to fix) +# time python3 src/mase_components/activation_layers/test/fixed_elu_tb.py +# time python3 src/mase_components/activation_layers/test/fixed_hardshrink_tb.py +# time python3 src/mase_components/activation_layers/test/fixed_hardswish_tb.py +# time python3 src/mase_components/activation_layers/test/fixed_logsigmoid_tb.py +# time python3 src/mase_components/activation_layers/test/fixed_silu_tb.py +# time python3 src/mase_components/activation_layers/test/fixed_softshrink_tb.py + +# Cast +time python3 src/mase_components/cast/test/fixed_cast_tb.py +time python3 src/mase_components/cast/test/fixed_rounding_tb.py +time python3 src/mase_components/cast/test/fixed_signed_cast_tb.py +# time python3 src/mase_components/cast/test/fixed_unsigned_cast_tb.py + +# Common +time python3 src/mase_components/common/test/comparator_accumulator_tb.py +time python3 src/mase_components/common/test/cut_data_tb.py +time python3 src/mase_components/common/test/lut_tb.py +time python3 src/mase_components/common/test/wrap_data_tb.py +# time python3 src/mase_components/common/test/register_slice_tb.py +# time python3 src/mase_components/common/test/test_lint_common.py +# DEV +# time python3 src/mase_components/common/test/comparator_tree_tb.py +# time python3 src/mase_components/common/test/single_element_repeat_tb.py + +# Convolution_layers +time python3 src/mase_components/convolution_layers/test/convolution_tb.py + +# Inteface +time python3 src/mase_components/interface/axi/test/test_lint_axi.py +# time python3 src/mase_components/interface/axi/test/test_synth_axi.py + +# Language models llmint8 +time python3 src/mase_components/language_models/llmint8/test/find_max_tb.py +time python3 src/mase_components/language_models/llmint8/test/fixed_comparator_tree_layer_tb.py +time python3 src/mase_components/language_models/llmint8/test/fixed_comparator_tree_tb.py +time python3 src/mase_components/language_models/llmint8/test/quantized_matmul_tb.py +time python3 src/mase_components/language_models/llmint8/test/quantizer_top_tb.py +time python3 src/mase_components/language_models/llmint8/test/scatter_tb.py +# DEV +# time python3 src/mase_components/language_models/llmint8/test/llm_int8_top_tb.py + +# Linear layers +# Linear Layer - fixed_linear_layer DEBUG: use bias causes crash +time python3 src/mase_components/linear_layers/fixed_linear_layer/test/fixed_linear_tb.py +# time python3 src/mase_components/linear_layers/fixed_linear_layer/test/binary_activation_binary_linear_tb.py +# time python3 src/mase_components/linear_layers/fixed_linear_layer/test/fixed_activation_binary_linear_tb.py +# Linear Layer - fixed_operators +time python3 src/mase_components/linear_layers/fixed_operators/test/fixed_accumulator_tb.py +# time python3 src/mase_components/linear_layers/fixed_operators/test/fixed_adder_tree_layer_tb.py +time python3 src/mase_components/linear_layers/fixed_operators/test/fixed_adder_tree_tb.py +time python3 src/mase_components/linear_layers/fixed_operators/test/fixed_dot_product_tb.py +time python3 src/mase_components/linear_layers/fixed_operators/test/fixed_lut_index_tb.py +# time python3 src/mase_components/linear_layers/fixed_operators/test/fixed_matmul_core_tb.py +time python3 src/mase_components/linear_layers/fixed_operators/test/fixed_mult_tb.py +time python3 src/mase_components/linear_layers/fixed_operators/test/fixed_range_augmentation_tb.py +# time python3 src/mase_components/linear_layers/fixed_operators/test/fixed_range_reduction_tb.py +# Linear Layer - matmul +# time python3 src/mase_components/linear_layers/matmul/test/chain_matmul_tb.py +# time python3 src/mase_components/linear_layers/matmul/test/fixed_mamul_tb.py +# time python3 src/mase_components/linear_layers/matmul/test/matmul_tb.py +# time python3 src/mase_components/linear_layers/matmul/test/matrix_stream_transpose_tb.py +# time python3 src/mase_components/linear_layers/matmul/test/transpose_tb.py +# DEV Linear Layer - binary_operators +time python3 src/mase_components/linear_layers/binarized_operators/test/binary_activation_binary_adder_tree_layer_tb.py +# time python3 src/mase_components/linear_layers/binarized_operators/test/binary_activation_binary_adder_tree_tb.py +# time python3 src/mase_components/linear_layers/binarized_operators/test/binary_activation_binary_dot_product_tb.py +# time python3 src/mase_components/linear_layers/binarized_operators/test/binary_activation_binary_matmul_core_tb.py +# time python3 src/mase_components/linear_layers/binarized_operators/test/binary_activation_binary_mult_tb.py +# time python3 src/mase_components/linear_layers/binarized_operators/test/binary_activation_binary_vector_mult_tb.py +# time python3 src/mase_components/linear_layers/binarized_operators/test/fixed_activation_binary_dot_product_tb.py +# time python3 src/mase_components/linear_layers/binarized_operators/test/fixed_activation_binary_mult_tb.py +# time python3 src/mase_components/linear_layers/binarized_operators/test/fixed_activation_binary_vector_mult_tb.py +# time python3 src/mase_components/linear_layers/binarized_operators/test/test_lint_binary_arith.py + +# Memory +time python3 src/mase_components/memory/test/fifo_tb.py +# time python3 src/mase_components/memory/test/input_buffer_tb.py +time python3 src/mase_components/memory/test/skid_buffer_tb.py +# time python3 src/mase_components/memory/test/unpacked_fifo_tb.py +# time python3 src/mase_components/memory/test/repeat_circular_buffer_tb.py +# time python3 src/mase_components/memory/test/test_lint_memory.py + +# Normalization_layers +time python3 src/mase_components/normalization_layers/test/batch_norm_2d_tb.py +time python3 src/mase_components/normalization_layers/test/group_norm_2d_tb.py +# DEV +# time python3 src/mase_components/normalization_layers/test/channel_selection_tb.py +# time python3 src/mase_components/normalization_layers/test/rms_norm_2d_tb.py +# time python3 src/mase_components/normalization_layers/test/test_lint_norm.py + +# Scalar operators +time python3 src/mase_components/scalar_operators/fixed/test/fixed_isqrt_tb.py +time python3 src/mase_components/scalar_operators/fixed/test/isqrt_sw.py +# time python3 src/mase_components/scalar_operators/float/test/test_lint_float_arithmetic.py +# time python3 src/mase_components/scalar_operators/fixed/test/fixed_nr_stage_tb.py +# time python3 src/mase_components/scalar_operators/fixed/test/test_lint_fixed_math.py + +# Systolic array +# time python3 src/mase_components/systolic_arrays/test/test_lint_systolic_arrays.py + +# Transformer_layers +time python3 src/mase_components/transformer_layers/test/fixed_self_attention_head_tb.py +# time python3 src/mase_components/transformer_layers/test/fixed_gqa_head_tb.py +# time python3 src/mase_components/transformer_layers/test/fixed_self_attention_tb.py +# time python3 src/mase_components/transformer_layers/test/test_lint_attention.py + diff --git a/src/mase_components/cast/test/fixed_signed_cast_tb.py b/src/mase_components/cast/test/fixed_signed_cast_tb.py index 2ce3bbe5f..84629f519 100644 --- a/src/mase_components/cast/test/fixed_signed_cast_tb.py +++ b/src/mase_components/cast/test/fixed_signed_cast_tb.py @@ -184,9 +184,11 @@ def gen_rounding(cfg_list): ) return l - cfg_list = [DEFAULT_CONFIG] - cfg_list = gen_width_change_configs(cfg_list) - cfg_list = gen_symmetric(cfg_list) + cfg_list = [ + DEFAULT_CONFIG, + ] + # cfg_list = gen_width_change_configs(cfg_list) + # cfg_list = gen_symmetric(cfg_list) # Other rounding modes not supported yet # cfg_list = gen_rounding(cfg_list) diff --git a/src/mase_components/common/test/comparator_accumulator_tb.py b/src/mase_components/common/test/comparator_accumulator_tb.py index fbd8af937..7835f395c 100644 --- a/src/mase_components/common/test/comparator_accumulator_tb.py +++ b/src/mase_components/common/test/comparator_accumulator_tb.py @@ -146,9 +146,11 @@ def signed_max_min_cfgs(cfglist: list): "SIGNED": 0, } - cfgs = [DEFAULT] - cfgs = width_cfgs(cfgs) - cfgs = depth_cfgs(cfgs) + cfgs = [ + DEFAULT, + ] + # cfgs = width_cfgs(cfgs) + # cfgs = depth_cfgs(cfgs) cfgs = signed_max_min_cfgs(cfgs) mase_runner( diff --git a/src/mase_components/common/test/comparator_tree_tb.py b/src/mase_components/common/test/comparator_tree_tb.py index 5637791b3..c1f107880 100644 --- a/src/mase_components/common/test/comparator_tree_tb.py +++ b/src/mase_components/common/test/comparator_tree_tb.py @@ -132,8 +132,11 @@ def signed_max_min_cfgs(cfglist: list): "SIGNED": 0, } - cfgs = size_cfgs([DEFAULT]) - cfgs = signed_max_min_cfgs(cfgs) + cfgs = [ + DEFAULT, + ] + # cfgs = size_cfgs([DEFAULT]) + # cfgs = signed_max_min_cfgs(cfgs) mase_runner( module_param_list=cfgs, diff --git a/src/mase_components/linear_layers/fixed_operators/test/fixed_lut_index_tb.py b/src/mase_components/linear_layers/fixed_operators/test/fixed_lut_index_tb.py index 42bcb4edc..797beac9e 100644 --- a/src/mase_components/linear_layers/fixed_operators/test/fixed_lut_index_tb.py +++ b/src/mase_components/linear_layers/fixed_operators/test/fixed_lut_index_tb.py @@ -103,8 +103,8 @@ def full_sweep(): parameter_list.append(parameters) return parameter_list - parameter_list = full_sweep() - # parameter_list = [{"WIDTH": 7, "LUT_POW": 5}] + # parameter_list = full_sweep() + parameter_list = [{"WIDTH": 7, "LUT_POW": 5}] mase_runner(module_param_list=parameter_list) diff --git a/src/mase_components/linear_layers/fixed_operators/test/fixed_range_augmentation_tb.py b/src/mase_components/linear_layers/fixed_operators/test/fixed_range_augmentation_tb.py index cbf9cf776..02b5af3ad 100644 --- a/src/mase_components/linear_layers/fixed_operators/test/fixed_range_augmentation_tb.py +++ b/src/mase_components/linear_layers/fixed_operators/test/fixed_range_augmentation_tb.py @@ -96,8 +96,8 @@ def full_sweep(): parameter_list.append(parameters) return parameter_list - parameter_list = full_sweep() - # parameter_list = [{"WIDTH": 2, "FRAC_WIDTH": 2}] + # parameter_list = full_sweep() + parameter_list = [{"WIDTH": 16, "FRAC_WIDTH": 8}] mase_runner(module_param_list=parameter_list) diff --git a/src/mase_components/memory/test/fifo_tb.py b/src/mase_components/memory/test/fifo_tb.py index 9dc4f54ff..b91c49601 100644 --- a/src/mase_components/memory/test/fifo_tb.py +++ b/src/mase_components/memory/test/fifo_tb.py @@ -121,10 +121,10 @@ async def cocotb_test_soak(dut): def test_fifo(): mase_runner( module_param_list=[ - {"DEPTH": 1}, - {"DEPTH": 7}, + # {"DEPTH": 1}, + # {"DEPTH": 7}, {"DEPTH": 8}, - {"DEPTH": 81}, + # {"DEPTH": 81}, ], trace=True, ) diff --git a/src/mase_components/normalization_layers/test/batch_norm_2d_tb.py b/src/mase_components/normalization_layers/test/batch_norm_2d_tb.py index 02297dd3b..162705995 100644 --- a/src/mase_components/normalization_layers/test/batch_norm_2d_tb.py +++ b/src/mase_components/normalization_layers/test/batch_norm_2d_tb.py @@ -382,19 +382,19 @@ def gen_cfg( test_cfgs = [ # Default gen_cfg(), - # Precision - gen_cfg(4, 4, 2, 2, 4, 8, 4, 8, 4, 1), - gen_cfg(4, 4, 2, 2, 4, 4, 2, 4, 2, 2), - gen_cfg(4, 4, 2, 2, 4, 2, 1, 2, 1, 3), - # Rectangle - gen_cfg(4, 6, 2, 2, 4, 16, 8, 16, 8, 4), - gen_cfg(6, 2, 2, 2, 4, 16, 8, 16, 8, 5), - gen_cfg(6, 2, 3, 2, 4, 16, 8, 16, 8, 6), - gen_cfg(4, 6, 2, 3, 4, 16, 8, 16, 8, 7), - ## Channels - gen_cfg(4, 4, 2, 2, 5, 16, 8, 16, 8, 8), - gen_cfg(4, 4, 2, 2, 6, 16, 8, 16, 8, 9), - gen_cfg(4, 4, 2, 2, 7, 16, 8, 16, 8, 10), + # # Precision + # gen_cfg(4, 4, 2, 2, 4, 8, 4, 8, 4, 1), + # gen_cfg(4, 4, 2, 2, 4, 4, 2, 4, 2, 2), + # gen_cfg(4, 4, 2, 2, 4, 2, 1, 2, 1, 3), + # # Rectangle + # gen_cfg(4, 6, 2, 2, 4, 16, 8, 16, 8, 4), + # gen_cfg(6, 2, 2, 2, 4, 16, 8, 16, 8, 5), + # gen_cfg(6, 2, 3, 2, 4, 16, 8, 16, 8, 6), + # gen_cfg(4, 6, 2, 3, 4, 16, 8, 16, 8, 7), + # ## Channels + # gen_cfg(4, 4, 2, 2, 5, 16, 8, 16, 8, 8), + # gen_cfg(4, 4, 2, 2, 6, 16, 8, 16, 8, 9), + # gen_cfg(4, 4, 2, 2, 7, 16, 8, 16, 8, 10), ] mase_runner( diff --git a/src/mase_components/scalar_operators/fixed/test/fixed_isqrt_tb.py b/src/mase_components/scalar_operators/fixed/test/fixed_isqrt_tb.py index 6ee7a93dd..cf9c5a3d9 100644 --- a/src/mase_components/scalar_operators/fixed/test/fixed_isqrt_tb.py +++ b/src/mase_components/scalar_operators/fixed/test/fixed_isqrt_tb.py @@ -156,8 +156,8 @@ def full_sweep(): parameter_list = [ # A use case in group_norm - *full_sweep(), - # single_cfg(35, 14, 7, 0) + # *full_sweep(), + single_cfg(35, 14, 7, 0) ] mase_runner(module_param_list=parameter_list, trace=True) From ba515a2d5181e62ea670193626a424d79e5a8c40 Mon Sep 17 00:00:00 2001 From: Jianyi Cheng Date: Tue, 16 Jul 2024 21:24:54 +0000 Subject: [PATCH 3/5] Added error detection in log --- scripts/test-hardware.sh | 193 ++++++++++++++++++++------------------- 1 file changed, 99 insertions(+), 94 deletions(-) diff --git a/scripts/test-hardware.sh b/scripts/test-hardware.sh index 4584260e9..355db393e 100644 --- a/scripts/test-hardware.sh +++ b/scripts/test-hardware.sh @@ -13,129 +13,134 @@ MASE=$SCRIPT_DIR/.. cd $MASE +run_test() { + echo "----------------- $1 -----------------" + time python3 $1 | grep "FAIL" || exit 1 +} + # Activation_layers -# time python3 scripts/build-components.py -time python3 src/mase_components/activation_layers/test/fixed_gelu_tb.py -time python3 src/mase_components/activation_layers/test/fixed_leaky_relu_tb.py -time python3 src/mase_components/activation_layers/test/fixed_relu_tb.py -time python3 src/mase_components/activation_layers/test/fixed_selu_tb.py -# time python3 src/mase_components/activation_layers/test/fixed_sigmoid_tb.py -# time python3 src/mase_components/activation_layers/test/fixed_softermax_1d_tb.py -# time python3 src/mase_components/activation_layers/test/fixed_softermax_tb.py -# time python3 src/mase_components/activation_layers/test/fixed_softmax_tb.py -time python3 src/mase_components/activation_layers/test/fixed_softplus_tb.py -time python3 src/mase_components/activation_layers/test/fixed_softsign_tb.py -time python3 src/mase_components/activation_layers/test/fixed_tanh_tb.py -# time python3 src/mase_components/activation_layers/test/softermax_global_norm_tb.py -# time python3 src/mase_components/activation_layers/test/softermax_local_window_tb.py -# time python3 src/mase_components/activation_layers/test/softermax_lpw_pow2_tb.py -# time python3 src/mase_components/activation_layers/test/softermax_lpw_reciprocal_tb.py -# time python3 src/mase_components/activation_layers/test/test_lint_activation_layers.py -# time python3 src/mase_components/activation_layers/test/test_synth_activation_layers.py +# run_test scripts/build-components.py +run_test src/mase_components/activation_layers/test/fixed_gelu_tb.py +run_test src/mase_components/activation_layers/test/fixed_leaky_relu_tb.py +run_test src/mase_components/activation_layers/test/fixed_relu_tb.py +run_test src/mase_components/activation_layers/test/fixed_selu_tb.py +# run_test src/mase_components/activation_layers/test/fixed_sigmoid_tb.py +# run_test src/mase_components/activation_layers/test/fixed_softermax_1d_tb.py +# run_test src/mase_components/activation_layers/test/fixed_softermax_tb.py +# run_test src/mase_components/activation_layers/test/fixed_softmax_tb.py +run_test src/mase_components/activation_layers/test/fixed_softplus_tb.py +run_test src/mase_components/activation_layers/test/fixed_softsign_tb.py +run_test src/mase_components/activation_layers/test/fixed_tanh_tb.py +# run_test src/mase_components/activation_layers/test/softermax_global_norm_tb.py +# run_test src/mase_components/activation_layers/test/softermax_local_window_tb.py +# run_test src/mase_components/activation_layers/test/softermax_lpw_pow2_tb.py +# run_test src/mase_components/activation_layers/test/softermax_lpw_reciprocal_tb.py +# run_test src/mase_components/activation_layers/test/test_lint_activation_layers.py +# run_test src/mase_components/activation_layers/test/test_synth_activation_layers.py # DEV mode (no intention to fix) -# time python3 src/mase_components/activation_layers/test/fixed_elu_tb.py -# time python3 src/mase_components/activation_layers/test/fixed_hardshrink_tb.py -# time python3 src/mase_components/activation_layers/test/fixed_hardswish_tb.py -# time python3 src/mase_components/activation_layers/test/fixed_logsigmoid_tb.py -# time python3 src/mase_components/activation_layers/test/fixed_silu_tb.py -# time python3 src/mase_components/activation_layers/test/fixed_softshrink_tb.py +# run_test src/mase_components/activation_layers/test/fixed_elu_tb.py +# run_test src/mase_components/activation_layers/test/fixed_hardshrink_tb.py +# run_test src/mase_components/activation_layers/test/fixed_hardswish_tb.py +# run_test src/mase_components/activation_layers/test/fixed_logsigmoid_tb.py +# run_test src/mase_components/activation_layers/test/fixed_silu_tb.py +# run_test src/mase_components/activation_layers/test/fixed_softshrink_tb.py # Cast -time python3 src/mase_components/cast/test/fixed_cast_tb.py -time python3 src/mase_components/cast/test/fixed_rounding_tb.py -time python3 src/mase_components/cast/test/fixed_signed_cast_tb.py -# time python3 src/mase_components/cast/test/fixed_unsigned_cast_tb.py +run_test src/mase_components/cast/test/fixed_cast_tb.py +run_test src/mase_components/cast/test/fixed_rounding_tb.py +run_test src/mase_components/cast/test/fixed_signed_cast_tb.py +# run_test src/mase_components/cast/test/fixed_unsigned_cast_tb.py # Common -time python3 src/mase_components/common/test/comparator_accumulator_tb.py -time python3 src/mase_components/common/test/cut_data_tb.py -time python3 src/mase_components/common/test/lut_tb.py -time python3 src/mase_components/common/test/wrap_data_tb.py -# time python3 src/mase_components/common/test/register_slice_tb.py -# time python3 src/mase_components/common/test/test_lint_common.py +run_test src/mase_components/common/test/comparator_accumulator_tb.py +run_test src/mase_components/common/test/cut_data_tb.py +run_test src/mase_components/common/test/lut_tb.py +run_test src/mase_components/common/test/wrap_data_tb.py +# run_test src/mase_components/common/test/register_slice_tb.py +# run_test src/mase_components/common/test/test_lint_common.py # DEV -# time python3 src/mase_components/common/test/comparator_tree_tb.py -# time python3 src/mase_components/common/test/single_element_repeat_tb.py +# run_test src/mase_components/common/test/comparator_tree_tb.py +# run_test src/mase_components/common/test/single_element_repeat_tb.py # Convolution_layers -time python3 src/mase_components/convolution_layers/test/convolution_tb.py +run_test src/mase_components/convolution_layers/test/convolution_tb.py # Inteface -time python3 src/mase_components/interface/axi/test/test_lint_axi.py -# time python3 src/mase_components/interface/axi/test/test_synth_axi.py +run_test src/mase_components/interface/axi/test/test_lint_axi.py +# run_test src/mase_components/interface/axi/test/test_synth_axi.py # Language models llmint8 -time python3 src/mase_components/language_models/llmint8/test/find_max_tb.py -time python3 src/mase_components/language_models/llmint8/test/fixed_comparator_tree_layer_tb.py -time python3 src/mase_components/language_models/llmint8/test/fixed_comparator_tree_tb.py -time python3 src/mase_components/language_models/llmint8/test/quantized_matmul_tb.py -time python3 src/mase_components/language_models/llmint8/test/quantizer_top_tb.py -time python3 src/mase_components/language_models/llmint8/test/scatter_tb.py +run_test src/mase_components/language_models/llmint8/test/find_max_tb.py +run_test src/mase_components/language_models/llmint8/test/fixed_comparator_tree_layer_tb.py +run_test src/mase_components/language_models/llmint8/test/fixed_comparator_tree_tb.py +run_test src/mase_components/language_models/llmint8/test/quantized_matmul_tb.py +run_test src/mase_components/language_models/llmint8/test/quantizer_top_tb.py +run_test src/mase_components/language_models/llmint8/test/scatter_tb.py # DEV -# time python3 src/mase_components/language_models/llmint8/test/llm_int8_top_tb.py +# run_test src/mase_components/language_models/llmint8/test/llm_int8_top_tb.py # Linear layers # Linear Layer - fixed_linear_layer DEBUG: use bias causes crash -time python3 src/mase_components/linear_layers/fixed_linear_layer/test/fixed_linear_tb.py -# time python3 src/mase_components/linear_layers/fixed_linear_layer/test/binary_activation_binary_linear_tb.py -# time python3 src/mase_components/linear_layers/fixed_linear_layer/test/fixed_activation_binary_linear_tb.py +run_test src/mase_components/linear_layers/fixed_linear_layer/test/fixed_linear_tb.py +# run_test src/mase_components/linear_layers/fixed_linear_layer/test/binary_activation_binary_linear_tb.py +# run_test src/mase_components/linear_layers/fixed_linear_layer/test/fixed_activation_binary_linear_tb.py # Linear Layer - fixed_operators -time python3 src/mase_components/linear_layers/fixed_operators/test/fixed_accumulator_tb.py -# time python3 src/mase_components/linear_layers/fixed_operators/test/fixed_adder_tree_layer_tb.py -time python3 src/mase_components/linear_layers/fixed_operators/test/fixed_adder_tree_tb.py -time python3 src/mase_components/linear_layers/fixed_operators/test/fixed_dot_product_tb.py -time python3 src/mase_components/linear_layers/fixed_operators/test/fixed_lut_index_tb.py -# time python3 src/mase_components/linear_layers/fixed_operators/test/fixed_matmul_core_tb.py -time python3 src/mase_components/linear_layers/fixed_operators/test/fixed_mult_tb.py -time python3 src/mase_components/linear_layers/fixed_operators/test/fixed_range_augmentation_tb.py -# time python3 src/mase_components/linear_layers/fixed_operators/test/fixed_range_reduction_tb.py +run_test src/mase_components/linear_layers/fixed_operators/test/fixed_accumulator_tb.py +# run_test src/mase_components/linear_layers/fixed_operators/test/fixed_adder_tree_layer_tb.py +run_test src/mase_components/linear_layers/fixed_operators/test/fixed_adder_tree_tb.py +run_test src/mase_components/linear_layers/fixed_operators/test/fixed_dot_product_tb.py +run_test src/mase_components/linear_layers/fixed_operators/test/fixed_lut_index_tb.py +# run_test src/mase_components/linear_layers/fixed_operators/test/fixed_matmul_core_tb.py +run_test src/mase_components/linear_layers/fixed_operators/test/fixed_mult_tb.py +run_test src/mase_components/linear_layers/fixed_operators/test/fixed_range_augmentation_tb.py +# run_test src/mase_components/linear_layers/fixed_operators/test/fixed_range_reduction_tb.py # Linear Layer - matmul -# time python3 src/mase_components/linear_layers/matmul/test/chain_matmul_tb.py -# time python3 src/mase_components/linear_layers/matmul/test/fixed_mamul_tb.py -# time python3 src/mase_components/linear_layers/matmul/test/matmul_tb.py -# time python3 src/mase_components/linear_layers/matmul/test/matrix_stream_transpose_tb.py -# time python3 src/mase_components/linear_layers/matmul/test/transpose_tb.py +# run_test src/mase_components/linear_layers/matmul/test/chain_matmul_tb.py +# run_test src/mase_components/linear_layers/matmul/test/fixed_mamul_tb.py +# run_test src/mase_components/linear_layers/matmul/test/matmul_tb.py +# run_test src/mase_components/linear_layers/matmul/test/matrix_stream_transpose_tb.py +# run_test src/mase_components/linear_layers/matmul/test/transpose_tb.py # DEV Linear Layer - binary_operators -time python3 src/mase_components/linear_layers/binarized_operators/test/binary_activation_binary_adder_tree_layer_tb.py -# time python3 src/mase_components/linear_layers/binarized_operators/test/binary_activation_binary_adder_tree_tb.py -# time python3 src/mase_components/linear_layers/binarized_operators/test/binary_activation_binary_dot_product_tb.py -# time python3 src/mase_components/linear_layers/binarized_operators/test/binary_activation_binary_matmul_core_tb.py -# time python3 src/mase_components/linear_layers/binarized_operators/test/binary_activation_binary_mult_tb.py -# time python3 src/mase_components/linear_layers/binarized_operators/test/binary_activation_binary_vector_mult_tb.py -# time python3 src/mase_components/linear_layers/binarized_operators/test/fixed_activation_binary_dot_product_tb.py -# time python3 src/mase_components/linear_layers/binarized_operators/test/fixed_activation_binary_mult_tb.py -# time python3 src/mase_components/linear_layers/binarized_operators/test/fixed_activation_binary_vector_mult_tb.py -# time python3 src/mase_components/linear_layers/binarized_operators/test/test_lint_binary_arith.py +run_test src/mase_components/linear_layers/binarized_operators/test/binary_activation_binary_adder_tree_layer_tb.py +# run_test src/mase_components/linear_layers/binarized_operators/test/binary_activation_binary_adder_tree_tb.py +# run_test src/mase_components/linear_layers/binarized_operators/test/binary_activation_binary_dot_product_tb.py +# run_test src/mase_components/linear_layers/binarized_operators/test/binary_activation_binary_matmul_core_tb.py +# run_test src/mase_components/linear_layers/binarized_operators/test/binary_activation_binary_mult_tb.py +# run_test src/mase_components/linear_layers/binarized_operators/test/binary_activation_binary_vector_mult_tb.py +# run_test src/mase_components/linear_layers/binarized_operators/test/fixed_activation_binary_dot_product_tb.py +# run_test src/mase_components/linear_layers/binarized_operators/test/fixed_activation_binary_mult_tb.py +# run_test src/mase_components/linear_layers/binarized_operators/test/fixed_activation_binary_vector_mult_tb.py +# run_test src/mase_components/linear_layers/binarized_operators/test/test_lint_binary_arith.py # Memory -time python3 src/mase_components/memory/test/fifo_tb.py -# time python3 src/mase_components/memory/test/input_buffer_tb.py -time python3 src/mase_components/memory/test/skid_buffer_tb.py -# time python3 src/mase_components/memory/test/unpacked_fifo_tb.py -# time python3 src/mase_components/memory/test/repeat_circular_buffer_tb.py -# time python3 src/mase_components/memory/test/test_lint_memory.py +run_test src/mase_components/memory/test/fifo_tb.py +# run_test src/mase_components/memory/test/input_buffer_tb.py +run_test src/mase_components/memory/test/skid_buffer_tb.py +# run_test src/mase_components/memory/test/unpacked_fifo_tb.py +# run_test src/mase_components/memory/test/repeat_circular_buffer_tb.py +# run_test src/mase_components/memory/test/test_lint_memory.py # Normalization_layers -time python3 src/mase_components/normalization_layers/test/batch_norm_2d_tb.py -time python3 src/mase_components/normalization_layers/test/group_norm_2d_tb.py +run_test src/mase_components/normalization_layers/test/batch_norm_2d_tb.py +run_test src/mase_components/normalization_layers/test/group_norm_2d_tb.py # DEV -# time python3 src/mase_components/normalization_layers/test/channel_selection_tb.py -# time python3 src/mase_components/normalization_layers/test/rms_norm_2d_tb.py -# time python3 src/mase_components/normalization_layers/test/test_lint_norm.py +# run_test src/mase_components/normalization_layers/test/channel_selection_tb.py +# run_test src/mase_components/normalization_layers/test/rms_norm_2d_tb.py +# run_test src/mase_components/normalization_layers/test/test_lint_norm.py # Scalar operators -time python3 src/mase_components/scalar_operators/fixed/test/fixed_isqrt_tb.py -time python3 src/mase_components/scalar_operators/fixed/test/isqrt_sw.py -# time python3 src/mase_components/scalar_operators/float/test/test_lint_float_arithmetic.py -# time python3 src/mase_components/scalar_operators/fixed/test/fixed_nr_stage_tb.py -# time python3 src/mase_components/scalar_operators/fixed/test/test_lint_fixed_math.py +run_test src/mase_components/scalar_operators/fixed/test/fixed_isqrt_tb.py +run_test src/mase_components/scalar_operators/fixed/test/isqrt_sw.py +# run_test src/mase_components/scalar_operators/float/test/test_lint_float_arithmetic.py +# run_test src/mase_components/scalar_operators/fixed/test/fixed_nr_stage_tb.py +# run_test src/mase_components/scalar_operators/fixed/test/test_lint_fixed_math.py # Systolic array -# time python3 src/mase_components/systolic_arrays/test/test_lint_systolic_arrays.py +# run_test src/mase_components/systolic_arrays/test/test_lint_systolic_arrays.py # Transformer_layers -time python3 src/mase_components/transformer_layers/test/fixed_self_attention_head_tb.py -# time python3 src/mase_components/transformer_layers/test/fixed_gqa_head_tb.py -# time python3 src/mase_components/transformer_layers/test/fixed_self_attention_tb.py -# time python3 src/mase_components/transformer_layers/test/test_lint_attention.py +run_test src/mase_components/transformer_layers/test/fixed_self_attention_head_tb.py +# run_test src/mase_components/transformer_layers/test/fixed_gqa_head_tb.py +# run_test src/mase_components/transformer_layers/test/fixed_self_attention_tb.py +# run_test src/mase_components/transformer_layers/test/test_lint_attention.py From ee432c49771ac5755d2406ac23cd17fd69e48ebf Mon Sep 17 00:00:00 2001 From: Jianyi Cheng Date: Tue, 16 Jul 2024 21:33:23 +0000 Subject: [PATCH 4/5] Corrected detection --- scripts/test-hardware.sh | 2 +- src/mase_components/common/test/register_slice_tb.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/test-hardware.sh b/scripts/test-hardware.sh index 355db393e..fc4c0f8ce 100644 --- a/scripts/test-hardware.sh +++ b/scripts/test-hardware.sh @@ -15,7 +15,7 @@ cd $MASE run_test() { echo "----------------- $1 -----------------" - time python3 $1 | grep "FAIL" || exit 1 + time python3 $1 | (! grep "FAIL") || exit 1 } # Activation_layers diff --git a/src/mase_components/common/test/register_slice_tb.py b/src/mase_components/common/test/register_slice_tb.py index 638d53da7..72645cd92 100644 --- a/src/mase_components/common/test/register_slice_tb.py +++ b/src/mase_components/common/test/register_slice_tb.py @@ -11,7 +11,7 @@ from cocotb.triggers import FallingEdge from cocotb.clock import Clock -debug = True +debug = False logger = logging.getLogger("tb_signals") if debug: logger.setLevel(logging.DEBUG) From 1f5f99d10afce12fa3f41ff3709ca3b979dfac83 Mon Sep 17 00:00:00 2001 From: Jianyi Cheng Date: Tue, 16 Jul 2024 21:35:36 +0000 Subject: [PATCH 5/5] removed false positive... --- scripts/test-hardware.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/test-hardware.sh b/scripts/test-hardware.sh index fc4c0f8ce..9ee6090e5 100644 --- a/scripts/test-hardware.sh +++ b/scripts/test-hardware.sh @@ -15,7 +15,7 @@ cd $MASE run_test() { echo "----------------- $1 -----------------" - time python3 $1 | (! grep "FAIL") || exit 1 + time python3 $1 | (! grep " FAIL ") || exit 1 } # Activation_layers