Skip to content
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

How to ensure that every cuda thread will hit "__cuda_llis_exit" entry before exiting? #1

Open
simple86 opened this issue Dec 27, 2023 · 1 comment
Assignees

Comments

@simple86
Copy link

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?

@Kelvin-Ng
Copy link
Collaborator

Kelvin-Ng commented Dec 27, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants