|
60 | 60 |
|
61 | 61 | from executorch.backends.arm.vgf import VgfCompileSpec, VgfPartitioner |
62 | 62 |
|
| 63 | +from executorch.backends.test.harness.error_statistics import ErrorStatistics |
63 | 64 | from executorch.backends.test.harness.stages import Stage, StageType |
64 | 65 | from executorch.backends.xnnpack.test.tester import Tester |
65 | 66 | from executorch.devtools.backend_debug import get_delegation_info |
@@ -374,6 +375,7 @@ def to_edge_transform_and_lower( |
374 | 375 | transform_passes: Optional[ |
375 | 376 | Union[Sequence[PassType], Dict[str, Sequence[PassType]]] |
376 | 377 | ] = None, |
| 378 | + generate_etrecord: bool = False, |
377 | 379 | ): |
378 | 380 | if transform_passes is not None: |
379 | 381 | raise RuntimeError( |
@@ -408,7 +410,9 @@ def to_edge_transform_and_lower( |
408 | 410 | to_edge_and_lower_stage.partitioners = partitioners |
409 | 411 | if edge_compile_config is not None: |
410 | 412 | to_edge_and_lower_stage.edge_compile_conf = edge_compile_config |
411 | | - return super().to_edge_transform_and_lower(to_edge_and_lower_stage) |
| 413 | + return super().to_edge_transform_and_lower( |
| 414 | + to_edge_and_lower_stage, generate_etrecord=generate_etrecord |
| 415 | + ) |
412 | 416 |
|
413 | 417 | def to_executorch(self, to_executorch_stage: Optional[ToExecutorch] | None = None): |
414 | 418 | if to_executorch_stage is None: |
@@ -439,6 +443,7 @@ def run_method_and_compare_outputs( |
439 | 443 | qtol=0, |
440 | 444 | error_callbacks=None, |
441 | 445 | run_eager_mode=False, |
| 446 | + statistics_callback: Callable[[ErrorStatistics], None] | None = None, |
442 | 447 | ): |
443 | 448 | """ |
444 | 449 | Compares the run_artifact output of 'stage' with the output of a reference stage. |
@@ -694,10 +699,17 @@ def _compare_outputs( |
694 | 699 | rtol=1e-03, |
695 | 700 | qtol=0, |
696 | 701 | error_callbacks=None, |
| 702 | + statistics_callback: Callable[[ErrorStatistics], None] | None = None, |
697 | 703 | ): |
698 | 704 | try: |
699 | 705 | super()._compare_outputs( |
700 | | - reference_output, stage_output, quantization_scale, atol, rtol, qtol |
| 706 | + reference_output, |
| 707 | + stage_output, |
| 708 | + quantization_scale, |
| 709 | + atol, |
| 710 | + rtol, |
| 711 | + qtol, |
| 712 | + statistics_callback=statistics_callback, |
701 | 713 | ) |
702 | 714 | except AssertionError as e: |
703 | 715 | if error_callbacks is None: |
|
0 commit comments