cutlass icon indicating copy to clipboard operation
cutlass copied to clipboard

[BUG][CuTeDSL] Incorrect error messages in right_inverse and left_inverse functions

Open alexwl opened this issue 7 months ago • 2 comments

Describe the bug The error messages in the right_inverse and left_inverse functions incorrectly display <class 'nanobind.nb_type_0'> instead of the actual type of the received input, which makes debugging difficult.

Steps/Code to reproduce bug

import cutlass.cute as cute

@cute.jit
def error():
    cute.right_inverse(1)

error()

The error message: TypeError: expects input of type Layout, but got <class 'nanobind.nb_type_0'>

Expected behavior Error message: TypeError: expects input of type Layout, but got <class 'int'>

Environment details : CuTe DSL version: nvidia-cutlass-dsl 4.0.0

Additional context The fix is to replace type(Layout) with type(input) in cute/core.py: https://github.com/NVIDIA/cutlass/blob/8bdbfca68287232e5bf5793145f987569ecd312e/python/CuTeDSL/cutlass/cute/core.py#L3876-L3887

alexwl avatar Jun 06 '25 09:06 alexwl

thanks for the report!

thakkarV avatar Jun 06 '25 13:06 thakkarV

Thanks for report and recommended fix.

fengxie avatar Jun 07 '25 04:06 fengxie

This issue has been labeled inactive-30d due to no recent activity in the past 30 days. Please close this issue if no further response or action is needed. Otherwise, please respond with a comment indicating any updates or changes to the original issue and/or confirm this issue still needs to be addressed. This issue will be labeled inactive-90d if there is no activity in the next 60 days.

github-actions[bot] avatar Jul 07 '25 04:07 github-actions[bot]

This was fixed in 4.2. Closing.

brandon-yujie-sun avatar Oct 22 '25 07:10 brandon-yujie-sun