|
65 | 65 |
|
66 | 66 | from executorch.backends.arm.vgf_partitioner import VgfPartitioner |
67 | 67 |
|
| 68 | +from executorch.backends.test.harness.error_statistics import ErrorStatistics |
68 | 69 | from executorch.backends.test.harness.stages import Stage, StageType |
69 | 70 | from executorch.backends.xnnpack.test.tester import Tester |
70 | 71 | from executorch.devtools.backend_debug import get_delegation_info |
@@ -379,6 +380,7 @@ def to_edge_transform_and_lower( |
379 | 380 | transform_passes: Optional[ |
380 | 381 | Union[Sequence[PassType], Dict[str, Sequence[PassType]]] |
381 | 382 | ] = None, |
| 383 | + generate_etrecord: bool = False, |
382 | 384 | ): |
383 | 385 | if to_edge_and_lower_stage is None: |
384 | 386 | if partitioners is None: |
@@ -412,7 +414,9 @@ def to_edge_transform_and_lower( |
412 | 414 | to_edge_and_lower_stage.partitioners = partitioners |
413 | 415 | if edge_compile_config is not None: |
414 | 416 | to_edge_and_lower_stage.edge_compile_conf = edge_compile_config |
415 | | - return super().to_edge_transform_and_lower(to_edge_and_lower_stage) |
| 417 | + return super().to_edge_transform_and_lower( |
| 418 | + to_edge_and_lower_stage, generate_etrecord=generate_etrecord |
| 419 | + ) |
416 | 420 |
|
417 | 421 | def to_executorch(self, to_executorch_stage: Optional[ToExecutorch] | None = None): |
418 | 422 | if to_executorch_stage is None: |
@@ -443,6 +447,7 @@ def run_method_and_compare_outputs( |
443 | 447 | qtol=0, |
444 | 448 | error_callbacks=None, |
445 | 449 | run_eager_mode=False, |
| 450 | + statistics_callback: Callable[[ErrorStatistics], None] | None = None, |
446 | 451 | ): |
447 | 452 | """ |
448 | 453 | Compares the run_artifact output of 'stage' with the output of a reference stage. |
@@ -698,10 +703,17 @@ def _compare_outputs( |
698 | 703 | rtol=1e-03, |
699 | 704 | qtol=0, |
700 | 705 | error_callbacks=None, |
| 706 | + statistics_callback: Callable[[ErrorStatistics], None] | None = None, |
701 | 707 | ): |
702 | 708 | try: |
703 | 709 | super()._compare_outputs( |
704 | | - reference_output, stage_output, quantization_scale, atol, rtol, qtol |
| 710 | + reference_output, |
| 711 | + stage_output, |
| 712 | + quantization_scale, |
| 713 | + atol, |
| 714 | + rtol, |
| 715 | + qtol, |
| 716 | + statistics_callback=statistics_callback, |
705 | 717 | ) |
706 | 718 | except AssertionError as e: |
707 | 719 | if error_callbacks is None: |
|
0 commit comments