You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2022/01/06 18:32:04 UTC

[GitHub] [tvm] AndrewZhaoLuo opened a new pull request #9856: [AMP] Fix IsMixedPrecisionType Edge Case

AndrewZhaoLuo opened a new pull request #9856:
URL: https://github.com/apache/tvm/pull/9856


   IsMixedPrecisionType returns whether the given type matches the target mixed precision type if the type is a floating point type. If it is not a floating point type and the corresponding flag is set it just returns true.
   
   This was the intended behavior. Previously this was not the case. This PR fixes things to match intended behavior.
   
   Motivation is an op with a mix of arguments consisting of floating point and integers would never be allowed to be done in FP16 space unless the integer tensors were also constants.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] comaniac commented on a change in pull request #9856: [AMP] Fix IsMixedPrecisionType Edge Case

Posted by GitBox <gi...@apache.org>.
comaniac commented on a change in pull request #9856:
URL: https://github.com/apache/tvm/pull/9856#discussion_r779771429



##########
File path: tests/python/relay/test_to_mixed_precision.py
##########
@@ -459,5 +459,34 @@ def test_batch_matmul_simple():
     assert tvm.ir.structural_equal(expected_mod, output_mod)
 
 
+def test_convert_follow_node_with_integer_arguments():
+    """Tests the conversion of a follow op with integer arguments + constant float args.
+
+    The follow op should convert the floating point argument into fp16 as constants/vars
+    will always be converted if safe to do so.
+    """
+
+    data = relay.var("data", shape=[1, 10], dtype="float32")
+
+    # We add have an addition to make sure the input indices to take are not a
+    # var (which are always casted if safe)

Review comment:
       ```suggestion
       # We use an addition to make sure the input indices are not a var
       # (which are always casted if safe)
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] masahi merged pull request #9856: [AMP] Fix IsMixedPrecisionType Edge Case

Posted by GitBox <gi...@apache.org>.
masahi merged pull request #9856:
URL: https://github.com/apache/tvm/pull/9856


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [tvm] masahi merged pull request #9856: [AMP] Fix IsMixedPrecisionType Edge Case

Posted by GitBox <gi...@apache.org>.
masahi merged pull request #9856:
URL: https://github.com/apache/tvm/pull/9856


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org