gemini-code-assist[bot] commented on code in PR #18627:
URL: https://github.com/apache/tvm/pull/18627#discussion_r2655025109
##########
python/tvm/tir/tensor_intrin/metal.py:
##########
@@ -249,9 +249,9 @@ def impl(a: T.handle, b: T.handle, c: T.handle) -> None:
SIMDGROUP_FILLED_8x8x8_f32_INTRIN,
*get_make_filled_simdgroup_matrix_intrin("float32", 8, 8)
)
-SIMDGROUP_FILLED_8x8x8_bf16_INTRIN = "simdgroup_fill_8x8x8_bf16"
+SIMDGROUP_MAKE_FILLED_8x8x8_bf16_INTRIN = "simdgroup_make_filled_8x8x8_bf16"
TensorIntrin.register(
- SIMDGROUP_FILLED_8x8x8_bf16_INTRIN,
*get_make_filled_simdgroup_matrix_intrin("bfloat16", 8, 8)
+ SIMDGROUP_MAKE_FILLED_8x8x8_bf16_INTRIN,
*get_make_filled_simdgroup_matrix_intrin("bfloat16", 8, 8)
)
Review Comment:

It's great that you're making the intrinsic name for `bfloat16` consistent
with `float16` by using `simdgroup_make_filled_...`. However, the `float32`
intrinsic `SIMDGROUP_FILLED_8x8x8_f32_INTRIN` is still using
`simdgroup_fill_...`. This will cause an issue because
`get_simdgroup_intrin_group` constructs the `init_intrin` name as
`simdgroup_make_filled_...` for all dtypes. With the changes in `matmul.py` to
support dynamic dtypes, this will break `float32` support. Please also update
the `float32` intrinsic name and value for consistency. It should be renamed to
`SIMDGROUP_MAKE_FILLED_8x8x8_f32_INTRIN` with value
`simdgroup_make_filled_8x8x8_f32`.
##########
python/tvm/dlight/gpu/matmul.py:
##########
@@ -1040,8 +1044,10 @@ def is_inner_reduction(block_stmt, iter_infos):
return tensorize_sch
elif target.kind.name == "metal":
try:
- return MetalMatmul().apply(func, target, _)
- except: # pylint: disable=bare-except
+ result = MetalMatmul().apply(func, target, _)
+ if result is not None:
+ return result
+ except Exception: # pylint: disable=broad-except
pass
Review Comment:

Per PEP 8, imports should be at the top of the file. Please move `import
warnings` to the top of `python/tvm/dlight/gpu/matmul.py` to improve code style
and readability.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]