zxybazh commented on code in PR #12342:
URL: https://github.com/apache/tvm/pull/12342#discussion_r940910170
##########
tests/python/unittest/test_meta_schedule_tune_tir.py:
##########
@@ -66,6 +66,7 @@ def test_tune_matmul_cpu():
max_trials_global=32,
),
work_dir=work_dir,
+ blocks=["update"],
Review Comment:
Here is an example that you may follow:
```
@pytest.mark.skip("Integration test")
def test_tune_block_cpu():
@derived_object
class RemoveBlock(PyScheduleRule):
def _initialize_with_tune_context(self, context: TuneContext) ->
None:
pass
def apply(self, sch: Schedule, block: BlockRV) -> List[Schedule]:
if sch.get(block).name_hint == "root":
return [sch]
sch = sch.copy()
sch.compute_inline(block)
return [sch]
with tempfile.TemporaryDirectory() as work_dir:
sch: Schedule = tune_tir(
mod=two_step,
target=Target("llvm --num-cores=16"),
config=TuneConfig(
strategy="replay_trace",
num_trials_per_iter=32,
max_trials_per_task=32,
max_trials_global=32,
),
work_dir=work_dir,
blocks=["A"],
sch_rules=lambda *args: [RemoveBlock()],
)
assert sch is not None
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]