Skip to content

Commit

Permalink
Merge pull request #43 from eki-project/fix/ci
Browse files Browse the repository at this point in the history
Fix some tests
  • Loading branch information
fpjentzsch authored Feb 6, 2025
2 parents 957b5c1 + ef81944 commit 2b43ece
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
10 changes: 7 additions & 3 deletions test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,17 @@

cd $FINN_ROOT

trap 'exit_code=1' ERR

if [ -z $1 ] || [ $1 = "quicktest" ]; then
pytest -m 'not (vivado or slow or vitis or board or notebooks or bnn_pynq)' --junitxml=$CI_PROJECT_DIR/reports/quick.xml --html=$CI_PROJECT_DIR/reports/quick.html --reruns 1 --dist worksteal -n $PYTEST_PARALLEL
elif [ $1 = "full" ]; then
pytest -k 'not (rtlsim or end2end)' --junitxml=$CI_PROJECT_DIR/reports/main.xml --html=$CI_PROJECT_DIRreports/main.html --reruns 1 --dist worksteal -n $PYTEST_PARALLEL
pytest -k 'rtlsim and not end2end' --junitxml=$CI_PROJECT_DIR/reports/rtlsim.xml --html=$CI_PROJECT_DIR/reports/rtlsim.html --reruns 1 --dist worksteal -n $PYTEST_PARALLEL
pytest -k 'end2end' -m 'sanity_bnn or end2end or fpgadataflow or notebooks' --junitxml=$CI_PROJECT_DIR/reports/end2end.xml --html=$CI_PROJECT_DIR/reports/end2end.html --reruns 1 --dist loadfile -n $PYTEST_PARALLEL
pytest -m 'not (end2end or sanity_bnn or notebooks)' --junitxml=$CI_PROJECT_DIR/reports/main.xml --html=$CI_PROJECT_DIR/reports/main.html --reruns 1 --dist worksteal -n $PYTEST_PARALLEL
# The following tests cannot be parallelized to the same degree as most tests:
pytest -m 'end2end or sanity_bnn or notebooks' --junitxml=$CI_PROJECT_DIR/reports/end2end.xml --html=$CI_PROJECT_DIR/reports/end2end.html --reruns 1 --dist loadfile -n $PYTEST_PARALLEL
pytest_html_merger -i $CI_PROJECT_DIR/reports/ -o $CI_PROJECT_DIR/reports/full_test_suite.html
else
echo "Unrecognized argument to test.sh: $1"
fi

exit $exit_code
7 changes: 6 additions & 1 deletion tests/fpgadataflow/test_fpgadataflow_thresholding.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,11 @@ def make_single_multithresholding_modelwrapper(

node_inp_list = ["inp", "thresh"]

# Maps tensor rank to layout annotation
rank_to_layout = {0: None, 1: "C", 2: "NC", 3: "NWC", 4: "NHWC"}
# Lookup the layout required by this input shape
data_layout = rank_to_layout[len(num_input_vecs + [num_channels])]

Multithresholding_node = helper.make_node(
"MultiThreshold",
node_inp_list,
Expand All @@ -97,7 +102,7 @@ def make_single_multithresholding_modelwrapper(
out_dtype=output_data_type.name,
out_bias=float(activation_bias),
out_scale=1.0,
data_layout="NHWC",
data_layout=data_layout,
)

graph = helper.make_graph(
Expand Down

0 comments on commit 2b43ece

Please sign in to comment.