-
Notifications
You must be signed in to change notification settings - Fork 7
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
Enable use as a spack repo #55
Conversation
@kab163 I wasn't sure who to tag on this. |
That's ok! I'll take a look myself and I know Adrien can help too. Lucky for @davidbeckingsale he is on vacation right now, or I'd tag him too lol. Thanks Aaron! (Update, tagged David anyways just to give him more emails to sort through when he gets back!) |
@kab163 That’s funny because in the end you did @ mention David and not me. @white238 @chapman39, please join the party: this is the first example of issue using a legitimate spack repo instead of hot-copying the packages, and I fear that Cyrus might be right to worry about that... |
I'm currently building a code called 'fedtra' and I'm pulling from:
Alternatively, I could create a script for our developers that git clones each of these repos and copies the packages into their spack installation. I'm pretty interested in the pros/cons of each, but so far after @white238 and I have chatted, using multiple repos to manage this seemed more flexible. Regarding me removing the dependence of packages on functions defined in the camp package, I think you'll have to remove that regardless if you want to merge these back into spack proper at some point. I don't think they'll accept updated to packages that introduce dependencies between packages like this. I think the duplication of the functions will be short term. Some of the logic looks very appropriate to me for getting pushed up into the spack ROCMpackage and CUDApackage parent classes. |
if not spec.satisfies("cuda_arch=none"): | ||
cuda_arch = spec.variants["cuda_arch"].value | ||
cuda_flags.append("-arch sm_{0}".format(cuda_arch[0])) | ||
options.append( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm... spack has a CudaPackage and a CMakePackage.
They need a function in one of those that will provide you the correct CMake lines to enable cuda.
Or a new package that descends from both, as long we don't get into a hairy mess of multiple inheritance combinations. I'm going to poke Todd and a couple others about this.
There are a lot of packages having to do this by hand right now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
newer CMakes do not need this. You just do this:
set(CMAKE_CUDA_ARCHITECTURES "70" CACHE STRING "")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True, if radiuss does not need to maintain compatibility with older cmake some of this can be cleaned up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aaroncblack I believe CMake 3.14.5, which is the default on most LC systems, requires some of this stuff to work. That's why it's still in the RAJA Spack package.
When all systems are updated to TOSS 4 and new defaults (compilers, CMake, etc.) are in place, then some support for older CMake, for example, can be removed from the Spack packages.
cuda_flags = [] | ||
if not spec.satisfies("cuda_arch=none"): | ||
cuda_arch = spec.variants["cuda_arch"].value | ||
cuda_flags.append("-arch sm_{0}".format(cuda_arch[0])) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@adrienbernede On this line, did the cuda_flags() function from the CudaPackage this class descends from not work correctly? That gives the flag '--generate-code arch=compute_' flag. Just curious.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can’t tell. I guess we’ll have to try.
Getting all our packages in the same place was an improvement. Everything we can do to simplify will be welcome.
However, I will postpone the attempt until we complete the toolchain update that is under way.
@aaroncblack you are making several valid points here. And I’m happy to welcome a new user of the radiuss-spack-configs. So I’m going to merge this if you found it works for you. (I will need radiuss-spack-packages as a spack repo too :) ). |
@adrienbernede I'm going to work a bit on making this PR more palatable. Duplicating these functions works but makes your job harder in the long term. I propose creating a radiuss_utilities package (or whatever name radiuss team thinks is appropriate), then import the functions from this packages. Essentially the same as you had for camp, but I think you want them in an independent package class not strictly attached to camp. Both the builtin or repo namespaces can be supported with a couple different import attempts ( thanks, @tgamblin, for the suggestion )
I'll move ahead on that if you think it sounds good. |
Please reverse the order so the priority is put on the radiuss namespace. Unless I missed something? |
Yep @adrienbernede is right -- if both are present (usually the case) you are going to want the RADIUSS one. Sorry about my example. |
I think you could also simplify this a bit an omit the namespace entirely. Like so: import spack.repo
hip_for_radiuss_projects = spack.repo.path.get_pkg_class("HipForRadiussProjects").module This is a bit roundabout and maybe we could introduce some syntactic sugar for it, but I think it works. |
@aaroncblack, because it wasn’t clear: yes, I am supportive of this initiative, so please move ahead 👍🏻 . |
Note: |
I still plan on working on this, just been tackling other higher priority work at present. |
I have a new version locally, but am hitting an issue. I went ahead and created a RadiussPackage class, bundling these utilities together inside it. I put it in a packages/radiusspackage/package.py. However, I am unable to import anything from llnl.radiuss. If I try adding a
I get a
in that example I'm doing it in chai. If I try in umpire, I get that message about umpire, etc. My repo.yaml file has:
|
@adrienbernede I'd say, if you can go ahead and merge this, then let's do it. I'm interested in consolidating the misc functions instead of duplicating, but I that can be a new MR. |
@aaroncblack Thanks for the heads up. In need to experiment with this, definitely, but I am dealing with an issue in spack v0.20.0 that will need to be solved if we want to merge this spack anyways. So, not sure how I’m gonna proceed. Now, if it can help, |
@adrienbernede thanks, I had been using -v, but it slipped my mind to use -d. I'll do that! |
@aaroncblack Let me know how it goes, I’d really like to avoid the duplication implied by this PR, and I wanna help. |
In order to enable this code repo as a spack repo I added a repo.yaml.
I also had to remove the cross-package imports of functions from the camp package and duplicate those helper functions across the packages for cuda, hip, etc, as the import assumed a particular repo namespace for the packages.
The hip_for_radiuss_project and cuda_for_radiuss_project code looks like functionality that Spack should fold into their RocmPackage and CudaPackage.
Relevant issue #54