This is an automated email from the ASF dual-hosted git repository.
hongyij pushed a commit to branch unity
in repository https://gitbox.apache.org/repos/asf/tvm.git
The following commit(s) were added to refs/heads/unity by this push:
new b3f0e55f24 Change metal dtype of ceil_log2 to fp32 (#16332)
b3f0e55f24 is described below
commit b3f0e55f24d9d1528a1f9e7e59cb5ac286bc1892
Author: Hongyi Jin <[email protected]>
AuthorDate: Tue Jan 2 16:32:32 2024 -0500
Change metal dtype of ceil_log2 to fp32 (#16332)
fix dtype
---
python/tvm/topi/math.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/python/tvm/topi/math.py b/python/tvm/topi/math.py
index 8b66ca2cc9..c1999b61b4 100644
--- a/python/tvm/topi/math.py
+++ b/python/tvm/topi/math.py
@@ -865,7 +865,10 @@ def ceil_log2(x):
return res
- if "adreno" in tvm.target.Target.current().device_name:
+ if (
+ "adreno" in tvm.target.Target.current().device_name
+ or "metal" == tvm.target.Target.current().kind.name
+ ):
return cast(tvm.tir.ceil(tvm.tir.log2(cast(x, "float32"))), x.dtype)
return cast(tvm.tir.ceil(tvm.tir.log2(cast(x, "float64"))), x.dtype)