diff --git a/backends/arm/common/arm_compile_spec.py b/backends/arm/common/arm_compile_spec.py index dda2930b306..a3267ca58dc 100644 --- a/backends/arm/common/arm_compile_spec.py +++ b/backends/arm/common/arm_compile_spec.py @@ -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. @@ -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: @@ -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 diff --git a/backends/arm/ethosu/compile_spec.py b/backends/arm/ethosu/compile_spec.py index 1d311cbf74c..ba09ae2fd45 100644 --- a/backends/arm/ethosu/compile_spec.py +++ b/backends/arm/ethosu/compile_spec.py @@ -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" @@ -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: diff --git a/backends/arm/scripts/docgen/vgf/backends-arm-vgf-overview.md.in b/backends/arm/scripts/docgen/vgf/backends-arm-vgf-overview.md.in index d21e5e4405b..dbebaf0d7ce 100644 --- a/backends/arm/scripts/docgen/vgf/backends-arm-vgf-overview.md.in +++ b/backends/arm/scripts/docgen/vgf/backends-arm-vgf-overview.md.in @@ -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). ## Runtime Integration diff --git a/backends/arm/scripts/pre-push b/backends/arm/scripts/pre-push index 30aee52551f..048e2b93f49 100755 --- a/backends/arm/scripts/pre-push +++ b/backends/arm/scripts/pre-push @@ -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}"\ diff --git a/backends/arm/tosa/compile_spec.py b/backends/arm/tosa/compile_spec.py index 5cd72ce04b3..12f92280f6b 100644 --- a/backends/arm/tosa/compile_spec.py +++ b/backends/arm/tosa/compile_spec.py @@ -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. @@ -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, []) diff --git a/backends/arm/vgf/compile_spec.py b/backends/arm/vgf/compile_spec.py index b5b13f59939..ea3cc088e33 100644 --- a/backends/arm/vgf/compile_spec.py +++ b/backends/arm/vgf/compile_spec.py @@ -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. @@ -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):