-
Notifications
You must be signed in to change notification settings - Fork 703
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
Merging CUDA and non CUDA toolchains into one #12484
Comments
@Micket more-or-less. But I tested it out and ran into a couple of issues:
|
Perhaps switching the two lines here: |
Is 1. and 2. basically the same issue right? Were we to patch the order, then I suspect it would solve the RPATH issues? (or are Regarding 3. redefining gompi as a subtoolchain sounds a bit scary; can we even do that without wreaking havoc on all previous toolchains versions? |
I'm actually not even sure if non-CUDA UCX can be convinced to see the CUDA plugins.. will need to test some more. |
Unfortunately that won't be enough in the long run, when we get other things that use UCX directly and would then need the UCX-CUDA version... |
We would definitely have a "UCX-CUDA" even with the OMPI_MCA_component_path approach, and I don't think there would be an issue depending on that directly if necessary with either approach |
Upon further investigation the UCX plugin architecture is not flexible enough for our purpose. The reason is that the list of plugins to load is set at configure time: for us this is:
in
for CUDA. UCX parses this list to figure out which plugins to load. Open MPI's plugin architecture is more flexible, though messing about with |
Note about Intel MPI: this one goes via libfabric which is flexible enough (via
we'd need to have two |
So
|
Why does |
@boegel no, step 0 isn't necessary; only if you want OpenMPI-CUDA to prepend that would be slightly cleaner.
or reading the source code at https://github.com/open-mpi/ompi/blob/92389c364df669822bb6d72de616c8ccf95b891c/opal/mca/base/mca_base_component_repository.c#L215 this is also possible:
|
So we have a working UCX + CUDA split working now. We should just decide on how workflow of how to put the easyconfigs on top of these now. Some loose suggestions have been floating around but nothing concrete. I can only recall hearing objections to all approaches so I doubt we can serve.
For option 2 and 3 we should probably also watch out for how the name |
As of Intel MPI 2019.6 (5 actually but there it is just a tech preview) it requires UCX (https://software.intel.com/content/www/us/en/develop/articles/improve-performance-and-stability-with-intel-mpi-library-on-infiniband.html), so from that point of view we should use UCX-CUDA just to make them identical. I think option 1 is the cleanest one, and it also makes it clearer for users which module they want when they look for CUDA enabled stuff. I don't really like the -CUDA-x.y versionsuffix myself but I'd still go for it. For option 2, shouldn't that be one CUDA-x.y-GCCcore-x.y which depend on CUDAcore and one CUDA-x.y-gompi-z that depends on UCX-CUDA? I.e. depending on at what level the toolchain is it pulls in the required CUDA(core|UCX)? |
Hmmm, for option 1 we probably need to make accomodations in tools/module_naming_scheme/hierarchical_mns.py that CUDA should not change modulepath in this case... |
Yes, we will/are depend on UCX via impi, but it's just whether or not do add ucx-cuda plugins and GPUDirect if you make a
I don't think that does anything useful unless you want to expand modulepaths like in option 3 and define a bunch of toolchain stuff on top of gcc/gompi/foss (so that we can still use dependencies from these levels). Otherwise, they would all just depend on the same UCX-CUDA and nothing else.
When CUDA/CUDAcore is used as an ordinary dependency (not part of a toolchain), this doesn't happen. I managed to build #13282 without modifications and it ends up in |
Seeing #13282 solution 1 actually leads to pretty clean easyconfigs: adding one dep for GPU support, and another dep for GPU communication support. It's also flexible: if, for some reason, a different CUDA version is required for a specific EasyConfig, that can easily be done, because CUDA is not a dependency in some very low level toolchain. One would only have to install a new But, let me see if I get this right: there will then be essentially both a non-cuda I guess in the first case, the All in all, I'm in favour of solution 1. Solution 2 is 'convenient' but indeed a bit dirty that UCX get's pulled in even for non-MPI software. I don't think it's hard to check PRs for sanity in this scenario 1, so if all maintainers know about this approach, it should be ok. Essentially, the only check that needs to be done is: if it's an MPI capable toolchain, and includes CUDA as dep, it has to also include |
And just because a software depends on MPI and CUDA doesn't mean it necessarily needs UCX-CUDA, I think it still needs special directives to use GPUDirect/RDMA stuff. But there is no harm in always enabling the support in UCX. |
I guess you're right. As far as I know the use of GPUDirect requires the MPI_* routines to be called with a GPU pointer as send/receive buffer, instead of calling cudaMempy to copy from GPU to CPU buffer, and then calling your MPI_* routine on the CPU buffer. But it's probably harder to find out if software has such GPU-direct support, than just making sure the support is enabled in UCX :)
This is cool btw. I'd seen the PR, but wasn't sure I understood correctly what was going on. I suspected this was the case though, nice solution. |
I am happy with approach 1. I've done some testing of this but with CUDA 11.2.x (due to the NVIDIA driver version I have available). |
Sure. There will likely be some surprises going forward when we actually start adding stuff, but i think we can sort them out. |
As has been discussed multiple times in zoom and in chat, merging fosscuda+foss, and just using versionsuffixes for CUDA-variants of the (relatively few) easyconfigs that does have CUDA bindings.
One thing holding us back has been the CUDA support in MPI, which prevents us from moving into foss since it's part of the toolchain definitions itself, but now with UCX, it might be possible to get the best of both worlds (I'm going to just dismiss the legacy CUDA stuff in openmpi and just focus on UCX).
We want something that
Can it be done? Maybe; UCX has an environment variable for all the plugins it uses (
ucx_info -f
lists all variables):We could introduce a a UCX-package (
UCX-CUDA
maybe?) which shadows non-CUDA UCX, and we start setting the environment variable;UCX_MODULE_DIR='%(installdir)s/lib/ucx'
and, well, that should be it?
Example UCX-CUDA how i envision it:
We'd then just let a
TensorFlow-2.4.1-foss-2020b-CUDA-11.1.1.eb
have a dependency onUCX-CUDA
(at least indirectly) which is probably the ugliesst thing with this approach.This would remove the need for gcccuda, gompic, fosscuda, and they would all just use suffixes instead (and optionally depend on UCX-CUDA if they have some MPI parts).
@bartoldeman Is this at all close to the approach you envisioned?
The text was updated successfully, but these errors were encountered: