Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion python/tvm/s_tir/meta_schedule/builder/local_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ def build(self, build_inputs: list[BuilderInput]) -> list[BuilderResult]:
)
)
else:
raise ValueError("Unreachable: unexpected result: {map_result}")
raise ValueError(f"Unreachable: unexpected result: {map_result}")
pool.shutdown()
return results

Expand Down
2 changes: 1 addition & 1 deletion python/tvm/s_tir/meta_schedule/relax_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def extracted_tasks_to_tune_contexts(
fork_seed(seed, n=len(extracted_tasks)),
):
if task.mod.attrs.get("tirx.is_scheduled", False):
warnings.warn("The task {task.task_name} is already scheduled, skipping it.")
warnings.warn(f"The task {task.task_name} is already scheduled, skipping it.")
continue
tasks.append(
TuneContext(
Expand Down
2 changes: 1 addition & 1 deletion python/tvm/s_tir/meta_schedule/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ def get_global_func_with_default_on_worker(
return get_global_func(name)
except (ValueError, RuntimeError) as error:
raise ValueError(
"Function '{name}' is not registered on the worker process. "
f"Function '{name}' is not registered on the worker process. "
"The build function and export function should be registered in the worker process. "
"Note that the worker process is only aware of functions registered in TVM package, "
"if there are extra functions to be registered, "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
LocalBuilder,
PyBuilder,
)
from tvm.s_tir.meta_schedule.utils import get_global_func_with_default_on_worker
from tvm_tirx import script
from tvm_tirx.script import tirx as T
from tvm_tirx.target import Target
Expand Down Expand Up @@ -234,5 +235,10 @@ def test_meta_schedule_missing_build_func():
LocalBuilder(f_build="wrong-name")


def test_meta_schedule_missing_build_func_error_message():
Comment thread
mshr-h marked this conversation as resolved.
Resolved
with pytest.raises(ValueError, match="Function 'wrong-name' is not registered"):
get_global_func_with_default_on_worker(name="wrong-name", default=None)


if __name__ == "__main__":
tvm_tirx.testing.main()
Loading