Closed
Conversation
vadiklyutiy
pushed a commit
that referenced
this pull request
Jul 22, 2024
…332) [Edit: The issue was encountered while attempting to compile the model `yolov3`] Currently the [`setitem`](https://github.com/CentML/hidet/blob/566f0fe55f441326c3034b7eed44b3fa0b03f38d/python/hidet/graph/frontend/torch/register_functions.py#L280) function in Hidet will fail on two special scenarios when `setvalue` is a tensor: 1. When `setvalue` and `x` are of different dtypes, currently there will be an error that looks like: > RuntimeError: If-then-else operand 1 and 2 have different types (hidet.float16 vs hidet.float32) ((((v < 0) || (2 <= v)) ? false : (((v_1 < 0) || (3 <= v_1)) ? false : (((v_2 < 0) || (3 <= v_2)) ? false : true))) ? setvalue[v_2, v_1, v] : data[v_2, v_1, v]), occurred when interpreting operator.setitem with > setitem(tensor(...), (Ellipsis, slice(None, 2, None)), tensor(...)) Whereas in PyTorch `setvalue` appears to be casted to the same datatype as `x` if possible. 2. When `setvalue` and `x` are on different devices, currently this will result in an error: > RuntimeError: All inputs of an operator must be on the same device, occurred when interpreting operator.setitem with > setitem(tensor(...), (Ellipsis, slice(None, 2, None)), tensor(...)) Whereas in PyTorch the `setvalue` is moved to the same device as `x`.
vadiklyutiy
pushed a commit
that referenced
this pull request
Jul 23, 2024
…332) [Edit: The issue was encountered while attempting to compile the model `yolov3`] Currently the [`setitem`](https://github.com/CentML/hidet/blob/566f0fe55f441326c3034b7eed44b3fa0b03f38d/python/hidet/graph/frontend/torch/register_functions.py#L280) function in Hidet will fail on two special scenarios when `setvalue` is a tensor: 1. When `setvalue` and `x` are of different dtypes, currently there will be an error that looks like: > RuntimeError: If-then-else operand 1 and 2 have different types (hidet.float16 vs hidet.float32) ((((v < 0) || (2 <= v)) ? false : (((v_1 < 0) || (3 <= v_1)) ? false : (((v_2 < 0) || (3 <= v_2)) ? false : true))) ? setvalue[v_2, v_1, v] : data[v_2, v_1, v]), occurred when interpreting operator.setitem with > setitem(tensor(...), (Ellipsis, slice(None, 2, None)), tensor(...)) Whereas in PyTorch `setvalue` appears to be casted to the same datatype as `x` if possible. 2. When `setvalue` and `x` are on different devices, currently this will result in an error: > RuntimeError: All inputs of an operator must be on the same device, occurred when interpreting operator.setitem with > setitem(tensor(...), (Ellipsis, slice(None, 2, None)), tensor(...)) Whereas in PyTorch the `setvalue` is moved to the same device as `x`.
vadiklyutiy
pushed a commit
that referenced
this pull request
Dec 26, 2024
…332) [Edit: The issue was encountered while attempting to compile the model `yolov3`] Currently the [`setitem`](https://github.com/CentML/hidet/blob/566f0fe55f441326c3034b7eed44b3fa0b03f38d/python/hidet/graph/frontend/torch/register_functions.py#L280) function in Hidet will fail on two special scenarios when `setvalue` is a tensor: 1. When `setvalue` and `x` are of different dtypes, currently there will be an error that looks like: > RuntimeError: If-then-else operand 1 and 2 have different types (hidet.float16 vs hidet.float32) ((((v < 0) || (2 <= v)) ? false : (((v_1 < 0) || (3 <= v_1)) ? false : (((v_2 < 0) || (3 <= v_2)) ? false : true))) ? setvalue[v_2, v_1, v] : data[v_2, v_1, v]), occurred when interpreting operator.setitem with > setitem(tensor(...), (Ellipsis, slice(None, 2, None)), tensor(...)) Whereas in PyTorch `setvalue` appears to be casted to the same datatype as `x` if possible. 2. When `setvalue` and `x` are on different devices, currently this will result in an error: > RuntimeError: All inputs of an operator must be on the same device, occurred when interpreting operator.setitem with > setitem(tensor(...), (Ellipsis, slice(None, 2, None)), tensor(...)) Whereas in PyTorch the `setvalue` is moved to the same device as `x`.
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.
Fix llama2 and add test for num_heads != num_key_value_heads.