Skip to content

Commit dcbc556

Browse files
Merge branch 'main' into dev/gokul/fix_div
2 parents 0e482f4 + 4529671 commit dcbc556

2 files changed

Lines changed: 3 additions & 20 deletions

File tree

tests/test_stateful.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
from .utils import (
2727
filecheck_pattern,
2828
make_dynamic_shapes,
29-
run_transforms,
3029
validate_numerical_output,
3130
)
3231

@@ -229,7 +228,7 @@ async def test_buffer_mutation_after_make_stateful(self) -> None:
229228
.add_exported_program(self._mutable_buffer_program())
230229
.to_coreai()
231230
)
232-
await run_transforms(result)
231+
result.optimize()
233232
filecheck_pattern(
234233
str(result),
235234
check_file="""
@@ -395,7 +394,7 @@ async def test_user_input_mutation_after_make_stateful(self) -> None:
395394
result = (
396395
TorchConverter().add_exported_program(self._mutating_program()).to_coreai()
397396
)
398-
await run_transforms(result)
397+
result.optimize()
399398
filecheck_pattern(
400399
str(result),
401400
check_file="""
@@ -507,7 +506,7 @@ async def test_both_mutations_after_make_stateful(self) -> None:
507506
.add_exported_program(self._both_mutations_program())
508507
.to_coreai()
509508
)
510-
await run_transforms(result)
509+
result.optimize()
511510
filecheck_pattern(
512511
str(result),
513512
check_file="""

tests/utils.py

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@
1616
import numpy as np
1717
import numpy.typing as npt
1818
import torch
19-
from coreai._compiler._transforms import GlobalOptions, PassEntry, apply_passes
20-
from coreai._compiler._transforms.passes import CorePasses
21-
from coreai.authoring import AIProgram
2219
from coreai.runtime import NDArray, StorageKind
2320
from filecheck.matcher import Matcher
2421
from filecheck.options import Options
@@ -81,19 +78,6 @@ def _get_test_specialization_options() -> "SpecializationOptions | None":
8178
raise ValueError(msg)
8279

8380

84-
async def run_transforms(coreai_program: AIProgram) -> None:
85-
"""Run essential transformation passes."""
86-
await apply_passes(
87-
coreai_program._mlir_module,
88-
passes=[
89-
PassEntry.get(CorePasses._CORE_OPTIMIZE),
90-
PassEntry.get(CorePasses._UPDATE_SIGNATURE_TO_HANDLES),
91-
PassEntry.get(CorePasses._PROPAGATE_HANDLE_UPDATES),
92-
],
93-
options=GlobalOptions(Path()),
94-
)
95-
96-
9781
def make_dynamic_shapes(
9882
**arg_specs: list[str | None] | dict[int, str | None],
9983
) -> dict[str, dict[int, torch.export.Dim]]:

0 commit comments

Comments
 (0)