Arm backend: Refactor Arm tester to inherit from test harness#18101
Arm backend: Refactor Arm tester to inherit from test harness#18101per wants to merge 1 commit intopytorch:mainfrom
Conversation
Move from inheriting from the XNNPack tester to the common test harness. Signed-off-by: Per Åstrand <per.astrand@arm.com> Change-Id: I68840d7a4c402083e6d93ac8a2bb5feadf057dca
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/18101
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 Awaiting Approval, 1 New Failure, 1 Cancelled Job, 1 PendingAs of commit 9d65477 with merge base 0112ada ( NEW FAILURE - The following job has failed:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
There was a problem hiding this comment.
Pull request overview
Refactors the Arm backend test infrastructure to use the common backend test harness (instead of inheriting from the XNNPack tester), aligning Arm’s stage implementations with the shared backends/test/harness pipeline.
Changes:
- Switched Arm tester stages (
Partition,ToEdgeTransformAndLower,ToExecutorch,RunPasses,Serialize) to inherit fromexecutorch.backends.test.harness.stages. - Updated ArmTester to register Arm-specific stage classes with the common harness
Tester. - Updated Arm tests and BUCK deps to reference the harness tester/stages instead of XNNPack’s tester.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| backends/arm/test/tester/serialize.py | Migrate Arm Serialize stage to inherit from common harness Serialize. |
| backends/arm/test/tester/arm_tester.py | Core refactor: ArmTester now builds on common harness Tester and stage implementations. |
| backends/arm/test/ops/test_where.py | Update test to use ArmQuantize instead of XNNPack Quantize stage. |
| backends/arm/test/misc/test_bn_relu_folding_qat.py | Switch Quantize import to the common harness tester. |
| backends/arm/test/BUCK | Update dependencies from XNNPack tester target to harness tester target. |
Comments suppressed due to low confidence (2)
backends/arm/test/tester/arm_tester.py:336
- The PR description still contains the template placeholders (e.g. "[PLEASE REMOVE]") and an empty test plan. Please clean these up so the description reflects the actual intent and testing for this change.
class ArmTester(tester.Tester):
def __init__(
self,
model: torch.nn.Module,
example_inputs: Tuple[Any, ...],
backends/arm/test/tester/arm_tester.py:489
- The
serialize()method exposes atimeoutparameter, but the constructedSerializestage is initialized withtimeout=self.timeoutinstead of the method argument, so per-call overrides are ignored. Use thetimeoutargument (or remove it from the signature if it’s intentionally not supported).
def serialize(
self,
serialize_stage: Optional[BaseStages.Serialize] = None,
# Keep timeout keyword-only so positional usage matches the base class.
*,
timeout: int = 480,
):
if serialize_stage is None:
serialize_stage = Serialize(
compile_spec=self.compile_spec,
module=self.original_module,
use_portable_ops=self.use_portable_ops,
timeout=self.timeout,
)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
| constant_methods: Optional[Dict[str, Any]] = None, | ||
| transform_passes: Optional[ | ||
| Union[Sequence[PassType], Dict[str, Sequence[PassType]]] | ||
| ] = None, | ||
| compile_spec: Optional[ArmCompileSpec] = None, | ||
| ): |
There was a problem hiding this comment.
ToEdgeTransformAndLower.__init__ takes a compile_spec parameter but never reads it, and the caller passes compile_spec=self.compile_spec. Either remove this parameter (and stop passing it) or use it to configure the stage so the argument isn’t misleading/dead.
Summary
Move from inheriting from the XNNPack tester to the common test harness instead.
Test plan
Tested through all CI tests.
cc @digantdesai @freddan80 @zingo @oscarandersson8218 @mansnils @Sebastian-Larsson @robell