Skip to content

Commit 4479bc9

Browse files
committed
Update on "[ET-VK] Replace Uniform buffers with push constants for binary op"
This diff replaces uniform buffers with push constants for binary op in the Vulkan backend of Executorch. The changes include updating the GLSL code to use push constants instead of uniform buffers and updating the C++ code to pass the sizes as push constants to the shader. Differential Revision: [D66853542](https://our.internmc.facebook.com/intern/diff/D66853542/) [ghstack-poisoned]
2 parents 70e2d1a + c55c794 commit 4479bc9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+155
-154
lines changed

backends/arm/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ The Arm Backend should be considered a prototype quality at this point, likely s
104104
## Current flows
105105

106106
The ArmBackend has a two stage process,
107-
- Compile to TOSA to rationalise the graph into known hardware support profiles. Currently this is to v0.80.0 TOSA BI with specific concern to a subset which gives support on Ethos-U55, the target of the initial prototype efforts.
108-
- Lower via the ethos-u-vela compilation flow which takes TOSA v0.80.0 as an input and produces a low level commandstream for the hardware which is then passed via the delegate to the ethos-u-core-driver for direct execution.
107+
- Compile to TOSA to rationalise the graph into known hardware support profiles. Currently this is to v0.80 TOSA BI with specific concern to a subset which gives support on Ethos-U55, the target of the initial prototype efforts.
108+
- Lower via the ethos-u-vela compilation flow which takes TOSA v0.80 as an input and produces a low level commandstream for the hardware which is then passed via the delegate to the ethos-u-core-driver for direct execution.
109109

110110
The ArmPartitioner is currenly used to ensure the operations converted are Ethos-U compatible, but will be extended to offer spec-correct TOSA Base inference and TOSA Main Inference generation in future.
111111

backends/arm/arm_backend.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def ethosu_compile_spec(
9090
if extra_flags is not None:
9191
self.compiler_flags.append(extra_flags)
9292

93-
base_tosa_version = "TOSA-0.80.0+BI"
93+
base_tosa_version = "TOSA-0.80+BI"
9494
if "u55" in config:
9595
# Add the Ethos-U55 extension marker
9696
base_tosa_version += "+u55"

backends/arm/operator_support/right_shift_support.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ class RightShiftSupported(SupportedTOSAOperatorCheck):
2323
targets = [exir_ops.edge.aten.__rshift__.Scalar]
2424

2525
tosa_specs = [
26-
TosaSpecification.create_from_string("TOSA-0.80.0+BI"),
27-
TosaSpecification.create_from_string("TOSA-0.80.0+MI"),
26+
TosaSpecification.create_from_string("TOSA-0.80+BI"),
27+
TosaSpecification.create_from_string("TOSA-0.80+MI"),
2828
]
2929

3030
def is_node_supported(self, node: fx.Node, tosa_spec: TosaSpecification):

backends/arm/operator_support/to_copy_support.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ class ToCopySupported(SupportedTOSAOperatorCheck):
2525
targets = [exir_ops.edge.aten._to_copy.default]
2626

2727
tosa_specs = [
28-
TosaSpecification.create_from_string("TOSA-0.80.0+BI"),
29-
TosaSpecification.create_from_string("TOSA-0.80.0+MI"),
28+
TosaSpecification.create_from_string("TOSA-0.80+BI"),
29+
TosaSpecification.create_from_string("TOSA-0.80+MI"),
3030
]
3131

3232
SupportedTypeDict = dict[torch.dtype, list[torch.dtype]]

backends/arm/operator_support/tosa_supported_operators.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ def is_node_supported(self, node: fx.Node, tosa_spec: TosaSpecification) -> bool
3535
_tosa_spec_dicts: dict[
3636
TosaSpecification, dict[str, Type[SupportedTOSAOperatorCheck]]
3737
] = {
38-
TosaSpecification.create_from_string("TOSA-0.80.0+BI"): {},
39-
TosaSpecification.create_from_string("TOSA-0.80.0+MI"): {},
38+
TosaSpecification.create_from_string("TOSA-0.80+BI"): {},
39+
TosaSpecification.create_from_string("TOSA-0.80+MI"): {},
4040
}
4141

4242

backends/arm/operators/node_visitor.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ class NodeVisitor:
2525
# When all node_visitors has been refactored to target a specific
2626
# version, this list should be removed.
2727
tosa_specs = [
28-
TosaSpecification.create_from_string("TOSA-0.80.0+BI"),
29-
TosaSpecification.create_from_string("TOSA-0.80.0+MI"),
28+
TosaSpecification.create_from_string("TOSA-0.80+BI"),
29+
TosaSpecification.create_from_string("TOSA-0.80+MI"),
3030
]
3131

3232
def __init__(self, exported_program: ExportedProgram, tosa_spec: TosaSpecification):
@@ -46,8 +46,8 @@ def define_node(
4646

4747
# container for all node visitors
4848
_node_visitor_dicts = {
49-
TosaSpecification.create_from_string("TOSA-0.80.0+BI"): {},
50-
TosaSpecification.create_from_string("TOSA-0.80.0+MI"): {},
49+
TosaSpecification.create_from_string("TOSA-0.80+BI"): {},
50+
TosaSpecification.create_from_string("TOSA-0.80+MI"): {},
5151
}
5252

5353

backends/arm/operators/op_add.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class AddVisitor_080_BI(NodeVisitor):
2626
target = "aten.add.Tensor"
2727

2828
tosa_specs = [
29-
TosaSpecification.create_from_string("TOSA-0.80.0+BI"),
29+
TosaSpecification.create_from_string("TOSA-0.80+BI"),
3030
]
3131

3232
def __init__(self, *args):
@@ -40,7 +40,7 @@ def define_node(
4040
output: TosaArg,
4141
is_quant_node: bool,
4242
) -> None:
43-
# Specification (0.80.0) states that input and output types
43+
# Specification (0.80) states that input and output types
4444
# should all be the same
4545
assert inputs[0].dtype == inputs[1].dtype == output.dtype
4646
# Handle int8 (quantized) and int32
@@ -84,7 +84,7 @@ class AddVisitor_080_MI(AddVisitor_080_BI):
8484
# inheriting 'target' from BI class
8585

8686
tosa_specs = [
87-
TosaSpecification.create_from_string("TOSA-0.80.0+MI"),
87+
TosaSpecification.create_from_string("TOSA-0.80+MI"),
8888
]
8989

9090
def __init__(self, *args):
@@ -98,7 +98,7 @@ def define_node(
9898
output: TosaArg,
9999
is_quant_node: bool,
100100
) -> None:
101-
# Specification (0.80.0) states that input and output types
101+
# Specification (0.80) states that input and output types
102102
# should all be the same
103103
assert inputs[0].dtype == inputs[1].dtype == output.dtype
104104

backends/arm/operators/op_avg_pool2d.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class AvgPool2dVisitor_0_80_BI(NodeVisitor):
2525
target = "aten.avg_pool2d.default"
2626

2727
tosa_specs = [
28-
TosaSpecification.create_from_string("TOSA-0.80.0+BI"),
28+
TosaSpecification.create_from_string("TOSA-0.80+BI"),
2929
]
3030

3131
def __init__(self, *args):
@@ -96,7 +96,7 @@ class AvgPool2dVisitor_0_80_MI(AvgPool2dVisitor_0_80_BI):
9696
# inheriting 'target' from BI class
9797

9898
tosa_specs = [
99-
TosaSpecification.create_from_string("TOSA-0.80.0+MI"),
99+
TosaSpecification.create_from_string("TOSA-0.80+MI"),
100100
]
101101

102102
def define_node(

backends/arm/operators/op_batch_norm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class BatchNormVisitor(NodeVisitor):
2323
target = "aten._native_batch_norm_legit_no_training.default"
2424

2525
tosa_specs = [
26-
TosaSpecification.create_from_string("TOSA-0.80.0+MI"),
26+
TosaSpecification.create_from_string("TOSA-0.80+MI"),
2727
]
2828

2929
def __init__(self, *args):

backends/arm/operators/op_div.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class DivVisitor(NodeVisitor):
2424

2525
# Only supported for MI
2626
tosa_specs = [
27-
TosaSpecification.create_from_string("TOSA-0.80.0+MI"),
27+
TosaSpecification.create_from_string("TOSA-0.80+MI"),
2828
]
2929

3030
def __init__(self, *args):

0 commit comments

Comments
 (0)