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

[BUG] JIT cache size is set to uint64 max #9362

Closed
devavret opened this issue Oct 4, 2021 · 2 comments · Fixed by #10317
Closed

[BUG] JIT cache size is set to uint64 max #9362

devavret opened this issue Oct 4, 2021 · 2 comments · Fixed by #10317
Labels
bug Something isn't working

Comments

@devavret
Copy link
Contributor

devavret commented Oct 4, 2021

The JIT cache size is customizable with these two env variables which have the default value UINT64_MAX

cudf/cpp/src/jit/cache.cpp

Lines 126 to 129 in c2c67de

std::size_t kernel_limit_proc = std::numeric_limits<std::size_t>::max();
std::size_t kernel_limit_disk = std::numeric_limits<std::size_t>::max();
try_parse_numeric_env_var(kernel_limit_proc, "LIBCUDF_KERNEL_CACHE_LIMIT_PER_PROCESS");
try_parse_numeric_env_var(kernel_limit_disk, "LIBCUDF_KERNEL_CACHE_LIMIT_DISK");

These values are used in Jitify to allocate a map to store cached kernels.
https://github.com/rapidsai/jitify/blob/acef3fe7994d15ae0df70ef312f2c42547891b85/jitify2.hpp#L5451

In the default case, these values cause the resize to throw an std::bad_alloc on certain systems.

@devavret devavret added bug Something isn't working Needs Triage Need team to review and classify labels Oct 4, 2021
@beckernick beckernick added Jitify and removed Needs Triage Need team to review and classify labels Oct 5, 2021
@github-actions
Copy link

This issue has been labeled inactive-30d due to no recent activity in the past 30 days. Please close this issue if no further response or action is needed. Otherwise, please respond with a comment indicating any updates or changes to the original issue and/or confirm this issue still needs to be addressed. This issue will be labeled inactive-90d if there is no activity in the next 60 days.

@github-actions
Copy link

This issue has been labeled inactive-90d due to no recent activity in the past 90 days. Please close this issue if no further response or action is needed. Otherwise, please respond with a comment indicating any updates or changes to the original issue and/or confirm this issue still needs to be addressed.

rapids-bot bot pushed a commit that referenced this issue Feb 25, 2022
…0317)

In file `jit/cache.cpp`, a program cache always internally reserves a `std::unordered_map` using a size set by an environment variable `LIBCUDF_KERNEL_CACHE_LIMIT_PER_PROCESS`. If that environment variable does not exist, a default value (`std::numeric_limit<size_t>::max`) is used. Such default value is huge, leading to allocating a huge (impossible) size of memory chunk that crashes the system.

This PR changes that default value from `std::numeric_limit<size_t>::max` to `1024^2`. This is essentially a reverse of the PR #10312 but set the default value to `1024` instead of `100`.

Note that `1024^2` is just some random number, not based on any specific calculation.

Closes #10312 and closes #9362.

Authors:
  - Nghia Truong (https://github.com/ttnghia)

Approvers:
  - Mark Harris (https://github.com/harrism)
  - Karthikeyan (https://github.com/karthikeyann)

URL: #10317
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants