|
57 | 57 |
|
58 | 58 | from executorch.backends.arm.vgf import VgfCompileSpec, VgfPartitioner |
59 | 59 |
|
| 60 | +from executorch.backends.test.harness.error_statistics import ErrorStatistics |
60 | 61 | from executorch.backends.test.harness.stages import Stage, StageType |
61 | 62 | from executorch.backends.xnnpack.test.tester import Tester |
62 | 63 | from executorch.devtools.backend_debug import get_delegation_info |
@@ -333,6 +334,7 @@ def to_edge_transform_and_lower( |
333 | 334 | transform_passes: Optional[ |
334 | 335 | Union[Sequence[PassType], Dict[str, Sequence[PassType]]] |
335 | 336 | ] = None, |
| 337 | + generate_etrecord: bool = False, |
336 | 338 | ): |
337 | 339 | if transform_passes is not None: |
338 | 340 | raise RuntimeError( |
@@ -367,7 +369,9 @@ def to_edge_transform_and_lower( |
367 | 369 | to_edge_and_lower_stage.partitioners = partitioners |
368 | 370 | if edge_compile_config is not None: |
369 | 371 | to_edge_and_lower_stage.edge_compile_conf = edge_compile_config |
370 | | - return super().to_edge_transform_and_lower(to_edge_and_lower_stage) |
| 372 | + return super().to_edge_transform_and_lower( |
| 373 | + to_edge_and_lower_stage, generate_etrecord=generate_etrecord |
| 374 | + ) |
371 | 375 |
|
372 | 376 | def to_executorch(self, to_executorch_stage: Optional[ToExecutorch] | None = None): |
373 | 377 | if to_executorch_stage is None: |
@@ -402,6 +406,7 @@ def run_method_and_compare_outputs( |
402 | 406 | qtol=0, |
403 | 407 | error_callbacks=None, |
404 | 408 | run_eager_mode=False, |
| 409 | + statistics_callback: Callable[[ErrorStatistics], None] | None = None, |
405 | 410 | ): |
406 | 411 | """ |
407 | 412 | Compares the run_artifact output of 'stage' with the output of a reference stage. |
@@ -657,10 +662,17 @@ def _compare_outputs( |
657 | 662 | rtol=1e-03, |
658 | 663 | qtol=0, |
659 | 664 | error_callbacks=None, |
| 665 | + statistics_callback: Callable[[ErrorStatistics], None] | None = None, |
660 | 666 | ): |
661 | 667 | try: |
662 | 668 | super()._compare_outputs( |
663 | | - reference_output, stage_output, quantization_scale, atol, rtol, qtol |
| 669 | + reference_output, |
| 670 | + stage_output, |
| 671 | + quantization_scale, |
| 672 | + atol, |
| 673 | + rtol, |
| 674 | + qtol, |
| 675 | + statistics_callback=statistics_callback, |
664 | 676 | ) |
665 | 677 | except AssertionError as e: |
666 | 678 | if error_callbacks is None: |
|
0 commit comments