Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign up[DEBT] rename .h|.hpp|.cuh|.cu|.cpp files properly in our cuml C++ source base #1675
Comments
|
By extension, this means that we'll also have to move cuda-runtime related calls (or wrappers) into a |
|
@chaithyagr, how about this one? |
|
Makes sense, will give a good dive into the codebase. |
|
So I could finally get code building!! Going by the rules described in #1675 (comment) , we would have a lot of file renaming, do we want this? For now, I havent looked at any helpers for doing this, as I want to have a look into the library as I do this. But do let me know if there is any obvious fast way of doing this. Something which I thought could be used (not yet sure) is https://github.com/include-what-you-use/include-what-you-use to analyze the usage patterns |
|
Glad to know that the build worked for you! In case you faced any issues during the build process, please do write about those in issue #1503 . We want to know such difficulties that the devs are having. I'm pretty sure about all the rules I described above, except number 2, since that is mostly my personal preference. I'd like to have @JohnZed, @cjnolet and @dantegd to chime in here and get their opinion before proceeding any further. BTW, @chaithyagr, do note that the rule number 1 above works the other way too. Meaning, let's assume that there is a IWYU can be an interesting addition to our CI process. Can you file an issue about it against cuML? |
|
yes, and it is better to start from |
|
Sure, I will work on src_prims first. However, I think I agree with you on having this PR in multiple parts, I will keep this change aside and work on smaller groups of folders and submit them rather than have a bulky PR. I will go through the files and try to come up with a logical order of things and how to proceed in free time |
|
@chaithyagr any updates on this? |
|
Oops, I seem to have forgotten to update here. |
|
I just realized that it is better for me to be sure of the renaming rules: Just to ensure that I am on the right track, here are some example renames that I think needs to be done :
That brings me to a question, so right now all files are compiled using
Am I missing something here or have something grossly wrong? |
the sooner you can get atleast some set of changes filed for PR the better it is for us. This change could also help us in reducing compilation time. Hence the need to address this issue faster.
That's why it is probably better not to start with core set of files like
That's correct, as it follows rule no 1 above.
utils.h does not have any of the items mentioned in rule no 1. However, the name is too generic to cause conflicts in future! So, I'd probably rename this as
That's correct. except for |
|
@chaithyagr I just updated rule no. 2 to help minimize amount of changes. In short, if a header needs to be renamed as a |
|
Yes @teju85 , I think have bottoms up approach was a bad idea initially. Now, I started by understand the directory structure and also the organization of codes in some subdirectories of I am sorry, but I seem to be getting a bit confused here, and I couldnt find good pointers to what is right definitions at this point, so do let me know if there is anything basic that I am missing here..
I will commit my changes in this bunch and hopefully start a PR tomorrow, I hope with the answers I will be better equipped to work on some aspect over the weekend. |
Hope this helps. |
|
Thanks @teju85 , I have made the first PR, with the changes in solver, dbscan and svm. |
|
@teju85 , Shall I proceed with more changes, or shall I wait for the first PR to get a clearer picture of how PR is done? |
|
Hey @chaithyagr, give me few more days to look at that PR. Currently busy with some other stuffs. |
|
Sure sure! |
|
@chaithyagr I noticed a silly mistake from me in prims folder! It is:
Just pointing it out explicitly so that we don't miss it. |
|
I have opened what seems to be the last PR for src/ directory files. I have ignored randomForest and kalman filter for now as you suggested above. Moving towards src_prims, it is weird but I am a bit stuck on how to make changes without a major change, I think the movement of cuda_utils.h to cuda_utils.cuh must be the last change as it will have the maximum impact. Also, I am still trying to ease in minimum batches of changes to keep PR tight. |
|
This is good progress. Thanks @chaithyagr for doing this! Sadly, for the |
|
Quick question, I found a wrapper: |
I'm afraid, we need to use cuda_utils.h for |
|
ah... good catch regarding |
|
@chaithyagr regarding cub_wrapper, it must be named as |
|
I think the majority of the changes are done (once the last PR merges) Although we could the changes, I feel there is a need to check the above rules in an actual CI script test. @teju85 shall we try to get this done as a part of this issue (effectively at high priority) or try to add this to #1895 as an extra task as they both are related? In my opinion, its better to do a complete wrap for good :P PS: I am not very well aware of the CI methodology here, I can work on a script, but placing it in right place, I might need some help. |
|
@chaithyagr that's a good idea (I was planning to ask you about adding such a "checker" after the prims header rename PR was done!). Yes, adding such a check (inside However, I'm not sure if IWYU and this check need to be in the same PR. I'd prefer if we did these 2 separately. |
|
I tried to add in most of checks in this one simple code: Currently here is the output, which lists all possibly bad cases:
The second part of checks, that is check if threadIdx and blockIdx exists is a very crude way to look for device kernels, does it help? This hopes that no one used this as variable name or even coded this specifically in comments. |
|
Why not use the |
|
Ahh, I forgot to add Perhaps |
Currently, they are just all over the place! I propose the following rule-of-thumb:
.cuh..hpp(if the current header file is already named as a.h, feel free to leave it as it is, in order to minimize the amount of ripple changes this will cause)..h.cuh, then it should be a.cuhas well.cuh, then it should be a.cu, else it should be a.cpp.cThis will certainly help us in reducing compilation time as well (if we end up cleaning some of the
.cufiles and renaming them to.cpp).