How to ensure that every cuda thread will hit "__cuda_llis_exit" entry before exiting?
simple86 opened this issue · comments
Hi, there! Paella/LLIS is a pretty good work and I'm very interested.
I found __cuda_llis_exit
is being inserted here:
// tvm-llis/src/target/source/codegen_cuda.cc
void CodeGenCUDA::PrintFinalReturn() {
CodeGenC::PrintFinalReturn();
if (llis_flag_) {
stream << "__cuda_llis_exit: __cuda_llis_notifier->end(__cuda_llis_job_id);\n";
}
}
Since cuda threads may exit from any random position, I'm not sure whether it works well in such situation.
Does every cuda thread hit __cuda_llis_exit
entry?
You are correct that cuda threads may exit from any position in general, like it may return in the middle. However, TVM never generates such code and so we are fine.
In general, if we need to do instrumentation for general kernels, it should not be hard to static analyze all possible exit points.