-
Notifications
You must be signed in to change notification settings - Fork 198
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] Global static variable in inlined function. #826
Comments
I looked into this extensively in the past. I even made a repro with my results: https://github.com/jrhemstad/link_test I'm not familiar with the I would say RMM is just not compatible with those build settings. |
Thanks for the reply. The build setting is used to handle c++ symbol conflicts. We ran into some errors that are caused by such conflicts, from both |
I also made a suggestion for cuml to adopt hidden symbols rapidsai/cuml#3859. There's an introduction on why it's useful: https://gcc.gnu.org/wiki/Visibility . (the pdf linked on that page might also be worth a read). |
The only way to support that build configuration is to make RMM no longer be a header-only library and distribute a binary. That would be a big change. |
I was reading through your link and found this:
So it sounds like we should be able to explicitly annotate the |
That sounds like a good idea, I will test it tomorrow to see if it solves the problem. ;-) |
Yes that will work. Explicit visibility attributes take priority over If we go down this path for rmm we should consider having some form of |
Just tested the solution by @jrhemstad and it works. |
Hi, I can open a PR for this simple change if it's decided to be useful. |
Yeah, we'd be happy to have a PR for this. |
Define macros used for specifying symbol visibility and use it on `get_map`. The macros are only useful for gcc/clang with glibc on Linux. Sorry I'm not familiar with other platforms. Close #826 . > 1. Please ensure that you have written units tests for the changes made and/or features added. I'm not sure how to test this on CI. Authors: - Jiaming Yuan (https://github.com/trivialfis) Approvers: - Rong Ou (https://github.com/rongou) - Jake Hemstad (https://github.com/jrhemstad) URL: #833
Describe the bug
Hi, I'm trying to get rmm to work in XGBoost across Python and C++ code base. One issue I found is the global variable
device_id_to_resource
returned byrmm::mr::detail::get_map
. Theget_map
function is inlined, so when XGBoost is compiled with:different static variables are returned when called in C++ and called in Python. I tried to print out the address of returned map in
set_per_device_resource
(called in Pythonreinitialize
) andget_per_device_resource
(called during construction ofdevice_uvector
), and can confirm the returned maps have different addresses. This leads to user configuration not being honored in XGBoost c++ code base. Actually if I use gdb to break the function, the one called in Python is completely ignored.The text was updated successfully, but these errors were encountered: