Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Python3.8 Type Error #484

Closed
wzhao18 opened this issue Aug 31, 2024 · 5 comments
Closed

Python3.8 Type Error #484

wzhao18 opened this issue Aug 31, 2024 · 5 comments

Comments

@wzhao18
Copy link

wzhao18 commented Aug 31, 2024

Tested with version 0.1.6

lib/python3.8/site-packages/flashinfer/cascade.py:276: in MultiLevelCascadeAttentionWrapper
int_workspace_buffers: list[torch.Tensor],
E TypeError: 'type' object is not subscriptable

@yzh119
Copy link
Collaborator

yzh119 commented Aug 31, 2024

Hi @wzhao18 , Can you provide my context? How did you call the reset_workspace_buffer function? (Ideally you don't need to call this function if you provide a large enough float_workspace_buffer when initializing a wrapper)?

The docstring of this function is wrong, int_workspace_buffer should have type List[torch.Tensor] instead of torch.Tensor, we will fix the docstring soon.

@wzhao18
Copy link
Author

wzhao18 commented Aug 31, 2024

@yzh119 Thanks for getting back. I believe the issue is simply because python's type system (at least in python3.8) does not allow type annotations like list[torch.Tensor], like here. I believe as simple as changing to List[torch.Tensor] should solve the problem.

@yzh119
Copy link
Collaborator

yzh119 commented Aug 31, 2024

I see, this might be an issue only with python 3.8.

yzh119 added a commit that referenced this issue Sep 1, 2024
Bugfix to #484, thanks @wzhao18 for spotting this error.
@yzh119
Copy link
Collaborator

yzh119 commented Sep 1, 2024

Fixed in #486, thank you again for reporting this issue.

@yzh119 yzh119 closed this as completed Sep 1, 2024
@wzhao18
Copy link
Author

wzhao18 commented Sep 1, 2024

@yzh119 Thank you!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants