summaryrefslogtreecommitdiff
path: root/pkgs/development/rocm-modules/composable_kernel/ck4inductor.nix
blob: a5b57743b8eb04dfd859042fe327f58dc1daec17 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
{
  buildPythonPackage,
  python,
  composable_kernel,
  lib,
  rocm-toolchain,
  setuptools,
  setuptools-scm,
}:
buildPythonPackage {
  pyproject = true;
  pname = "ck4inductor";
  build-system = [
    setuptools
    setuptools-scm
  ];
  inherit (composable_kernel) version src sourceRoot;
  pythonImportsCheck = [
    "ck4inductor"
    "ck4inductor.universal_gemm.gen_instances"
    "ck4inductor.universal_gemm.gen_instances"
    "ck4inductor.universal_gemm.op"
  ];
  propagatedBuildInputs = [
    # At runtime will fail to compile anything with ck4inductor without this
    # can't easily use in checks phase because most of the compiler machinery is in torch
    rocm-toolchain
  ];
  checkPhase = ''
    if [ ! -d "$out/${python.sitePackages}/ck4inductor" ]; then
      echo "ck4inductor isn't at the expected location in $out/${python.sitePackages}/ck4inductor"
      exit 1
    fi
  '';
  meta = {
    description = "Pytorch inductor backend which uses composable_kernel universal GEMM implementations";
    homepage = "https://github.com/ROCm/rocm-libraries/tree/develop/projects/composablekernel";
    license = with lib.licenses; [ mit ];
    teams = [ lib.teams.rocm ];
    platforms = lib.platforms.linux;
  };
}