-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bugs when transforming mixed-precision kernels #2716
Comments
Fixing the interface renaming was relatively simple and I've now done that. Unfortunately, while testing I discovered that our 'clever' code that attempts to return the correct Routine PSyIR by looking at the signature takes no account of precision! This is because it uses |
Sergi suggested trying to ModuleInline the kernel first and then apply ACCRoutineTrans to it. However, that doesn't help because KernelModuleInlineTrans uses the same broken code to get the PSyIR of the routine to inline. |
In fact, calling ACCRoutineTrans on the inlined kernel also fails because:
I thought we had MATMUL tagged as being available on the GPU? EDIT: it's not but perhaps it could be? |
I'm making good progress with the plumbing but am now hitting errors because of the plain |
While working on this, I found this test (in lfric_kern_test.py):
so the precision-matching clearly does work in some situations. It may be that it simply has a bug for scalar arguments? |
For the record, the code that we used to use to attempt to resolve the correct routine implementation was: # The kernel name corresponds to an interface block. Find which
# of the routines matches the precision of the arguments.
for routine in routines:
try:
# The validity check for the kernel arguments should raise
# an exception if the precisions don't match but currently
# this fails for scalar arguments.
self.validate_kernel_code_args(routine.symbol_table)
sched = routine
break
except GenerationError:
pass
else:
raise GenerationError(
f"Failed to find a kernel implementation with an interface"
f" that matches the invoke of '{self.name}'. (Tried "
f"routines {[item.name for item in routines]}.)") I'm putting this here as I'm going to remove from the code base ( |
As found here: #2663 (comment)
The problem seems to be that we rename the interface rather than the actual subroutine that is being called.
The text was updated successfully, but these errors were encountered: