Skip to content

Commit 24bccd2

Browse files
authored
[microNPU] Remove remaining UnsupportedLayout checks (#9791)
* [microNPU] Remove remaining UnsupportedLayout checks In #9508 the decision was made to remove the UnsupportedLayout exception and the checks that throw it, this PR is cleaning up some that remained. Change-Id: I83bfe233381b83af886343c9569db753e33f9059 * fix lint Change-Id: I67c1a5371f0b2e51b6cd39435ef4073d8d17af51
1 parent 596333b commit 24bccd2

File tree

1 file changed

+0
-16
lines changed

1 file changed

+0
-16
lines changed

python/tvm/relay/backend/contrib/ethosu/legalize.py

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -290,8 +290,6 @@ def callback(
290290
"OHWI": params.weights.shape[1:3],
291291
"HWOI": params.weights.shape[0:2],
292292
}
293-
if str(params.weights.layout) not in kernel_size_map.keys():
294-
raise UnsupportedLayout(str(params.weights.layout))
295293
activation_map = {"clip": "CLIP"}
296294
weight_to_ohwi_transform_map = {"HWIO": [3, 0, 1, 2]}
297295
weights_values = params.weights.values
@@ -375,13 +373,9 @@ def callback(
375373
channels_map = {
376374
"NHWC": 3,
377375
}
378-
if str(params.ofm.layout) not in channels_map.keys():
379-
raise UnsupportedLayout(str(params.ofm.layout))
380376
kernel_shape_map = {
381377
"HWOI": params.weights.shape[0:2],
382378
}
383-
if str(params.weights.layout) not in kernel_shape_map.keys():
384-
raise UnsupportedLayout(str(params.weights.layout))
385379

386380
weights_values = params.weights.values
387381
weights_values_ohwi = np.moveaxis(weights_values, [0, 1, 2, 3], [1, 2, 0, 3])
@@ -470,8 +464,6 @@ def callback(
470464
channels_map = {
471465
"NHWC": 3,
472466
}
473-
if str(params.ofm.layout) not in channels_map.keys():
474-
raise UnsupportedLayout(str(params.ofm.layout))
475467

476468
activation_map = {"clip": "CLIP"}
477469
if params.activation:
@@ -632,11 +624,6 @@ def callback(
632624
params = self.params_class(post.op.body)
633625
params.ifm.tensor = post.args[1] if params.reversed_operands else post.args[0]
634626
params.ifm2.tensor = post.args[0] if params.reversed_operands else post.args[1]
635-
channels_map = {
636-
"NHWC": 3,
637-
}
638-
if str(params.ofm.layout) not in channels_map.keys():
639-
raise UnsupportedLayout(str(params.ofm.layout))
640627

641628
activation_map = {"clip": "CLIP"}
642629
if params.activation:
@@ -963,9 +950,6 @@ def callback(
963950
params = self.params_class(post.op.body)
964951
params.ifm.tensor = post.args[0]
965952

966-
if str(params.ofm.layout) != "NHWC":
967-
raise UnsupportedLayout(str(params.ofm.layout))
968-
969953
activation_map = {"clip": "CLIP"}
970954
if params.activation:
971955
activation = activation_map[params.activation.op.name]

0 commit comments

Comments
 (0)