-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
[bug] Fix bug that kernel names are not correctly captured by the profiler #5651
[bug] Fix bug that kernel names are not correctly captured by the profiler #5651
Conversation
✅ Deploy Preview for docsite-preview canceled.
|
for more information, see https://pre-commit.ci
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Per offline discussion, it's hard to determine whether a task is cached because the profiler cannot access the kernel information. It needs many refactoring to let the profiler know whether the task is cached. This is a temporary solution that enables the profiler to deduce the real name of a kernel from the mangled name. Special characters cannot be used because they cause error on windows. See
taichi/taichi/runtime/cuda/jit_cuda.cpp
Lines 52 to 72 in 28c7cc8
std::string convert(std::string new_name) { | |
// Evil C++ mangling on Windows will lead to "unsupported characters in | |
// symbol" error in LLVM PTX printer. Convert here. | |
for (int i = 0; i < (int)new_name.size(); i++) { | |
if (new_name[i] == '@') | |
new_name.replace(i, 1, "_at_"); | |
if (new_name[i] == '?') | |
new_name.replace(i, 1, "_qm_"); | |
if (new_name[i] == '$') | |
new_name.replace(i, 1, "_dl_"); | |
if (new_name[i] == '<') | |
new_name.replace(i, 1, "_lb_"); | |
if (new_name[i] == '>') | |
new_name.replace(i, 1, "_rb_"); | |
TI_ASSERT(std::isalpha(new_name[i]) || std::isdigit(new_name[i]) || | |
new_name[i] == '_' || new_name[i] == '.'); | |
} | |
if (!new_name.empty()) | |
TI_ASSERT(isalpha(new_name[0]) || new_name[0] == '_' || new_name[0] == '.'); | |
return new_name; | |
} |
@PGZXB could you cherrypick this commit into rc-v1.1.0 and send another PR against that branch as well? Thanks! :D |
…filer (taichi-dev#5651) * [bug] Fix bug that kernel names are not correctly captured by the profiler * [pre-commit.ci] auto fixes from pre-commit.com hooks * Fix w-error * Make LLVM AOT happy Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
…filer (#5651) (#5669) * [bug] Fix bug that kernel names are not correctly captured by the profiler * [pre-commit.ci] auto fixes from pre-commit.com hooks * Fix w-error * Make LLVM AOT happy Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Related issue = fixes #5643