Skip to content

Commit d26b6de

Browse files
author
Connor Baker
authored
Merge pull request #261654 from ConnorBaker/fix/openai-triton-arm-cuda-support
python3Packages.openai-triton: narrow the definition of broken
2 parents 0280298 + 563f516 commit d26b6de

1 file changed

Lines changed: 16 additions & 3 deletions

File tree

  • pkgs/development/python-modules/openai-triton

pkgs/development/python-modules/openai-triton/llvm.nix

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
{ lib
1+
{ config
2+
, lib
23
, stdenv
34
, fetchFromGitHub
45
, pkg-config
@@ -68,7 +69,17 @@ stdenv.mkDerivation (finalAttrs: {
6869
sourceRoot = "${finalAttrs.src.name}/llvm";
6970

7071
cmakeFlags = [
71-
"-DLLVM_TARGETS_TO_BUILD=X86;AMDGPU;NVPTX"
72+
"-DLLVM_TARGETS_TO_BUILD=${
73+
let
74+
# Targets can be found in
75+
# https://github.com/llvm/llvm-project/tree/f28c006a5895fc0e329fe15fead81e37457cb1d1/clang/lib/Basic/Targets
76+
# NOTE: Unsure of how "host" would function, especially given that we might be cross-compiling.
77+
llvmTargets = [ "AMDGPU" "NVPTX" ]
78+
++ lib.optionals stdenv.isAarch64 [ "AArch64" ]
79+
++ lib.optionals stdenv.isx86_64 [ "X86" ];
80+
in
81+
lib.concatStringsSep ";" llvmTargets
82+
}"
7283
"-DLLVM_ENABLE_PROJECTS=llvm;mlir"
7384
"-DLLVM_INSTALL_UTILS=ON"
7485
] ++ lib.optionals (buildDocs || buildMan) [
@@ -107,6 +118,8 @@ stdenv.mkDerivation (finalAttrs: {
107118
license = with licenses; [ ncsa ];
108119
maintainers = with maintainers; [ SomeoneSerge Madouura ];
109120
platforms = platforms.linux;
110-
broken = stdenv.isAarch64; # https://github.com/RadeonOpenCompute/ROCm/issues/1831#issuecomment-1278205344
121+
# Consider the derivation broken if we're not building for CUDA or ROCm, or if we're building for aarch64
122+
# and ROCm is enabled. See https://github.com/RadeonOpenCompute/ROCm/issues/1831#issuecomment-1278205344.
123+
broken = stdenv.isAarch64 && !config.cudaSupport;
111124
};
112125
})

0 commit comments

Comments
 (0)