Skip to content
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

[NCCL] 2.19.4 build from source #7794

Merged
merged 13 commits into from
Dec 15, 2023
11 changes: 0 additions & 11 deletions N/NCCL/build_11.0.jl

This file was deleted.

11 changes: 0 additions & 11 deletions N/NCCL/build_12.0.jl

This file was deleted.

11 changes: 0 additions & 11 deletions N/NCCL/build_12.2.jl

This file was deleted.

66 changes: 38 additions & 28 deletions N/NCCL/build_tarballs.jl
Original file line number Diff line number Diff line change
@@ -1,48 +1,58 @@
# Note that this script can accept some limited command-line arguments, run
# `julia build_tarballs.jl --help` to see a usage message
using BinaryBuilder, Pkg
using Base.BinaryPlatforms: arch, os

const YGGDRASIL_DIR = "../.."
include(joinpath(YGGDRASIL_DIR, "fancy_toys.jl"))
include(joinpath(YGGDRASIL_DIR, "platforms", "cuda.jl"))

name = "NCCL"
version = v"2.18.5"
build = 1
version = v"2.19.4"

# Collection of sources required to complete build
sources = [
GitSource("https://github.com/NVIDIA/nccl.git", "88d44d777f6970bdbf6610badcbd7e25a05380f0"),
]

# Bash recipe for building across all platforms
script = raw"""
mkdir -p ${libdir} ${prefix}/include
cd $WORKSPACE/srcdir

cd ${WORKSPACE}/srcdir/nccl*
find .
export TMPDIR=${WORKSPACE}/tmpdir
export CUDA_HOME=${WORKSPACE}/destdir/cuda
export CUDA_LIB=${CUDA_HOME}/lib
export CXXFLAGS='-D__STDC_FORMAT_MACROS'
export CUDARTLIB=cudart

install_license LICENSE.txt
simonbyrne marked this conversation as resolved.
Show resolved Hide resolved
mkdir -p ${TMPDIR}

mv lib/libnccl*.so* ${libdir}
mv include/* ${prefix}/include
cd nccl
make -j pkg.txz.build
tar -xJf build/pkg/txz/*.txz -C ${WORKSPACE}/destdir --strip-components=1
"""

augment_platform_block = CUDA.augment
# These are the platforms we will build for by default, unless further
# platforms are passed in on the command line
platforms = CUDA.supported_platforms()
filter!(p -> arch(p) == "x86_64", platforms)

products = [
LibraryProduct("libnccl", :libnccl),
]

dependencies = [RuntimeDependency(PackageSpec(name="CUDA_Runtime_jll"))]

# TODO: how does compatibility work here exactly? do we support 11.0-12.2?
# are we correctly selecting artifacts in that case?
builds = ["11.0", "12.0", "12.2"]
for build in builds
include("build_$(build).jl")
cuda_version = VersionNumber(build)

for (platform, sources) in platforms_and_sources
augmented_platform = Platform(arch(platform), os(platform);
cuda=CUDA.platform(cuda_version))
should_build_platform(triplet(augmented_platform)) || continue
build_tarballs(ARGS, name, version, sources, script, [augmented_platform],
products, dependencies; lazy_artifacts=true,
julia_compat="1.6", augment_platform_block,
skip_audit=true, dont_dlopen=true)
end
# Dependencies that must be installed before this package can be built
dependencies = [
HostBuildDependency("coreutils_jll"), # requires fmt
Dependency(PackageSpec(name="CompilerSupportLibraries_jll", uuid="e66e0078-7015-5450-92f7-15fbd957f2ae")),
]

# Build for all supported CUDA toolkits
for platform in platforms
should_build_platform(triplet(platform)) || continue

cuda_deps = CUDA.required_dependencies(platform)

build_tarballs(ARGS, name, version, sources, script, [platform],
products, [dependencies; cuda_deps]; lazy_artifacts=true,
julia_compat="1.6", CUDA.augment)
end