Merge pull request #236183 from kira-bruneau/composable_kernel

composable_kernel: revert split output workaround

authored by Kira Bruneau and committed by GitHub 0eeebd64 44362951

+61 -91
+61 -91
pkgs/development/libraries/composable_kernel/default.nix
··· 13 13 , gpuTargets ? [ ] # gpuTargets = [ "gfx803" "gfx900" "gfx1030" ... ] 14 14 }: 15 15 16 - let 17 - # This is now over 3GB, to allow hydra caching we separate it 18 - ck = stdenv.mkDerivation (finalAttrs: { 19 - pname = "composable_kernel"; 20 - version = "unstable-2023-01-16"; 21 - 22 - outputs = [ 23 - "out" 24 - ] ++ lib.optionals buildTests [ 25 - "test" 26 - ] ++ lib.optionals buildExamples [ 27 - "example" 28 - ]; 29 - 30 - # ROCm 5.6 should release composable_kernel as stable with a tag in the future 31 - src = fetchFromGitHub { 32 - owner = "ROCmSoftwarePlatform"; 33 - repo = "composable_kernel"; 34 - rev = "80e05267417f948e4f7e63c0fe807106d9a0c0ef"; 35 - hash = "sha256-+c0E2UtlG/abweLwCWWjNHDO5ZvSIVKwwwettT9mqR4="; 36 - }; 37 - 38 - nativeBuildInputs = [ 39 - cmake 40 - rocm-cmake 41 - hip 42 - clang-tools-extra 43 - ]; 44 - 45 - buildInputs = [ 46 - openmp 47 - ]; 48 - 49 - cmakeFlags = [ 50 - "-DCMAKE_C_COMPILER=hipcc" 51 - "-DCMAKE_CXX_COMPILER=hipcc" 52 - ] ++ lib.optionals (gpuTargets != [ ]) [ 53 - "-DGPU_TARGETS=${lib.concatStringsSep ";" gpuTargets}" 54 - "-DAMDGPU_TARGETS=${lib.concatStringsSep ";" gpuTargets}" 55 - ] ++ lib.optionals buildTests [ 56 - "-DGOOGLETEST_DIR=${gtest.src}" # Custom linker names 57 - ]; 58 - 59 - # No flags to build selectively it seems... 60 - postPatch = lib.optionalString (!buildTests) '' 61 - substituteInPlace CMakeLists.txt \ 62 - --replace "add_subdirectory(test)" "" 63 - '' + lib.optionalString (!buildExamples) '' 64 - substituteInPlace CMakeLists.txt \ 65 - --replace "add_subdirectory(example)" "" 66 - ''; 67 - 68 - postInstall = lib.optionalString buildTests '' 69 - mkdir -p $test/bin 70 - mv $out/bin/test_* $test/bin 71 - '' + lib.optionalString buildExamples '' 72 - mkdir -p $example/bin 73 - mv $out/bin/example_* $example/bin 74 - ''; 16 + stdenv.mkDerivation (finalAttrs: { 17 + pname = "composable_kernel"; 18 + version = "unstable-2023-01-16"; 75 19 76 - passthru.updateScript = unstableGitUpdater { }; 20 + outputs = [ 21 + "out" 22 + ] ++ lib.optionals buildTests [ 23 + "test" 24 + ] ++ lib.optionals buildExamples [ 25 + "example" 26 + ]; 77 27 78 - # Times out otherwise 79 - requiredSystemFeatures = [ "big-parallel" ]; 28 + # ROCm 5.6 should release composable_kernel as stable with a tag in the future 29 + src = fetchFromGitHub { 30 + owner = "ROCmSoftwarePlatform"; 31 + repo = "composable_kernel"; 32 + rev = "80e05267417f948e4f7e63c0fe807106d9a0c0ef"; 33 + hash = "sha256-+c0E2UtlG/abweLwCWWjNHDO5ZvSIVKwwwettT9mqR4="; 34 + }; 80 35 81 - meta = with lib; { 82 - description = "Performance portable programming model for machine learning tensor operators"; 83 - homepage = "https://github.com/ROCmSoftwarePlatform/composable_kernel"; 84 - license = with licenses; [ mit ]; 85 - maintainers = teams.rocm.members; 86 - platforms = platforms.linux; 87 - }; 88 - }); 36 + nativeBuildInputs = [ 37 + cmake 38 + rocm-cmake 39 + hip 40 + clang-tools-extra 41 + ]; 89 42 90 - in stdenv.mkDerivation { 91 - inherit (ck) pname version outputs src passthru requiredSystemFeatures meta; 43 + buildInputs = [ 44 + openmp 45 + ]; 92 46 93 - dontUnpack = true; 94 - dontPatch = true; 95 - dontConfigure = true; 96 - dontBuild = true; 47 + cmakeFlags = [ 48 + "-DCMAKE_C_COMPILER=hipcc" 49 + "-DCMAKE_CXX_COMPILER=hipcc" 50 + ] ++ lib.optionals (gpuTargets != [ ]) [ 51 + "-DGPU_TARGETS=${lib.concatStringsSep ";" gpuTargets}" 52 + "-DAMDGPU_TARGETS=${lib.concatStringsSep ";" gpuTargets}" 53 + ] ++ lib.optionals buildTests [ 54 + "-DGOOGLETEST_DIR=${gtest.src}" # Custom linker names 55 + ]; 97 56 98 - installPhase = '' 99 - runHook preInstall 57 + # No flags to build selectively it seems... 58 + postPatch = lib.optionalString (!buildTests) '' 59 + substituteInPlace CMakeLists.txt \ 60 + --replace "add_subdirectory(test)" "" 61 + '' + lib.optionalString (!buildExamples) '' 62 + substituteInPlace CMakeLists.txt \ 63 + --replace "add_subdirectory(example)" "" 64 + ''; 100 65 101 - mkdir -p $out 102 - cp -an ${ck}/* $out 103 - '' + lib.optionalString buildTests '' 104 - cp -a ${ck.test} $test 66 + postInstall = lib.optionalString buildTests '' 67 + mkdir -p $test/bin 68 + mv $out/bin/test_* $test/bin 105 69 '' + lib.optionalString buildExamples '' 106 - cp -a ${ck.example} $example 107 - '' + '' 108 - runHook postInstall 70 + mkdir -p $example/bin 71 + mv $out/bin/example_* $example/bin 109 72 ''; 110 73 111 - # Fix paths 112 - preFixup = '' 113 - substituteInPlace $out/lib/cmake/composable_kernel/*.cmake \ 114 - --replace "${ck}" "$out" 115 - ''; 116 - } 74 + passthru.updateScript = unstableGitUpdater { }; 75 + 76 + # Times out otherwise 77 + requiredSystemFeatures = [ "big-parallel" ]; 78 + 79 + meta = with lib; { 80 + description = "Performance portable programming model for machine learning tensor operators"; 81 + homepage = "https://github.com/ROCmSoftwarePlatform/composable_kernel"; 82 + license = with licenses; [ mit ]; 83 + maintainers = teams.rocm.members; 84 + platforms = platforms.linux; 85 + }; 86 + })