def METHOD_NAME(
    self,
    target: Union[str, Target] = "cpu",
    max_trials_global: int = 32,
    *,
    num_trials_per_iter: int = 32,
    builder: ms.Builder.BuilderType = "local",
    runner: ms.Runner.RunnerType = "local",
    database: ms.Database.DatabaseType = "json",
    cost_model: ms.CostModel.CostModelType = "xgb",
    measure_callbacks: ms.MeasureCallback.CallbackListType = "default",
    task_scheduler: ms.TaskScheduler.TaskSchedulerType = "round-robin",
    space: ms.SpaceGenerator.SpaceGeneratorType = "post-order-apply",
    strategy: ms.SearchStrategy.SearchStrategyType = "replay-trace",
    num_tuning_cores: Union[Literal["physical", "logical"], int] = "physical",
    seed: Optional[int] = None,
) -> None:
    """
    Tune the TVMScript code.
    Parameters
    ----------
    config: Optional[TuneConfig]
        The tuning configuration.
    target : Optional[str, Target]
        The target to tune for.
    """
    if target == "cpu":
        target = f"llvm --num-cores {ms.utils.cpu_count(logical=False)}"
    with tempfile.TemporaryDirectory() as work_dir:
        database = ms.tir_integration.tune_tir(
            mod=self.ir_module,
            target=target,
            work_dir=work_dir,
            max_trials_global=max_trials_global,
            num_trials_per_iter=num_trials_per_iter,
            builder=builder,
            runner=runner,
            database=database,
            cost_model=cost_model,
            measure_callbacks=measure_callbacks,
            task_scheduler=task_scheduler,
            space=space,
            strategy=strategy,
            num_tuning_cores=num_tuning_cores,
            seed=seed,
        )
        sch = ms.tir_integration.compile_tir(database, self.ir_module, target)
        self.ir_module = sch.mod
        self.build(target)