Skip to content

Commit

Permalink
[Tests] Include divisibility by 8 in minimize bit width testing
Browse files Browse the repository at this point in the history
  • Loading branch information
auphelia committed Aug 4, 2023
1 parent 917b7e9 commit f713ab0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/fpgadataflow/test_minimize_bit_width.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,8 +296,13 @@ def test_minimize_accumulator_width(wdt: DataType, idt: DataType, tdt: DataType,
exp_adt = calculate_accumulator_bit_width(inst, model)
assert cur_adt.bitwidth() <= exp_adt.bitwidth(), "Mismatched accumulation data types"

# if there is no activation, outputDataType = accDataType
# if there is no activation, outputDataType = accDataType and if it is the last node
# it needs to be divisible by 8
if inst.get_nodeattr("noActivation"):
assert (
cur_adt.bitwidth() == cur_odt.bitwidth()
), "outputDataType and accDataType should be equal"
if model.find_direct_successors(inst.onnx_node) is None:
assert (
cur_adt.bitwidth() % 8
) == 0, "bit width of last node needs to be divisible by 8"

0 comments on commit f713ab0

Please sign in to comment.