guix-epistemia

Personal Guix channel
Log | Files | Refs

commit a0ec1921379b6848d8e41e98bdc30567d2dbc2f4
parent 3e022392b5aa28674e7d99e9ba75e9d7957fffd1
Author: Vineet Kumar <git@vineetk.net>
Date:   Sat, 14 Nov 2026 20:11:34 +0100

packages/machine-learning: fix incorrect kernel compiler for strata-rdna3

cmake was using clang-20 even though clang-22 was in input.
clang-20 in kernel compilation gave incoherent decoded output.

Diffstat:
Mepistemia/packages/machine-learning.scm | 25++++++++++++++-----------
1 file changed, 14 insertions(+), 11 deletions(-)

diff --git a/epistemia/packages/machine-learning.scm b/epistemia/packages/machine-learning.scm @@ -237,14 +237,16 @@ index c8f60b61..ec17bb20 100644 (build-system cmake-build-system) (arguments (list #:tests? #f ;; failing tests require rocm-capable gpu, which I don't see a way to fix without changing guix-daemon chroot + #:patch-shebangs? #f ;; when true, rewrites bin/strata-server to the bare input python instead of wrapped python #:configure-flags #~(list "-DHIP_PLATFORM=amd" "-DSTRATA_ENABLE_HIP=ON" "-DSTRATA_PREFILL_MMQ=ON" "-DSTRATA_MMQ_KQUANTS=ON" "-DCMAKE_HIP_ARCHITECTURES=gfx1100" ;; this is a rdna3-focused fork - "-DSTRATA_BUILD_TESTS=ON" + "-DSTRATA_BUILD_TESTS=OFF" (string-append "-DSTRATA_GGML_DIR=" #$llama-cpp-source) ;; there isn't a submodule + (string-append "-DCMAKE_HIP_COMPILER=" #$clang-22 "/bin/clang++") ;; incoherent with default clang-20 (string-append "-DCMAKE_HIP_COMPILER_ROCM_ROOT=" #$rocm-hip-runtime) (string-append "-DCMAKE_HIP_FLAGS=--rocm-path=" #$rocm-hip-runtime " --rocm-device-lib-path=" #$rocm-device-libs "/amdgcn/bitcode")) @@ -257,14 +259,13 @@ index c8f60b61..ec17bb20 100644 (let* ((out (assoc-ref outputs "out")) (build (getcwd)) (source (string-append (dirname build) "/source")) - (share (string-append out "/usr/share/strata")) + (share (string-append out "/share/strata")) (libexec (string-append out "/libexec/strata")) (python (assoc-ref inputs "python")) (bash (assoc-ref inputs "bash-minimal")) - (python-dir (car (scandir - (string-append python "/lib") - (lambda (name) - (string-prefix? "python3." name))))) + (python-dir (string-append + "python" + #$(version-major+minor (package-version python)))) (site-packages (lambda (input) (string-append (assoc-ref inputs input) @@ -280,17 +281,17 @@ index c8f60b61..ec17bb20 100644 "python-urllib3")) ":"))) ;; copy engine + (mkdir-p libexec) (install-file (string-append build "/strata") - (string-append out "/lib/strata/engine")) + libexec) ;; copy python tree (for-each (lambda (dir) (copy-recursively (string-append source "/" dir) (string-append share "/" dir))) - '("serve" "tools" "data" "include" "src" "third_party" + '("serve" "tools" "data" "include" "rdna3" "src" "third_party" "strata_control" "strata_cli")) ;; create python wrapper that sets PYTHONPATH - (mkdir-p libexec) (symlink (string-append python "/bin/python3") (string-append libexec "/python3")) (wrap-program (string-append libexec "/python3") @@ -337,6 +338,8 @@ index c8f60b61..ec17bb20 100644 python-urllib3)) (properties '((tunable? . #t))) (home-page "https://github.com/nicejunjie/strata-rdna3") - (synopsis "") - (description "") + (synopsis "Fork of the Strata LLM inference engine, tuned for RDNA3 (gfx1100/RX 7900 XTX).") + (description "Fork of the Strata LLM inference engine, tuned for RDNA3 (gfx1100/RX 7900 XTX). + +Includes optimized kernels, added tensor parallelism, etc.") (license license:expat))))