aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Hall <tim.hall@arm.com>2020-10-27 12:43:14 +0000
committertim.hall <tim.hall@arm.com>2020-11-20 12:48:57 +0000
commitc8a73868d40cf63380f634baeb51aa7aa993fc0c (patch)
tree09ea718df7470068d060fb97d46dafd0878201c4
parentc7187434c11151a6a03f252c8718f3bf6445ef5b (diff)
downloadethos-u-vela-c8a73868d40cf63380f634baeb51aa7aa993fc0c.tar.gz
vela: Rename Yoda to Ethos-U65
- Also changed to use Ethos-U where appropriate Signed-off-by: Tim Hall <tim.hall@arm.com> Change-Id: Ie45ba2bb3935b305abe897b78b498681296cb7c1
-rw-r--r--ethosu/vela/architecture_features.py40
-rw-r--r--ethosu/vela/compiler_driver.py2
-rw-r--r--ethosu/vela/register_command_stream_generator.py12
-rw-r--r--ethosu/vela/shared_buffer_allocation.py2
-rw-r--r--ethosu/vela/test/extapi/test_extapi_encode_weights.py4
-rw-r--r--ethosu/vela/vela.py2
-rw-r--r--ethosu/vela/weight_compressor.py9
-rw-r--r--setup.py2
8 files changed, 37 insertions, 36 deletions
diff --git a/ethosu/vela/architecture_features.py b/ethosu/vela/architecture_features.py
index 1eae79a..9ca4304 100644
--- a/ethosu/vela/architecture_features.py
+++ b/ethosu/vela/architecture_features.py
@@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# Description:
-# Holds a container for Ethos-U55/System architecture parameters.
+# Holds a container for Ethos-U and System architecture parameters.
import enum
from collections import namedtuple
from configparser import ConfigParser
@@ -109,7 +109,7 @@ class SHRAMBlockConfig:
self.banks = banks
-# Area indices must match Ethos-U55 SHRAM layout spec
+# Area indices must match Ethos-U SHRAM layout spec
class SharedBufferArea(enum.IntEnum):
OFM = 0
Weights = 1
@@ -123,8 +123,8 @@ class Accelerator(enum.Enum):
Ethos_U55_64 = "ethos-u55-64"
Ethos_U55_128 = "ethos-u55-128"
Ethos_U55_256 = "ethos-u55-256"
- Yoda_256 = "yoda-256"
- Yoda_512 = "yoda-512"
+ Ethos_U65_256 = "ethos-u65-256"
+ Ethos_U65_512 = "ethos-u65-512"
@classmethod
def member_list(cls):
@@ -132,13 +132,13 @@ class Accelerator(enum.Enum):
class ArchitectureFeatures:
- """This class is a container for various parameters of the Ethos-U55 core
+ """This class is a container for various parameters of the Ethos-U core
and system configuration that can be tuned, either by command line
- parameters or by the Ethos-U55 architects. The class is often passed
+ parameters or by the Ethos-U architects. The class is often passed
around to passes that need to do architecture-dependent actions.
Note the difference between ArchitectureFeatures and CompilerOptions
- - ArchitectureFeatures is for changing the Ethos-U55 and system architecture
+ - ArchitectureFeatures is for changing the Ethos-U and system architecture
- CompilerOptions is for changing the behaviour of the compiler
"""
@@ -146,10 +146,10 @@ class ArchitectureFeatures:
"ArchitectureConfig", "macs cores ofm_ublock ifm_ublock shram_banks shram_granules elem_units"
)
accelerator_configs = {
- Accelerator.Yoda_512: ArchitectureConfig(
+ Accelerator.Ethos_U65_512: ArchitectureConfig(
256, 2, Block(2, 2, 8), Block(2, 2, 8), 48, [8, 8, 8, 8, 16, 8, 16, 20], 8
),
- Accelerator.Yoda_256: ArchitectureConfig(
+ Accelerator.Ethos_U65_256: ArchitectureConfig(
256, 1, Block(2, 2, 8), Block(2, 2, 8), 48, [8, 8, 8, 8, 16, 8, 16, 20], 8
),
Accelerator.Ethos_U55_256: ArchitectureConfig(
@@ -189,9 +189,9 @@ class ArchitectureFeatures:
self.config = accel_config
self.system_config = system_config
- self.is_yoda_system = self.accelerator_config in (Accelerator.Yoda_256, Accelerator.Yoda_512)
+ self.is_ethos_u65_system = self.accelerator_config in (Accelerator.Ethos_U65_256, Accelerator.Ethos_U65_512)
- self.max_outstanding_dma = 2 if self.is_yoda_system else 1
+ self.max_outstanding_dma = 2 if self.is_ethos_u65_system else 1
self.max_outstanding_kernels = 3
self.ncores = accel_config.cores
@@ -224,7 +224,7 @@ class ArchitectureFeatures:
self.memory_port_widths = np.zeros(MemArea.Size)
# Get system configuration
- self.__read_sys_config(self.is_yoda_system)
+ self.__read_sys_config(self.is_ethos_u65_system)
# apply the global memory clock scales to the individual ones from the system config
for mem in MemArea.all():
@@ -303,7 +303,7 @@ class ArchitectureFeatures:
self.cycles_weight = 40
self.max_sram_used_weight = 1000
- if self.is_yoda_system and (self.fast_storage_mem_area != self.feature_map_storage_mem_area):
+ if self.is_ethos_u65_system and (self.fast_storage_mem_area != self.feature_map_storage_mem_area):
self.max_sram_used_weight = 0
# Shared Buffer Block allocations
@@ -383,11 +383,11 @@ class ArchitectureFeatures:
elif accel_config == Accelerator.Ethos_U55_128:
self.output_cycles_per_elem = (0.75, 1.25, 0.75, 0.75, 1.0, 1.5, 0.25, 0.5)
self.activation_cycles_per_elem = (1.0, 0.5, 0.0)
- elif accel_config in (Accelerator.Ethos_U55_256, Accelerator.Yoda_256):
+ elif accel_config in (Accelerator.Ethos_U55_256, Accelerator.Ethos_U65_256):
self.output_cycles_per_elem = (0.625, 1.125, 0.5, 0.375, 0.5, 0.75, 0.125, 0.25)
self.activation_cycles_per_elem = (1.0, 0.25, 0.0)
else:
- assert accel_config == Accelerator.Yoda_512
+ assert accel_config == Accelerator.Ethos_U65_512
self.output_cycles_per_elem = (0.3125, 0.5625, 0.25, 0.1875, 0.25, 0.375, 0.0625, 0.125)
self.activation_cycles_per_elem = (0.5, 0.125, 0.0)
@@ -607,7 +607,7 @@ class ArchitectureFeatures:
print("Warning: No configured CPU performance estimate for", op.type)
return 0
- def __read_sys_config(self, is_yoda_system):
+ def __read_sys_config(self, is_ethos_u65_system):
"""
Gets the system configuration with the given name from the vela configuration file
Example configuration snippet:
@@ -646,20 +646,20 @@ class ArchitectureFeatures:
self.feature_map_storage_mem_area = MemArea[self.__sys_config("feature_map_storage_mem_area", "Sram")]
self.permanent_storage_mem_area = MemArea[self.__sys_config("permanent_storage_mem_area", "OffChipFlash")]
- if is_yoda_system:
+ if is_ethos_u65_system:
if self.permanent_storage_mem_area is not MemArea.Dram:
raise Exception(
"Invalid permanent_storage_mem_area = "
+ str(self.permanent_storage_mem_area)
- + " (must be 'DRAM' for Yoda)."
+ + " (must be 'DRAM' for Ethos-U65)."
)
else:
if self.permanent_storage_mem_area not in set((MemArea.OnChipFlash, MemArea.OffChipFlash)):
raise Exception(
"Invalid permanent_storage_mem_area = "
+ str(self.permanent_storage_mem_area)
- + " (must be 'OnChipFlash' or 'OffChipFlash' for ethosu-55)."
- " To store the weights and other constant data in SRAM on ethosu-55 select 'OnChipFlash'"
+ + " (must be 'OnChipFlash' or 'OffChipFlash' for Ethos-U55)."
+ " To store the weights and other constant data in SRAM on Ethos-U55 select 'OnChipFlash'"
)
self.sram_size = 1024 * int(self.__sys_config("sram_size_kb", "204800"))
diff --git a/ethosu/vela/compiler_driver.py b/ethosu/vela/compiler_driver.py
index 32eef30..9e1cb3a 100644
--- a/ethosu/vela/compiler_driver.py
+++ b/ethosu/vela/compiler_driver.py
@@ -46,7 +46,7 @@ class CompilerOptions:
"""Set of options to change compiler behaviour - verbosity, targets, turning off passes.
Note the difference between ArchitectureFeatures and CompilerOptions
-- ArchitectureFeatures is for changing the Ethos-U55 and system architecture
+- ArchitectureFeatures is for changing the Ethos-U and system architecture
- CompilerOptions is for changing the behaviour of the compiler
"""
diff --git a/ethosu/vela/register_command_stream_generator.py b/ethosu/vela/register_command_stream_generator.py
index 30b5e04..dd63d2e 100644
--- a/ethosu/vela/register_command_stream_generator.py
+++ b/ethosu/vela/register_command_stream_generator.py
@@ -14,9 +14,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# Description:
-# Register level (low-level) command stream generation for Ethos-U55. Takes a list of NPU operations and generates
+# Register level (low-level) command stream generation for Ethos-U. Takes a list of NPU operations and generates
# all the register settings. Calculates dependencies between commands and inserts wait operations. And generates a bit
-# stream suitable for interpretation by the Ethos-U55 processor.
+# stream suitable for interpretation by the Ethos-U processor.
from collections import defaultdict
from collections import namedtuple
from enum import Enum
@@ -1210,7 +1210,7 @@ def generate_command_stream(
memory_accesses[npu_op] = get_dma_memory_accesses(npu_op)
else:
memory_accesses[npu_op] = get_op_memory_accesses(npu_op, arch)
- if arch.is_yoda_system:
+ if arch.is_ethos_u65_system:
emit.cmd0_with_param(cmd0.NPU_SET_PARALLEL_MODE, arch.ncores - 1)
dep_watermark = Watermark(0, 0)
prev_op = None
@@ -1272,12 +1272,12 @@ def generate_register_command_stream_for_sg(nng, sg, arch, verbose=False):
def generate_register_command_stream(npu_op_list: List[NpuOperation], accelerator: Accelerator) -> List[int]:
"""
- Public facing API for generating an ethosu register command stream.
+ Public facing API for generating an Ethos-U register command stream.
Calculates dependencies between commands and inserts wait operations if needed.
:param npu_op_list: List[NpuOperation] list of high level NPU operations
- :param accelerator: architecture_features.Accelerator enum to pick the correct ethosu accelerator
- :return ethosu instructions, as a list of 32-bit integers
+ :param accelerator: architecture_features.Accelerator enum to pick the correct Ethos-U accelerator
+ :return Ethos-U instructions, as a list of 32-bit integers
"""
emit = CommandStreamEmitter()
arch = ArchitectureFeatures(
diff --git a/ethosu/vela/shared_buffer_allocation.py b/ethosu/vela/shared_buffer_allocation.py
index c957be8..ee55962 100644
--- a/ethosu/vela/shared_buffer_allocation.py
+++ b/ethosu/vela/shared_buffer_allocation.py
@@ -14,7 +14,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# Description:
-# Shared buffer allocation works out how to allocate the Ethos-U55 shared buffer for a given pass.
+# Shared buffer allocation works out how to allocate the Ethos-U shared buffer for a given pass.
from typing import List
from typing import Tuple
diff --git a/ethosu/vela/test/extapi/test_extapi_encode_weights.py b/ethosu/vela/test/extapi/test_extapi_encode_weights.py
index 0459cae..854d14c 100644
--- a/ethosu/vela/test/extapi/test_extapi_encode_weights.py
+++ b/ethosu/vela/test/extapi/test_extapi_encode_weights.py
@@ -30,8 +30,8 @@ from ethosu.vela.architecture_features import Accelerator
Accelerator.Ethos_U55_64,
Accelerator.Ethos_U55_128,
Accelerator.Ethos_U55_256,
- Accelerator.Yoda_256,
- Accelerator.Yoda_512,
+ Accelerator.Ethos_U65_256,
+ Accelerator.Ethos_U65_512,
],
)
@pytest.mark.parametrize("dilation_x", [1, 2])
diff --git a/ethosu/vela/vela.py b/ethosu/vela/vela.py
index 9f5c78c..6835607 100644
--- a/ethosu/vela/vela.py
+++ b/ethosu/vela/vela.py
@@ -188,7 +188,7 @@ def main(args=None):
if args is None:
args = sys.argv[1:]
- parser = argparse.ArgumentParser(prog="vela", description="Neural network model compiler for Ethos-U55")
+ parser = argparse.ArgumentParser(prog="vela", description="Neural network model compiler for Ethos-U")
parser.add_argument("--version", action="version", version=__version__)
parser.add_argument(
"--api-version", action="version", version=api_version, help="Displays the version of the external API."
diff --git a/ethosu/vela/weight_compressor.py b/ethosu/vela/weight_compressor.py
index c07229f..0eab185 100644
--- a/ethosu/vela/weight_compressor.py
+++ b/ethosu/vela/weight_compressor.py
@@ -57,13 +57,13 @@ def encode_weights(
block_traversal: NpuBlockTraversal,
):
"""
- Public facing API to use the ethosu weight encoding.
+ Public facing API to use the Ethos-U weight encoding.
- :param accelerator: architecture_features.Accelerator enum to pick the correct ethosu accelerator
+ :param accelerator: architecture_features.Accelerator enum to pick the correct Ethos-U accelerator
:param weights_volume: numpy.ndarray in OHWI layout with a shape of four
:param dilation_xy: a two element tuple of dilation attributes in x,y dimension
:param ifm_bitdepth: the bitdepth of input feature map
- :param ofm_block_depth: the depth of blocks for ethosu processing
+ :param ofm_block_depth: the depth of blocks for Ethos-U processing
:param is_depthwise: a boolean indicating these weights are used for a depthwise traversal
:param block_traversal: indicates how these weights are traversed on sub-kernal basis
:return: a bytearray of compressed weights
@@ -108,7 +108,8 @@ def encode_weights(
def encode_bias(bias: np.int64, scale: int, shift: int):
"""
- Public facing API to pack bias and scale values as required by the hardware
+ Public facing API to pack bias and scale values as required by the Ethos-U
+
:param bias: 64bit signed number that includes 40bit signed bias
:param scale: 32bit scale value
:param shift: 6bit shift value
diff --git a/setup.py b/setup.py
index cc30636..1ab8dd5 100644
--- a/setup.py
+++ b/setup.py
@@ -34,7 +34,7 @@ mlw_module = Extension(
setup(
name="ethos-u-vela",
use_scm_version=True,
- description="Optimise TensorFlow Lite models for Ethos-U55 NPU.",
+ description="Optimise TensorFlow Lite models for Ethos-U NPU.",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://git.mlplatform.org/ml/ethos-u/ethos-u-vela.git/",