Repository navigation
[Fix][MetaSchedule] Format names in error and warning messages - #21008
Merged
mshr-h merged 2 commits intoNov 19, 2026
Merged
Conversation
Three messages in meta_schedule were plain strings with {name}
placeholders, so they showed the braces instead of the values:
- relax_integration.py: the "already scheduled" warning
- utils.py: the "is not registered on the worker process" error
- builder/local_builder.py: the "unexpected result" error
Add the f prefix and a test for the worker-registration error.
cchung100m
approved these changes
Nov 18, 2026
cchung100m
left a comment
Contributor
There was a problem hiding this comment.
LGTM, thanks to @farisbasha
mshr-h
reviewed
Nov 18, 2026
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the diagnostic-formatting changes.
No open issues 🎉
What changed in this PR
Fixes diagnostic formatting in tvm.s_tir.meta_schedule so warnings and errors display runtime values instead of literal placeholders.
Changes:
- Adds missing f-string prefixes to three warning and error messages.
- Adds a regression test verifying that the missing-function error includes the requested function name.
| File | Description |
|---|---|
| tests/python/s_tir/meta_schedule/test_meta_schedule_builder.py | Tests the function name in the missing-function error. |
| python/tvm/s_tir/meta_schedule/utils.py | Interpolates the unregistered function name. |
| python/tvm/s_tir/meta_schedule/relax_integration.py | Interpolates the skipped task’s name in the warning. |
| python/tvm/s_tir/meta_schedule/builder/local_builder.py | Interpolates the unexpected build result in the error. |
Review effort: Max
Contributor
Author
|
Thanks for the review! Removed the test. |
mshr-h
approved these changes
Nov 19, 2026
Netra-Srinivasan-McW
pushed a commit
to Netra-Srinivasan-McW/tvm-mcw
that referenced
this pull request
Nov 20, 2026
…e#21008) Three messages in `tvm.s_tir.meta_schedule` are plain strings with `{...}` placeholders, so users see the braces instead of the values: - `relax_integration.py`: `warnings.warn("The task {task.task_name} is already scheduled, skipping it.")` - `utils.py`, `get_global_func_with_default_on_worker`: `"Function '{name}' is not registered on the worker process. "` - `builder/local_builder.py`: `raise ValueError("Unreachable: unexpected result: {map_result}")` This adds the missing `f` prefix to each one. Test: `test_meta_schedule_missing_build_func_error_message` in `tests/python/s_tir/meta_schedule/test_meta_schedule_builder.py` calls `get_global_func_with_default_on_worker(name="wrong-name", default=None)` and checks that the error names `'wrong-name'`. I did not build TVM locally, so CI is the test run.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three messages in
tvm.s_tir.meta_scheduleare plain strings with{...}placeholders, so users see the braces instead of the values:relax_integration.py:warnings.warn("The task {task.task_name} is already scheduled, skipping it.")utils.py,get_global_func_with_default_on_worker:"Function '{name}' is not registered on the worker process. "builder/local_builder.py:raise ValueError("Unreachable: unexpected result: {map_result}")This adds the missing
fprefix to each one.Test:
test_meta_schedule_missing_build_func_error_messageintests/python/s_tir/meta_schedule/test_meta_schedule_builder.pycallsget_global_func_with_default_on_worker(name="wrong-name", default=None)and checks that the error names'wrong-name'. I did not build TVM locally, so CI is the test run.