[Fixbug][Hidet Script] Fix a bug that hidet script does not recognize return type#329
Merged
yaoyaoding merged 2 commits intohidet-org:mainfrom Jul 25, 2023
Merged
Conversation
vadiklyutiy
pushed a commit
that referenced
this pull request
Jul 22, 2024
After disallowing functions unsupported by Hidet as in #317 , the compilation of the model `vision_maskrcnn` (previously failed on unsupported `topk` method, as in #267 ) failed on a TypeError with the following traceback message: > File "/home/bolin/Desktop/hidet/python/hidet/graph/graph_utils/functors.py", line 75, in visit > ret = self.visit_Operator(obj) # pylint: disable=assignment-from-none > ^^^^^^^^^^^^^^^^^^^^^^^^ > File "/home/bolin/Desktop/hidet/python/hidet/graph/graph_utils/functors.py", line 126, in visit_Operator > updated_outputs = op.reforward(inputs) > ^^^^^^^^^^^^^^^^^^^^ > File "/home/bolin/Desktop/hidet/python/hidet/graph/operator.py", line 185, in reforward > return cls(*inputs, **attributes).outputs > ^^^^^^^^^^^^^^^^^^^^^^^^^^ > torch._dynamo.exc.BackendCompilerFailed: backend='hidet' raised: > TypeError: ClampOp.__init__() missing 2 required positional arguments: 'min_value' and 'max_value' The cause is that, inside the[ `reforward` function](https://github.com/CentML/hidet/blob/da56e48148c5b075f1fba6d1d878a82889c9f731/python/hidet/graph/operator.py#L180-L185), during the call to `cls(*inputs, **attributes)`, where `cls` is `ClampOp`, `inputs` only consists of the input tensor and `attributes` is an empty dictionary, so the `min_value` and `max_values` cannot be passed to the initializer. This is because we did not initialize the `attributes` dictionary to contain the values of these two parameter [while initializing `ClampOp`](https://github.com/CentML/hidet/blob/da56e48148c5b075f1fba6d1d878a82889c9f731/python/hidet/graph/ops/arithmetic.py#L586-L595).
vadiklyutiy
pushed a commit
that referenced
this pull request
Jul 23, 2024
After disallowing functions unsupported by Hidet as in #317 , the compilation of the model `vision_maskrcnn` (previously failed on unsupported `topk` method, as in #267 ) failed on a TypeError with the following traceback message: > File "/home/bolin/Desktop/hidet/python/hidet/graph/graph_utils/functors.py", line 75, in visit > ret = self.visit_Operator(obj) # pylint: disable=assignment-from-none > ^^^^^^^^^^^^^^^^^^^^^^^^ > File "/home/bolin/Desktop/hidet/python/hidet/graph/graph_utils/functors.py", line 126, in visit_Operator > updated_outputs = op.reforward(inputs) > ^^^^^^^^^^^^^^^^^^^^ > File "/home/bolin/Desktop/hidet/python/hidet/graph/operator.py", line 185, in reforward > return cls(*inputs, **attributes).outputs > ^^^^^^^^^^^^^^^^^^^^^^^^^^ > torch._dynamo.exc.BackendCompilerFailed: backend='hidet' raised: > TypeError: ClampOp.__init__() missing 2 required positional arguments: 'min_value' and 'max_value' The cause is that, inside the[ `reforward` function](https://github.com/CentML/hidet/blob/da56e48148c5b075f1fba6d1d878a82889c9f731/python/hidet/graph/operator.py#L180-L185), during the call to `cls(*inputs, **attributes)`, where `cls` is `ClampOp`, `inputs` only consists of the input tensor and `attributes` is an empty dictionary, so the `min_value` and `max_values` cannot be passed to the initializer. This is because we did not initialize the `attributes` dictionary to contain the values of these two parameter [while initializing `ClampOp`](https://github.com/CentML/hidet/blob/da56e48148c5b075f1fba6d1d878a82889c9f731/python/hidet/graph/ops/arithmetic.py#L586-L595).
vadiklyutiy
pushed a commit
that referenced
this pull request
Dec 26, 2024
After disallowing functions unsupported by Hidet as in #317 , the compilation of the model `vision_maskrcnn` (previously failed on unsupported `topk` method, as in #267 ) failed on a TypeError with the following traceback message: > File "/home/bolin/Desktop/hidet/python/hidet/graph/graph_utils/functors.py", line 75, in visit > ret = self.visit_Operator(obj) # pylint: disable=assignment-from-none > ^^^^^^^^^^^^^^^^^^^^^^^^ > File "/home/bolin/Desktop/hidet/python/hidet/graph/graph_utils/functors.py", line 126, in visit_Operator > updated_outputs = op.reforward(inputs) > ^^^^^^^^^^^^^^^^^^^^ > File "/home/bolin/Desktop/hidet/python/hidet/graph/operator.py", line 185, in reforward > return cls(*inputs, **attributes).outputs > ^^^^^^^^^^^^^^^^^^^^^^^^^^ > torch._dynamo.exc.BackendCompilerFailed: backend='hidet' raised: > TypeError: ClampOp.__init__() missing 2 required positional arguments: 'min_value' and 'max_value' The cause is that, inside the[ `reforward` function](https://github.com/CentML/hidet/blob/da56e48148c5b075f1fba6d1d878a82889c9f731/python/hidet/graph/operator.py#L180-L185), during the call to `cls(*inputs, **attributes)`, where `cls` is `ClampOp`, `inputs` only consists of the input tensor and `attributes` is an empty dictionary, so the `min_value` and `max_values` cannot be passed to the initializer. This is because we did not initialize the `attributes` dictionary to contain the values of these two parameter [while initializing `ClampOp`](https://github.com/CentML/hidet/blob/da56e48148c5b075f1fba6d1d878a82889c9f731/python/hidet/graph/ops/arithmetic.py#L586-L595).
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 hidet script transpiler to run recognize the following code
Previously, hidet can not recognize the
float32x8return type.