Skip to content

Commit

Permalink
Update NPU tests with new sanitisation
Browse files Browse the repository at this point in the history
  • Loading branch information
Mousius committed Oct 30, 2021
1 parent 7e57104 commit f76040d
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 12 deletions.
16 changes: 12 additions & 4 deletions tests/python/contrib/test_ethosn/infrastructure.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,19 @@ def build(mod, params, npu=True, expected_host_ops=0, npu_partitions=1):
assert (
host_op_count == expected_host_ops
), "Got {} host operators, expected {}".format(host_op_count, expected_host_ops)
partition_count = 0
for global_var in mod.get_global_vars():
if "ethos-n" in global_var.name_hint:
partition_count += 1

attrs = [
mod[var.name_hint].attrs
for var in mod.get_global_vars()
if mod[var.name_hint].attrs
]
partition_count = sum(
[
key == "Compiler" and value == "ethos-n"
for attr in attrs
for key, value in attr.items()
]
)
assert (
npu_partitions == partition_count
), "Got {} ethos-n partitions, expected {}".format(partition_count, npu_partitions)
Expand Down
16 changes: 8 additions & 8 deletions tests/python/contrib/test_ethosn/test_networks.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,9 @@ def test_mobilenet_v1():
# codegen, which could come about from either a change in Support Library
# version or a change in the Ethos-N codegen. To update this requires running
# on hardware that isn't available in CI.
_compile_hash = {"1fd4ef29a1ea9f3a015cab87c0b8014a"}
_compile_hash = {"0433d3c3947a067b36f0228bdb5f1838"}
if tei.get_ethosn_variant() == "Ethos-N78_1TOPS_2PLE_RATIO":
_compile_hash = {"b879dfbff1f907eaf6129dfd41b44ece"}
_compile_hash = {"e4ed29dceb1187505948ab17fc3cc6d6"}
if tei.get_ethosn_api_version() == 2011:
_compile_hash = {"9c9f63b30824f5b223cdb27d2f22c857"}
if tei.get_ethosn_variant() == "Ethos-N78_1TOPS_2PLE_RATIO":
Expand All @@ -150,9 +150,9 @@ def test_inception_v3():
# codegen, which could come about from either a change in Support Library
# version or a change in the Ethos-N codegen. To update this requires running
# on hardware that isn't available in CI.
_compile_hash = {"b90ed315639c6a0e97584c2dbc42a55c"}
_compile_hash = {"43dc2097127eb224c0191b1a15f8acca"}
if tei.get_ethosn_variant() == "Ethos-N78_1TOPS_2PLE_RATIO":
_compile_hash = {"5693569055695e581a8739194d0301aa"}
_compile_hash = {"7db23387bdc5af6eaa1ae3f7d456caf0"}
if tei.get_ethosn_api_version() == 2011:
_compile_hash = {"46ccafc840633633aca441645e41b444"}
if tei.get_ethosn_variant() == "Ethos-N78_1TOPS_2PLE_RATIO":
Expand All @@ -176,9 +176,9 @@ def test_inception_v4():
# codegen, which could come about from either a change in Support Library
# version or a change in the Ethos-N codegen. To update this requires running
# on hardware that isn't available in CI.
_compile_hash = {"b36877d2386d9f9c37a11772e3c4072c"}
_compile_hash = {"fab6c2297502f95d33079c6ce1a737f9"}
if tei.get_ethosn_variant() == "Ethos-N78_1TOPS_2PLE_RATIO":
_compile_hash = {"b5046a6f56d78af0b4f51960bf2deeda"}
_compile_hash = {"8da68849b75613ac3dffd3fff2dd87da"}
if tei.get_ethosn_api_version() == 2011:
_compile_hash = {"4a1a56393078367dd27915a188d6a6af"}
if tei.get_ethosn_variant() == "Ethos-N78_1TOPS_2PLE_RATIO":
Expand All @@ -202,9 +202,9 @@ def test_ssd_mobilenet_v1():
# codegen, which could come about from either a change in Support Library
# version or a change in the Ethos-N codegen. To update this requires running
# on hardware that isn't available in CI.
_compile_hash = {"956caf9e7fe5cfd5c042bd17857f7407", "4313033d14328e2aa022b1bd71b27b1c"}
_compile_hash = {"2345cf5d6c0013bad7c76dcccee9d862", "7795b6c67178da9d1f9b98063bad75b1"}
if tei.get_ethosn_variant() == "Ethos-N78_1TOPS_2PLE_RATIO":
_compile_hash = {"dc60cc687d892cd2877873094e9dfc0b", "6b3deeec16c24c0dcef23df0db5fb162"}
_compile_hash = {"928dc6ae5ce49a4ad63ca87f7575970f", "b092f9820f7e9341fc53daa781b98772"}
if tei.get_ethosn_api_version() == 2011:
_compile_hash = {"10826406ae724e52f360a06c35ced09d", "9a484d5ecec7acb18c9d6bc6058be031"}
if tei.get_ethosn_variant() == "Ethos-N78_1TOPS_2PLE_RATIO":
Expand Down

0 comments on commit f76040d

Please sign in to comment.