Closed behrica closed 5 months ago
I put all in a repro here: https://github.com/scicloj/scicloj.ml.deep-diamond/tree/2055410ba146613dfe9904457d1f99174bc8238d
Running "clj src/scicloj/ml/deep_diamond/core.clj " inside the dev container environment fails as above
MKL as such seems to work, this passes: https://github.com/scicloj/scicloj.ml.deep-diamond/blob/2055410ba146613dfe9904457d1f99174bc8238d/testMKL/DGEMMExample.java
This can be reproduced open the Git Repo above "as codespaces", for example.
I found the solution , which is to set those:
(set! *warn-on-reflection* true)
(set! *assert* false)
(set! *unchecked-math* :warn-on-boxed)
(set! *print-length* 16)
as the hello world project does. Is this expected ?
So this fails:
clj -Sdeps '{:deps {uncomplicate/neanderthal {:mvn/version "0.48.0"} org.bytedeco/mkl$linux-x86_64-redist {:mvn/version "2024.0-1.5.10"}} org.bytedeco/mkl {:mvn/version "2024.0-1.5.10"}}' -e "(use '[uncomplicate.neanderthal core native])"
while this works:
clj -Sdeps '{:deps {uncomplicate/neanderthal {:mvn/version "0.48.0"} org.bytedeco/mkl$linux-x86_64-redist {:mvn/version "2024.0-1.5.10"}} org.bytedeco/mkl {:mvn/version "2024.0-1.5.10"}}' -e "(set! *unchecked-math* :warn-on-boxed)(use '[uncomplicate.neanderthal core native])"
Is this issue related to Deep Diamond or Neanderthal?
Related do Deep Diamond. I tried to get neanderthal code working in Deep Diamond. But It fails on importing neanderthal ns.
I'm asking because in the last listing I can't see reference to Deep Diamond, only Neanderathal.
So, to be precise: Neanderthal 0.48.0 on itself is working for you?
Can you please try to use leiningen and use deep diamond dev dependency as a guide to your isolated hello world (without other libraries), so we can locate the problem?
I think this is the same as my issue: https://app.slack.com/client/T03RZGPFR/C08PLCRGT
The neanderthal "hello world"
works in my environment, when leaving as-is. https://github.com/uncomplicate/neanderthal/tree/master/examples/hello-world
The moment I remove the global var: unchecked-math :warn-on-boxed
it fails, so the following project.clj does not work for me in the hello world:
(defproject hello-world "0.48.0"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.11.1"]
[uncomplicate/neanderthal "0.48.0"]
[org.bytedeco/mkl "2024.0-1.5.10" :classifier linux-x86_64-redist]
[org.bytedeco/cuda "12.3-8.9-1.5.10" :classifier linux-x86_64-redist]
;; On windows, replace the last two lines with:
;;[org.bytedeco/mkl "2024.0-1.5.10" :classifier windows-x86_64-redist]
;;[org.bytedeco/cuda "12.3-8.9-1.5.10" :classifier windows-x86_64-redist]
]
;; :jvm-opts ^:replace ["-Dclojure.compiler.direct-linking=true"
;; "-XX:MaxDirectMemorySize=16g" "-XX:+UseLargePages"]
:global-vars {*warn-on-reflection* true
*assert* false
;; not setting *unchecked-math* :warn-on-boxed
*print-length* 16})
Same behaviour with my code based on deps.edn. The following does work, while I keep setting :unckecked-math to :warn-on-boxed Without it, it fails with "integer overflow" on the "(use ..)" line.
(ns scicloj.ml.deep-diamond.core)
(set! *unchecked-math* :warn-on-boxed)
(use '[uncomplicate.neanderthal core native])
(def x (dv 1 2 3))
(def y (dv 10 20 30))
(dot x y)
Hmm... I am not able to reproduce it. Do you have another machine available where you could try it? Maybe it's related to your specific environment?
Can you please try adding
:jvm-opts ^:replace ["-Dclojure.compiler.direct-linking=true"]
It is related to reflection warnings, but might be somehow connected, so it's worth trying...
I tried it, makes no difference.
Fixed in 0.28.1.
By using
uncomplicate/deep-diamond {:mvn/version "0.27.0"}
as deps in my project, I cannot get neanderthal working.fails with