[Bugfix][TIR] Fix version conflict with typing for Python 3.8.0#13744
[Bugfix][TIR] Fix version conflict with typing for Python 3.8.0#13744junrushao merged 1 commit intoapache:mainfrom
Conversation
|
Thanks for contributing to TVM! Please refer to the contributing guidelines https://tvm.apache.org/docs/contribute/ for useful information and tips. Please request code reviews from Reviewers by @-ing them in a comment.
Generated by tvm-bot |
|
cc. @sunggg |
|
for some reason the CI is stuck on the new pipeline added today...let me try to retrigger |
|
@tvm-bot rerun |
00634b3 to
1bbfc02
Compare
|
I rebased this branch to latest HEAD so that the CI could run properly |
|
It's merged! Thanks for the PR! |
|
Thanks you guys’ kindly help~ |
|
I'm getting some error in Python 3.10 The attribute |
|
Oh no. would you mind having it fixed if it’s not super hard? |
|
Darn, let me fix this. Shouldn't be hard. Edit: until fix is merged, please remove ‘ty._special’ as a temporary solution. |
…he#13744) I came across this bug under python3.8.0 with error from `typing.get_args()` while trying to run testcases like `tests/python/unittest/test_tir_schedule_set_axis_separator.py::test_set_axis_separator[transform_layout_named]` ``` > if get_origin(tp) is collections.abc.Callable and res[0] is not Ellipsis: E IndexError: tuple index out of range ``` And the root cause here is a difference between python3.8.0 and later version: ```diff get_args(Callable[[], T][int]) == ([], int) """ - if isinstance(tp, _GenericAlias): // python3.8.0 + if isinstance(tp, _GenericAlias) and not tp._special: // python3.8.15 res = tp.__args__ if get_origin(tp) is collections.abc.Callable and res[0] is not Ellipsis: } ``` So I added it back to `python/tvm/tir/schedule/_type_checker.py`
I came across this bug under python3.8.0 with error from
typing.get_args()while trying to run testcases liketests/python/unittest/test_tir_schedule_set_axis_separator.py::test_set_axis_separator[transform_layout_named]And the root cause here is a difference between python3.8.0 and later version:
get_args(Callable[[], T][int]) == ([], int) """ - if isinstance(tp, _GenericAlias): // python3.8.0 + if isinstance(tp, _GenericAlias) and not tp._special: // python3.8.15 res = tp.__args__ if get_origin(tp) is collections.abc.Callable and res[0] is not Ellipsis: }So I added it back to
python/tvm/tir/schedule/_type_checker.py