From 6986a8bbac59eec16f73275beaaefd4e492d8862 Mon Sep 17 00:00:00 2001 From: johnnoel Date: Wed, 7 Feb 2024 10:49:55 +0000 Subject: [PATCH 1/2] [Tests] Disable lfc on Alveo and apply fix to driver_base --- src/finn/qnn-data/templates/driver/driver_base.py | 8 +++++--- tests/end2end/test_end2end_bnn_pynq.py | 6 ++++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/finn/qnn-data/templates/driver/driver_base.py b/src/finn/qnn-data/templates/driver/driver_base.py index b73bba3121..aa54f84733 100644 --- a/src/finn/qnn-data/templates/driver/driver_base.py +++ b/src/finn/qnn-data/templates/driver/driver_base.py @@ -198,9 +198,11 @@ def load_runtime_weights(self, flush_accel=True, verify=True): # from a tinynumpy.ndarray to numpy.ndarray. To work around this, we first # convert the tinynumpy.ndarray to a list and then copy the list to a # numpy.ndarray. - new_w = np.copy( - list(layer_mmio.array[: layer_w.shape[0]]), dtype=layer_w.dtype - ) + # There is a known bug with larger sets of weights. Accesses to address + # spaces over 16KB do NOT work as intended. Be aware of this if seeing + # unexpected behaviour. + new_array = layer_mmio.array[: layer_w.shape[0]] + new_w = np.copy(np.array(([x for x in new_array]), dtype=layer_w.dtype)) else: new_w = np.copy(layer_mmio.array[: layer_w.shape[0]]) assert (layer_w == new_w).all() diff --git a/tests/end2end/test_end2end_bnn_pynq.py b/tests/end2end/test_end2end_bnn_pynq.py index db065fec42..46eb9a6744 100644 --- a/tests/end2end/test_end2end_bnn_pynq.py +++ b/tests/end2end/test_end2end_bnn_pynq.py @@ -450,6 +450,12 @@ def pytest_generate_tests(metafunc): @pytest.mark.bnn_u250 class TestEnd2End: def test_export(self, topology, wbits, abits, board): + build_data = get_build_env(board, target_clk_ns) + if topology == "lfc" and build_data["kind"] == "alveo": + # There is a known Pynq/XRT issue with larger sets of weights on Alveo. + # Accesses to address spaces over 16KB do NOT work as intended. + # Disabling Alveo lfc until resolved. + pytest.skip("Currently not testing lfc on Alveo due to pynq driver issues") if wbits > abits: pytest.skip("No wbits > abits end2end network configs for now") if topology == "lfc" and not (wbits == 1 and abits == 1): From 1ee77b7725e8242b470364fac401302e69fa9d13 Mon Sep 17 00:00:00 2001 From: johnnoel Date: Wed, 7 Feb 2024 14:01:47 +0000 Subject: [PATCH 2/2] [Tests] Only disable lfc test for alveo during HW testing --- docker/jenkins/test_bnn_hw_pytest.py | 5 +++++ tests/end2end/test_end2end_bnn_pynq.py | 6 ------ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/docker/jenkins/test_bnn_hw_pytest.py b/docker/jenkins/test_bnn_hw_pytest.py index c8f4fbf74d..dc350d8504 100755 --- a/docker/jenkins/test_bnn_hw_pytest.py +++ b/docker/jenkins/test_bnn_hw_pytest.py @@ -87,6 +87,11 @@ def pytest_generate_tests(metafunc): if len(scenarios) > 0: for scenario in scenarios: + # There is a known Pynq/XRT issue with larger sets of weights on Alveo. + # Accesses to address spaces over 16KB do NOT work as intended. + # Disabling Alveo lfc HW test until resolved. + if scenario[0] == "U250_bnn_w1_a1_lfc_batchSize-1_platform-alveo": + continue idlist.append(scenario[0]) items = scenario[1].items() argnames = [x[0] for x in items] diff --git a/tests/end2end/test_end2end_bnn_pynq.py b/tests/end2end/test_end2end_bnn_pynq.py index 46eb9a6744..db065fec42 100644 --- a/tests/end2end/test_end2end_bnn_pynq.py +++ b/tests/end2end/test_end2end_bnn_pynq.py @@ -450,12 +450,6 @@ def pytest_generate_tests(metafunc): @pytest.mark.bnn_u250 class TestEnd2End: def test_export(self, topology, wbits, abits, board): - build_data = get_build_env(board, target_clk_ns) - if topology == "lfc" and build_data["kind"] == "alveo": - # There is a known Pynq/XRT issue with larger sets of weights on Alveo. - # Accesses to address spaces over 16KB do NOT work as intended. - # Disabling Alveo lfc until resolved. - pytest.skip("Currently not testing lfc on Alveo due to pynq driver issues") if wbits > abits: pytest.skip("No wbits > abits end2end network configs for now") if topology == "lfc" and not (wbits == 1 and abits == 1):