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

Fix out-of-memory error in UrlDecode benchmark #10258

Merged
merged 2 commits into from
Feb 14, 2022

Conversation

davidwendt
Copy link
Contributor

@davidwendt davidwendt commented Feb 9, 2022

Fixes out-of-memory error that occurs when running the STRINGS_BENCH UrlDecode benchmark combined with any other benchmark. The following minimal command shows the error:

benchmarks/STRINGS_BENCH '--benchmark_filter=UrlDecode|translate_large/16'
...
------------------------------------------------------------------------------------------------------------------
Benchmark                                                        Time             CPU   Iterations UserCounters...
------------------------------------------------------------------------------------------------------------------
StringTranslate/translate_large/16777216/32/manual_time       17.4 ms         17.5 ms           40 bytes_per_second=15.8359G/s
terminate called after throwing an instance of 'rmm::out_of_memory'
  what():  std::bad_alloc: out_of_memory: RMM failure at:/cudf/cpp/build/_deps/rmm-src/include/rmm/mr/device/pool_memory_resource.hpp:192: Maximum pool size exceeded

The UrlDecode is the only benchmark in the STRINGS_BENCH using a TEMPLATED_BENCHMARK_F which causes a new separate memory pool to be created instead of reusing the one already created from the previous benchmark.
This PR reworks the benchmark macros in url_decode.cpp to avoid using TEMPLATED_BENCHMARK_F which fixes the issue.

@davidwendt davidwendt added bug Something isn't working 3 - Ready for Review Ready for review by team libcudf Affects libcudf (C++/CUDA) code. non-breaking Non-breaking change labels Feb 9, 2022
@davidwendt davidwendt self-assigned this Feb 9, 2022
@davidwendt davidwendt requested a review from a team as a code owner February 9, 2022 21:30
@codecov
Copy link

codecov bot commented Feb 10, 2022

Codecov Report

Merging #10258 (1683e85) into branch-22.04 (a7d88cd) will increase coverage by 0.00%.
The diff coverage is 0.00%.

Impacted file tree graph

@@              Coverage Diff              @@
##           branch-22.04   #10258   +/-   ##
=============================================
  Coverage         10.42%   10.43%           
=============================================
  Files               119      122    +3     
  Lines             20603    20583   -20     
=============================================
- Hits               2148     2147    -1     
+ Misses            18455    18436   -19     
Impacted Files Coverage Δ
python/cudf/cudf/_fuzz_testing/fuzzer.py 0.00% <0.00%> (ø)
python/cudf/cudf/_fuzz_testing/io.py 0.00% <0.00%> (ø)
python/cudf/cudf/_fuzz_testing/main.py 0.00% <0.00%> (ø)
python/cudf/cudf/_version.py 0.00% <0.00%> (ø)
python/cudf/cudf/comm/gpuarrow.py 0.00% <0.00%> (ø)
python/cudf/cudf/core/_base_index.py 0.00% <0.00%> (ø)
python/cudf/cudf/core/column/categorical.py 0.00% <0.00%> (ø)
python/cudf/cudf/core/column/column.py 0.00% <0.00%> (ø)
python/cudf/cudf/core/column/datetime.py 0.00% <ø> (ø)
python/cudf/cudf/core/column/methods.py 0.00% <0.00%> (ø)
... and 50 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 19dc46f...1683e85. Read the comment docs.

Copy link
Contributor

@karthikeyann karthikeyann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@karthikeyann
Copy link
Contributor

@gpucibot merge

@rapids-bot rapids-bot bot merged commit b977d1e into rapidsai:branch-22.04 Feb 14, 2022
rapids-bot bot pushed a commit that referenced this pull request Feb 14, 2022
Fixes out-of-memory error that occurs when running the `BINARYOP_BENCH` `COMPILED_BINARYOP` benchmark combined with the `BINARYOP` benchmark. The following minimal command shows the error:

```
benchmarks/BINARYOP_BENCH '--benchmark_filter=COMPILED_BINARYOP|100000000/10'
...
BINARYOP<double, TreeType::IMBALANCED_LEFT, false>/binaryop_double_imbalanced_unique/100000000/10/manual_time                              40.4 ms         40.4 ms           17 bytes_per_second=202.953G/s
terminate called after throwing an instance of 'rmm::out_of_memory'
  what():  std::bad_alloc: out_of_memory: RMM failure at:/conda/envs/rapids/include/rmm/mr/device/pool_memory_resource.hpp:192: Maximum pool size exceeded
Aborted (core dumped)
```

The `COMPILED_BINARYOP` is using a `TEMPLATED_BENCHMARK_F` macro which causes a new separate memory pool to be created instead of reusing the one already created by `BINARYOP`.
This PR reworks the benchmark macros in `compiled_binaryop.cpp` to avoid using `TEMPLATED_BENCHMARK_F` allowing it share the existing memory pool.

Similar to #10258

Authors:
  - David Wendt (https://github.com/davidwendt)

Approvers:
  - Nghia Truong (https://github.com/ttnghia)
  - MithunR (https://github.com/mythrocks)
  - Karthikeyan (https://github.com/karthikeyann)

URL: #10269
@davidwendt davidwendt deleted the urldecode-benchmark-oom branch February 14, 2022 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3 - Ready for Review Ready for review by team bug Something isn't working libcudf Affects libcudf (C++/CUDA) code. non-breaking Non-breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants