summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorDaniel Ahlin <50445206+danielahlin@users.noreply.github.com>2023-04-21 03:38:40 +0200
committerGitHub <noreply@github.com>2023-04-20 21:38:40 -0400
commitbf970ebf9db6a66d6410e397dd656da7ce56ecc4 (patch)
tree929ff71b47649cd54656ffec5dab32a998e2eef0 /var
parentaf47b9170c7e84e314619ff8fb7b072087483ad8 (diff)
downloadspack-bf970ebf9db6a66d6410e397dd656da7ce56ecc4.tar.gz
spack-bf970ebf9db6a66d6410e397dd656da7ce56ecc4.tar.bz2
spack-bf970ebf9db6a66d6410e397dd656da7ce56ecc4.tar.xz
spack-bf970ebf9db6a66d6410e397dd656da7ce56ecc4.zip
nccl-fastsocket: initial packaging for nccl-fastsocket (#36557)
* nccl-fastsocket: Add NCCL transport plugin for GCP * nccl-fastsocket: remove auto-gen. header and fix maintainers * Update var/spack/repos/builtin/packages/nccl-fastsocket/package.py * nccl-fastsocket: Add rationale for setting LD_LIBRARY_PATH --------- Co-authored-by: Tamara Dahlgren <35777542+tldahlgren@users.noreply.github.com>
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/nccl-fastsocket/package.py65
1 files changed, 65 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/nccl-fastsocket/package.py b/var/spack/repos/builtin/packages/nccl-fastsocket/package.py
new file mode 100644
index 0000000000..f25862b2eb
--- /dev/null
+++ b/var/spack/repos/builtin/packages/nccl-fastsocket/package.py
@@ -0,0 +1,65 @@
+# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other
+# Spack Project Developers. See the top-level COPYRIGHT file for details.
+#
+# SPDX-License-Identifier: (Apache-2.0 OR MIT)
+
+import tempfile
+
+from spack.package import *
+
+
+class NcclFastsocket(Package):
+ """NCCL Fast Socket GCP Net plugin for NCCL"""
+
+ homepage = "https://github.com/google/nccl-fastsocket"
+ git = "https://github.com/google/nccl-fastsocket.git"
+
+ version("master", preferred=True)
+
+ depends_on("bazel", type="build")
+ depends_on("nccl", type=["build", "run"])
+
+ maintainers("danielahlin")
+
+ def setup_build_environment(self, env):
+ spec = self.spec
+ tmp_path = tempfile.mkdtemp(prefix="spack")
+ env.set("TEST_TMPDIR", tmp_path)
+ env.set("NCCL_INSTALL_PATH", spec["nccl"].prefix)
+ env.set("NCCL_HDR_PATH", spec["nccl"].prefix.include)
+
+ def install(self, spec, prefix):
+ tmp_path = env["TEST_TMPDIR"]
+ # Copied of py-tensorflow
+ args = [
+ # Don't allow user or system .bazelrc to override build settings
+ "--nohome_rc",
+ "--nosystem_rc",
+ # Bazel does not work properly on NFS, switch to /tmp
+ "--output_user_root=" + tmp_path,
+ "build",
+ "libnccl-net.so",
+ # Spack logs don't handle colored output well
+ "--color=no",
+ "--jobs={0}".format(make_jobs),
+ # Enable verbose output for failures
+ "--verbose_failures",
+ # Show (formatted) subcommands being executed
+ "--subcommands=pretty_print",
+ # Ask bazel to explain what it's up to
+ # Needs a filename as argument
+ "--explain=explainlogfile.txt",
+ # Increase verbosity of explanation,
+ "--verbose_explanations",
+ ]
+ bazel(*args)
+ install_tree("bazel-bin", prefix.lib)
+
+ def setup_run_environment(self, env):
+ # The current plugin pickup method of NCCL is to scan for libraries with certain
+ # names in the standard library search paths. Consequently, to make nccl-fastsocket
+ # discoverable to NCCL it is necessary to add it to the LD_LIBRARY_PATH.
+ env.prepend_path("LD_LIBRARY_PATH", self.prefix.lib)
+ # NCCL_NET_PLUGIN can be used to change part of the library-name NCCL is looking
+ # for. This is not necessary for this plugin so it is set to the empty string.
+ env.set("NCCL_NET_PLUGIN", "")