def METHOD_NAME(
    self, mod: tvm.IRModule, params: Optional[Dict[str, tvm.runtime.NDArray]] = None
) -> tvm.IRModule:
    """Partition the relay graph in parts supported and unsupported by the
    target hardware accelerator.
    Parameters
    ----------
    mod : tvm.IRModule
        The relay module to be partitioned.
    params: Optional[Dict[str, tvm.runtime.NDArray]]
    Returns
    -------
    out : tvm.IRModule
        The partitioned relay module.
    """
    if params:
        mod["main"] = bind_params_by_name(mod["main"], params)
    pass_sequence = []
    pass_sequence.extend(
        [p[1] for p in self._relay_passes if p[0] == PassPhase.PRE_PARTITIONING]
    )
    pass_sequence.append(relay.transform.MergeComposite(self._pattern_table()))
    pass_sequence.append(relay.transform.AnnotateTarget(self.target_name))
    if self.merge_compiler_regions:
        pass_sequence.append(relay.transform.MergeCompilerRegions())
    pass_sequence.append(relay.transform.PartitionGraph())
    pass_sequence.extend(
        [p[1] for p in self._relay_passes if p[0] == PassPhase.POST_PARTITIONING_0]
    )
    sequential_passes = tvm.transform.Sequential(pass_sequence)
    mod = sequential_passes(mod)
    # Defunctionalize the partitioned functions to allow lowering
    for gvar, func in mod.functions.items():
        mod.update_func(gvar, relay.transform.Defunctionalization(func, mod))
    post_partition_passes_1 = tvm.transform.Sequential(
        [p[1] for p in self._relay_passes if p[0] == PassPhase.POST_PARTITIONING_1]
    )
    mod = post_partition_passes_1(mod)
    return mod