Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion backends/arm/common/arm_compile_spec.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2023-2025 Arm Limited and/or its affiliates.
# Copyright 2023-2026 Arm Limited and/or its affiliates.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
Expand Down Expand Up @@ -221,6 +221,13 @@ def get_pass_pipeline_config(self) -> ArmPassPipelineConfig:
return self._pipeline_config

def set_pass_pipeline_config(self, config: ArmPassPipelineConfig) -> None:
"""
Sets the configuration that controls how the Arm pass pipeline should behave.
Subclasses may override to tweak defaults for specific targets.

Args:
config: The custom ArmPassPipelineConfig to set.
"""
self._pipeline_config = config

def _create_default_pipeline_config(self) -> ArmPassPipelineConfig:
Expand Down Expand Up @@ -259,10 +266,19 @@ def dump_debug_info(self, debug_mode: DebugMode | None):
return self

def set_output_order_workaround(self, output_order_workaround: bool):
"""
Sets whether to apply the output order workaround.

Args:
output_order_workaround: Boolean indicating whether to apply the workaround.
"""
self.output_order_workaround = output_order_workaround
return self

def get_output_order_workaround(self) -> bool:
"""
Gets whether the output order workaround is being applied.
"""
return self.output_order_workaround

@classmethod
Expand Down
30 changes: 14 additions & 16 deletions backends/arm/ethosu/compile_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,20 @@


class EthosUCompileSpec(ArmCompileSpec):
"""Compile specification for Ethos-U NPU targets."""
"""Normalise Ethos-U compile configuration and compiler flags.

Args:
target (str): Ethos-U accelerator configuration (for example,
``"ethos-u55-128"``).
system_config (str | None): System configuration name from the Vela
config file. Defaults based on ``target`` when omitted.
memory_mode (str | None): Memory mode selection from the Vela config
file. Defaults based on ``target`` when omitted.
extra_flags (list[str] | None): Additional command-line flags for
Vela.
config_ini (str | None): Path to a Vela .ini configuration file.
Defaults to ``"Arm/vela.ini"``.
"""

_TARGET_KEY = "target"

Expand All @@ -26,21 +39,6 @@ def __init__(
extra_flags: list[str] | None = None,
config_ini: str | None = "Arm/vela.ini",
):
"""Normalise Ethos-U compile configuration and compiler flags.

Args:
target (str): Ethos-U accelerator configuration (for example,
``"ethos-u55-128"``).
system_config (str | None): System configuration name from the Vela
config file. Defaults based on ``target`` when omitted.
memory_mode (str | None): Memory mode selection from the Vela config
file. Defaults based on ``target`` when omitted.
extra_flags (list[str] | None): Additional command-line flags for
Vela.
config_ini (str | None): Path to a Vela .ini configuration file.
Defaults to ``"Arm/vela.ini"``.

"""
self.target = target
# Set vela compiler flags
if config_ini is None:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ See [Partitioner API](arm-vgf-partitioner.md) for more information of the Partit
The VGF quantizer supports [Post Training Quantization (PT2E)](https://docs.pytorch.org/ao/main/tutorials_source/pt2e_quant_ptq.html)
and [Quantization-Aware Training (QAT)](https://docs.pytorch.org/ao/main/tutorials_source/pt2e_quant_qat.html).

Partial quantization is supported, allowing users to quantize only specific parts of the model while leaving others in floating-point.

For more information on quantization, see [Quantization](arm-vgf-quantization.md). <!-- @lint-ignore -->

## Runtime Integration
Expand Down
6 changes: 6 additions & 0 deletions backends/arm/scripts/pre-push
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,12 @@ for COMMIT in ${COMMITS}; do
current_year=$(date +%Y)
failed_license_check=false
for commited_file in $commit_files; do
# Skip files with certain extensions
if [[ "$commited_file" == *.md || "$commited_file" == *.md.in ]]; then
echo -e "${INFO} Skipping license check for ${commited_file} (excluded extension)"
continue
fi

file_header=$(head "$commited_file")
if ! echo "$file_header" | grep -qi "Arm"; then
echo -e "${WARNING} No Arm copyright header in ${commited_file}"\
Expand Down
16 changes: 7 additions & 9 deletions backends/arm/tosa/compile_spec.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2025 Arm Limited and/or its affiliates.
# Copyright 2025-2026 Arm Limited and/or its affiliates.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
Expand All @@ -11,16 +11,14 @@


class TosaCompileSpec(ArmCompileSpec):
"""Arm-specific compile spec capturing TOSA serializer requirements."""
"""Normalize and store the provided TOSA specification.

def __init__(self, tosa_spec: TosaSpecification | str):
"""Normalize and store the provided TOSA specification.

Args:
tosa_spec (TosaSpecification | str): Target spec object or version
string supported by :meth:`TosaSpecification.create_from_string`.
Args:
tosa_spec (TosaSpecification | str): Target spec object or version
string supported by ``TosaSpecification.create_from_string``.
"""

"""
def __init__(self, tosa_spec: TosaSpecification | str):
if isinstance(tosa_spec, str):
tosa_spec = TosaSpecification.create_from_string(tosa_spec)
self._set_compile_specs(tosa_spec, [])
Expand Down
20 changes: 9 additions & 11 deletions backends/arm/vgf/compile_spec.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2025 Arm Limited and/or its affiliates.
# Copyright 2025-2026 Arm Limited and/or its affiliates.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
Expand All @@ -18,22 +18,20 @@


class VgfCompileSpec(ArmCompileSpec):
"""Compile specification for VGF-compatible targets."""
"""Normalise inputs and populate the underlying Arm compile spec.

Args:
tosa_spec (TosaSpecification | str | None): TOSA specification to
target. Strings are parsed via ``TosaSpecification.create_from_string``.
Defaults to ``"TOSA-1.0+FP+INT"``.
compiler_flags (list[str] | None): Optional converter-backend flags.
"""

def __init__(
self,
tosa_spec: TosaSpecification | str | None = None,
compiler_flags: list[str] | None = None,
):
"""Normalise inputs and populate the underlying Arm compile spec.

Args:
tosa_spec (TosaSpecification | str | None): TOSA specification to
target. Strings are parsed via
:meth:`TosaSpecification.create_from_string`. Defaults to
``"TOSA-1.0+FP+INT"``.
compiler_flags (list[str] | None): Optional converter-backend flags.
"""
if tosa_spec is None:
tosa_spec = TosaSpecification.create_from_string("TOSA-1.0+FP+INT")
elif isinstance(tosa_spec, str):
Expand Down
Loading