kernel_tuner icon indicating copy to clipboard operation
kernel_tuner copied to clipboard

Instance won't be None

Open LiuLiujie opened this issue 1 year ago • 2 comments

In the code fragment below, the instance won't be None in line 764 because the function dev.create_kernel_instance(_) returns either InvalidConfig or KernelInstance.

When I make a problem in the thread block settings, the return value in line 763 is an instance of InvalidConfig, which has no attribute name, bypasses the if statement, and will cause error AttributeError: 'InvalidConfig' object has no attribute 'name' in line 768. This error message is not that clear for me to figure out what the real problem is.

https://github.com/KernelTuner/kernel_tuner/blob/5d8e636957a044649f8eacecd52217c5c7eb6f0a/kernel_tuner/interface.py#L763-L768

LiuLiujie avatar Mar 24 '23 16:03 LiuLiujie

Thanks @LiuLiujie for reporting! Indeed the check for None has become obsolete when InvalidConfig's were introduced. This should be fixed. Is this something you need urgently or is it only that the error message that could be improved?

benvanwerkhoven avatar Apr 07 '23 08:04 benvanwerkhoven

Hey Ben! It's not something urgent. I just came across this potential bug when I read and debugged the code.

LiuLiujie avatar Apr 10 '23 06:04 LiuLiujie