Code Monkey home page Code Monkey logo

uncomplicate / neanderthal Goto Github PK

View Code? Open in Web Editor NEW
1.1K 42.0 56.0 3.72 MB

Fast Clojure Matrix Library

Home Page: http://neanderthal.uncomplicate.org

License: Eclipse Public License 1.0

Clojure 71.72% Java 1.57% C 11.00% Cuda 9.19% C++ 5.20% Objective-C 1.32%
clojure clojure-library matrix gpu gpu-computing gpgpu opencl cuda high-performance-computing vectorization api matrix-factorization matrix-multiplication matrix-functions matrix-calculations java

neanderthal's Introduction

neanderthal's People

Contributors

blueberry avatar djtango avatar futuro avatar jcf avatar katox avatar mrebbinghaus avatar pawelstroinski avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

neanderthal's Issues

Support primitive array transfer

By now, only native matrices/vectors and clojure seqs are supported.

I have a large primitive array (81m ints). If I transfer this to a clojure seq (and therefore use boxed Objects) I'll use a lot of memory. This doesn't have to be since one can easily put the array directly into the internal ByteBuffer.

files that are named aux on windows

Hi,

I'm trying to follow some of your Deep Learning from Scratch posts and noticed that there's a bit about cloning Neanderthal in one. I tried to do this on a Windows machine and at the checkout stage got a failure message. IIUC, naming a file (before the extension) 'aux' is not something that works on Windows (at least not in 7) -- and this repository has aux.clj in it.

Coincidentally, I hit this problem with a completely different project today -- in that case it was a file named 'aux.cljs'.

I don't know if there's a work-around apart from renaming...

For reference, here are some other incidents:

gajus/react-aux#10
invenia/PowerSystemsUnits.jl#6

Any ideas?

P.S. Can I have an invite to the discussion server mentioned in #50?

(Mac OS) Can not run Nenderthal's OpenCL backend without having CLBlast in my brew repo

I am using version 0.19.0 of Neanderthal and I am on macOS (High Sierra, v10.13.4). For resolving some other issue for the JOCLBlast project, I have previously installed CLBlast in my homebrew repository. And everything worked fine for my exploration of Neanderthal until I have removed the CLBlast from my brew repository. After this, I started getting the following error. I suppose the problem is with JOCLBlast not being shipped with CLBlast binaries. Anyhow, if someone faces the same problem, the current solution is having CLBlast installed by the brew.

Operating system name: Mac OS X Architecture : x86_64 Architecture bit size: 64 ---(start of nested stack traces)--- Stack trace from the attempt to load the library as a file: java.lang.UnsatisfiedLinkError: no JOCLBlast_1_3_0-apple-x86_64 in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1867) at java.lang.Runtime.loadLibrary0(Runtime.java:870) at java.lang.System.loadLibrary(System.java:1122) at org.jocl.LibUtils.loadLibrary(LibUtils.java:136) at org.jocl.blast.CLBlast.<clinit>(CLBlast.java:53) at uncomplicate.neanderthal.internal.device.clblast$eval33083.invokeStatic(clblast.clj:2000) at uncomplicate.neanderthal.internal.device.clblast$eval33083.invoke(clblast.clj:1997) at clojure.lang.Compiler.eval(Compiler.java:7062) at clojure.lang.Compiler.load(Compiler.java:7514) at clojure.lang.RT.loadResourceScript(RT.java:379) at clojure.lang.RT.loadResourceScript(RT.java:370) at clojure.lang.RT.load(RT.java:460) at clojure.lang.RT.load(RT.java:426) at clojure.core$load$fn__6548.invoke(core.clj:6046) at clojure.core$load.invokeStatic(core.clj:6045) at clojure.core$load.doInvoke(core.clj:6029) at clojure.lang.RestFn.invoke(RestFn.java:408) at clojure.core$load_one.invokeStatic(core.clj:5848) at clojure.core$load_one.invoke(core.clj:5843) at clojure.core$load_lib$fn__6493.invoke(core.clj:5888) at clojure.core$load_lib.invokeStatic(core.clj:5887) at clojure.core$load_lib.doInvoke(core.clj:5868) at clojure.lang.RestFn.applyTo(RestFn.java:142) at clojure.core$apply.invokeStatic(core.clj:659) at clojure.core$load_libs.invokeStatic(core.clj:5925) at clojure.core$load_libs.doInvoke(core.clj:5909) at clojure.lang.RestFn.applyTo(RestFn.java:137) at clojure.core$apply.invokeStatic(core.clj:659) at clojure.core$require.invokeStatic(core.clj:5947) at clojure.core$require.doInvoke(core.clj:5947) at clojure.lang.RestFn.invoke(RestFn.java:457) at uncomplicate.neanderthal.opencl$eval17368$loading__6434__auto____17369.invoke(opencl.clj:9) at uncomplicate.neanderthal.opencl$eval17368.invokeStatic(opencl.clj:9) at uncomplicate.neanderthal.opencl$eval17368.invoke(opencl.clj:9) at clojure.lang.Compiler.eval(Compiler.java:7062) at clojure.lang.Compiler.eval(Compiler.java:7051) at clojure.lang.Compiler.load(Compiler.java:7514) at clojure.lang.RT.loadResourceScript(RT.java:379) at clojure.lang.RT.loadResourceScript(RT.java:370) at clojure.lang.RT.load(RT.java:460) at clojure.lang.RT.load(RT.java:426) at clojure.core$load$fn__6548.invoke(core.clj:6046) at clojure.core$load.invokeStatic(core.clj:6045) at clojure.core$load.doInvoke(core.clj:6029) at clojure.lang.RestFn.invoke(RestFn.java:408) at clojure.core$load_one.invokeStatic(core.clj:5848) at clojure.core$load_one.invoke(core.clj:5843) at clojure.core$load_lib$fn__6493.invoke(core.clj:5888) at clojure.core$load_lib.invokeStatic(core.clj:5887) at clojure.core$load_lib.doInvoke(core.clj:5868) at clojure.lang.RestFn.applyTo(RestFn.java:142) at clojure.core$apply.invokeStatic(core.clj:659) at clojure.core$load_libs.invokeStatic(core.clj:5929) at clojure.core$load_libs.doInvoke(core.clj:5909) at clojure.lang.RestFn.applyTo(RestFn.java:137) at clojure.core$apply.invokeStatic(core.clj:659) at clojure.core$require.invokeStatic(core.clj:5947) at clojure.core$require.doInvoke(core.clj:5947) at clojure.lang.RestFn.invoke(RestFn.java:436) at opencl1$eval1426$loading__6434__auto____1427.invoke(opencl1.clj:9) at opencl1$eval1426.invokeStatic(opencl1.clj:9) at opencl1$eval1426.invoke(opencl1.clj:9) at clojure.lang.Compiler.eval(Compiler.java:7062) at clojure.lang.Compiler.eval(Compiler.java:7051) at clojure.lang.Compiler.load(Compiler.java:7514) at user$eval1422.invokeStatic(form-init9065433951007486313.clj:1) at user$eval1422.invoke(form-init9065433951007486313.clj:1) at clojure.lang.Compiler.eval(Compiler.java:7062) at clojure.lang.Compiler.eval(Compiler.java:7025) at clojure.core$eval.invokeStatic(core.clj:3206) at clojure.core$eval.invoke(core.clj:3202) at clojure.main$repl$read_eval_print__8572$fn__8575.invoke(main.clj:243) at clojure.main$repl$read_eval_print__8572.invoke(main.clj:243) at clojure.main$repl$fn__8581.invoke(main.clj:261) at clojure.main$repl.invokeStatic(main.clj:261) at clojure.main$repl.doInvoke(main.clj:177) at clojure.lang.RestFn.invoke(RestFn.java:1523) at clojure.tools.nrepl.middleware.interruptible_eval$evaluate$fn__820.invoke(interruptible_eval.clj:87) at clojure.lang.AFn.applyToHelper(AFn.java:152) at clojure.lang.AFn.applyTo(AFn.java:144) at clojure.core$apply.invokeStatic(core.clj:657) at clojure.core$with_bindings_STAR_.invokeStatic(core.clj:1965) at clojure.core$with_bindings_STAR_.doInvoke(core.clj:1965) at clojure.lang.RestFn.invoke(RestFn.java:425) at clojure.tools.nrepl.middleware.interruptible_eval$evaluate.invokeStatic(interruptible_eval.clj:85) at clojure.tools.nrepl.middleware.interruptible_eval$evaluate.invoke(interruptible_eval.clj:55) at clojure.tools.nrepl.middleware.interruptible_eval$interruptible_eval$fn__865$fn__868.invoke(interruptible_eval.clj:222) at clojure.tools.nrepl.middleware.interruptible_eval$run_next$fn__860.invoke(interruptible_eval.clj:190) at clojure.lang.AFn.run(AFn.java:22) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Stack trace from the attempt to load the library as a resource: java.lang.UnsatisfiedLinkError: /private/var/folders/p5/fq4hp8m11js2p0cvkn0kpwgw0000gn/T/libJOCLBlast_1_3_0-apple-x86_64.dylib: dlopen(/private/var/folders/p5/fq4hp8m11js2p0cvkn0kpwgw0000gn/T/libJOCLBlast_1_3_0-apple-x86_64.dylib, 1): Library not loaded: /usr/local/opt/clblast/lib/libclblast.dylib Referenced from: /private/var/folders/p5/fq4hp8m11js2p0cvkn0kpwgw0000gn/T/libJOCLBlast_1_3_0-apple-x86_64.dylib Reason: image not found at java.lang.ClassLoader$NativeLibrary.load(Native Method) at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1941) at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1824) at java.lang.Runtime.load0(Runtime.java:809) at java.lang.System.load(System.java:1086) at org.jocl.LibUtils.loadLibraryResource(LibUtils.java:269) at org.jocl.LibUtils.loadLibrary(LibUtils.java:151) at org.jocl.blast.CLBlast.<clinit>(CLBlast.java:53) at uncomplicate.neanderthal.internal.device.clblast$eval33083.invokeStatic(clblast.clj:2000) at uncomplicate.neanderthal.internal.device.clblast$eval33083.invoke(clblast.clj:1997) at clojure.lang.Compiler.eval(Compiler.java:7062) at clojure.lang.Compiler.load(Compiler.java:7514) at clojure.lang.RT.loadResourceScript(RT.java:379) at clojure.lang.RT.loadResourceScript(RT.java:370) at clojure.lang.RT.load(RT.java:460) at clojure.lang.RT.load(RT.java:426) at clojure.core$load$fn__6548.invoke(core.clj:6046) at clojure.core$load.invokeStatic(core.clj:6045) at clojure.core$load.doInvoke(core.clj:6029) at clojure.lang.RestFn.invoke(RestFn.java:408) at clojure.core$load_one.invokeStatic(core.clj:5848) at clojure.core$load_one.invoke(core.clj:5843) at clojure.core$load_lib$fn__6493.invoke(core.clj:5888) at clojure.core$load_lib.invokeStatic(core.clj:5887) at clojure.core$load_lib.doInvoke(core.clj:5868) at clojure.lang.RestFn.applyTo(RestFn.java:142) at clojure.core$apply.invokeStatic(core.clj:659) at clojure.core$load_libs.invokeStatic(core.clj:5925) at clojure.core$load_libs.doInvoke(core.clj:5909) at clojure.lang.RestFn.applyTo(RestFn.java:137) at clojure.core$apply.invokeStatic(core.clj:659) at clojure.core$require.invokeStatic(core.clj:5947) at clojure.core$require.doInvoke(core.clj:5947) at clojure.lang.RestFn.invoke(RestFn.java:457) at uncomplicate.neanderthal.opencl$eval17368$loading__6434__auto____17369.invoke(opencl.clj:9) at uncomplicate.neanderthal.opencl$eval17368.invokeStatic(opencl.clj:9) at uncomplicate.neanderthal.opencl$eval17368.invoke(opencl.clj:9) at clojure.lang.Compiler.eval(Compiler.java:7062) at clojure.lang.Compiler.eval(Compiler.java:7051) at clojure.lang.Compiler.load(Compiler.java:7514) at clojure.lang.RT.loadResourceScript(RT.java:379) at clojure.lang.RT.loadResourceScript(RT.java:370) at clojure.lang.RT.load(RT.java:460) at clojure.lang.RT.load(RT.java:426) at clojure.core$load$fn__6548.invoke(core.clj:6046) at clojure.core$load.invokeStatic(core.clj:6045) at clojure.core$load.doInvoke(core.clj:6029) at clojure.lang.RestFn.invoke(RestFn.java:408) at clojure.core$load_one.invokeStatic(core.clj:5848) at clojure.core$load_one.invoke(core.clj:5843) at clojure.core$load_lib$fn__6493.invoke(core.clj:5888) at clojure.core$load_lib.invokeStatic(core.clj:5887) at clojure.core$load_lib.doInvoke(core.clj:5868) at clojure.lang.RestFn.applyTo(RestFn.java:142) at clojure.core$apply.invokeStatic(core.clj:659) at clojure.core$load_libs.invokeStatic(core.clj:5929) at clojure.core$load_libs.doInvoke(core.clj:5909) at clojure.lang.RestFn.applyTo(RestFn.java:137) at clojure.core$apply.invokeStatic(core.clj:659) at clojure.core$require.invokeStatic(core.clj:5947) at clojure.core$require.doInvoke(core.clj:5947) at clojure.lang.RestFn.invoke(RestFn.java:436) at opencl1$eval1426$loading__6434__auto____1427.invoke(opencl1.clj:9) at opencl1$eval1426.invokeStatic(opencl1.clj:9) at opencl1$eval1426.invoke(opencl1.clj:9) at clojure.lang.Compiler.eval(Compiler.java:7062) at clojure.lang.Compiler.eval(Compiler.java:7051) at clojure.lang.Compiler.load(Compiler.java:7514) at user$eval1422.invokeStatic(form-init9065433951007486313.clj:1) at user$eval1422.invoke(form-init9065433951007486313.clj:1) at clojure.lang.Compiler.eval(Compiler.java:7062) at clojure.lang.Compiler.eval(Compiler.java:7025) at clojure.core$eval.invokeStatic(core.clj:3206) at clojure.core$eval.invoke(core.clj:3202) at clojure.main$repl$read_eval_print__8572$fn__8575.invoke(main.clj:243) at clojure.main$repl$read_eval_print__8572.invoke(main.clj:243) at clojure.main$repl$fn__8581.invoke(main.clj:261) at clojure.main$repl.invokeStatic(main.clj:261) at clojure.main$repl.doInvoke(main.clj:177) at clojure.lang.RestFn.invoke(RestFn.java:1523) at clojure.tools.nrepl.middleware.interruptible_eval$evaluate$fn__820.invoke(interruptible_eval.clj:87) at clojure.lang.AFn.applyToHelper(AFn.java:152) at clojure.lang.AFn.applyTo(AFn.java:144) at clojure.core$apply.invokeStatic(core.clj:657) at clojure.core$with_bindings_STAR_.invokeStatic(core.clj:1965) at clojure.core$with_bindings_STAR_.doInvoke(core.clj:1965) at clojure.lang.RestFn.invoke(RestFn.java:425) at clojure.tools.nrepl.middleware.interruptible_eval$evaluate.invokeStatic(interruptible_eval.clj:85) at clojure.tools.nrepl.middleware.interruptible_eval$evaluate.invoke(interruptible_eval.clj:55) at clojure.tools.nrepl.middleware.interruptible_eval$interruptible_eval$fn__865$fn__868.invoke(interruptible_eval.clj:222) at clojure.tools.nrepl.middleware.interruptible_eval$run_next$fn__860.invoke(interruptible_eval.clj:190) at clojure.lang.AFn.run(AFn.java:22) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) ---(end of nested stack traces)--- , compiling:(uncomplicate/neanderthal/internal/device/clblast.clj:1997:1)

uncomplicate.neanderthal.linalg/org error in 0.25.3

The following code worked in 0.24.0:

  (require '[uncomplicate.neanderthal.linalg :as linear-algebra]
           '[uncomplicate.neanderthal.native :as native]
           `[uncomplicate.neanderthal.core :as neanderthal])
  (let [a (native/dge [[1.0 2.0] [3.0 2.0] [6.0 2.0] [5.0 3.0]])
        qr (linear-algebra/qrf a)
        q (linear-algebra/org qr)]
    q)

Updating to 0.25.3 gives the following error:

Intel MKL ERROR: Parameter 2 was incorrect on entry to DORGQR.
Syntax error compiling at (/home/davedixon/Projects/Compute/math/src/provisdom/math/neanderthal_matrix.clj:249:3).
There has been an illegal argument in the native function call.
	at clojure.lang.Compiler.load(Compiler.java:7648)
clojure.lang.ExceptionInfo: There has been an illegal argument in the native function call. {:arg-index 3}
	at uncomplicate.neanderthal.internal.host.mkl.DoubleGEEngine.gqr(mkl.clj:904)
	at uncomplicate.neanderthal.internal.api$eval13429$fn__13654$G__13403__13658.invoke(api.clj:59)
	at uncomplicate.neanderthal.internal.api$eval13429$fn__13654$G__13402__13663.invoke(api.clj:59)
	at uncomplicate.neanderthal.internal.common.OrthogonalFactorization.org(common.clj:288)
	at uncomplicate.neanderthal.linalg$org.invokeStatic(linalg.clj:419)
	at uncomplicate.neanderthal.linalg$org.invoke(linalg.clj:409)
	at provisdom.math.neanderthal_matrix$eval31890.invokeStatic(neanderthal_matrix.clj:251)
...

Looking at the commits from 0.24.0 to 0.25.3, I guessed that native/dge as used above would return the transpose of what it did previously, and indeed the following works as before:

(let [a (neanderthal/trans (native/dge [[1.0 2.0] [3.0 2.0] [6.0 2.0] [5.0 3.0]]))
        qr (linear-algebra/qrf a)
        q (linear-algebra/org qr)]
    q)

Not sure why linear-algebra/org fails in the first case, when linear-algebra/qrf runs, perhaps something I'm misunderstanding about the underlying implementation.

Hello World run with MKL libraries and $LD_LIBRARY_PATH

I copied the Hello World example, but when executing it with a REPL it throws an error.

project.clj

(defproject basic "0.1.0-SNAPSHOT"
  :dependencies [[org.clojure/clojure "1.10.0"]
                 [uncomplicate/neanderthal "0.22.1"]]
  :exclusions [[org.jcuda/jcuda-natives :classifier "apple-x86_64"]
               [org.jcuda/jcublas-natives :classifier "apple-x86_64"]])

core.clj

(ns basic.core
  (:use [uncomplicate.neanderthal core native]))

(dv 1 2 3)

repl:

Error printing return value (NoClassDefFoundError) at uncomplicate.neanderthal.internal.host.mkl.DoubleVectorEngine/iamax (mkl.clj:395).
Could not initialize class uncomplicate.neanderthal.internal.host.CBLASj

system:

$ lein version
Leiningen 2.9.1 on Java 11.0.2 OpenJDK 64-Bit Server VM

CUDA 10.1 libJCublas2 .so loading issue

Hi,

I was working through the install of the CUDA Hello World demos (MKL has been fine) and I'm getting an exception when libJCublas is trying to load a non-existent shared object. The Nvidia CUDA installation has been completed.

Is this because 10.1 is too new or should the linking be looking for the 10 series libcublas.so.10 as oppose to libcublas.so.10.0?

It sounds similar to this downstream issue, but I'm unsure if it is exactly the same problem.
jcuda/jcuda-main#24

Setup

Linux Mint (Ubuntu 18.04)
Java 1.8.0_201
Leiningen 2.9.1 on Java 1.8.0_201 Java HotSpot(TM) 64-Bit Server VM

Relevant Stacktrace

Stack trace from the attempt to load the library as a resource:
java.lang.UnsatisfiedLinkError: /tmp/libJCublas2-10.0.0-linux-x86_64.so: libcublas.so.10.0: cannot open shared object file: No such file or directory
	at java.lang.ClassLoader$NativeLibrary.load(Native Method)
	at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1941)
	at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1824)
	at java.lang.Runtime.load0(Runtime.java:809)
	at java.lang.System.load(System.java:1086)
	at jcuda.LibUtils.loadLibraryResource(LibUtils.java:260)
	at jcuda.LibUtils.loadLibrary(LibUtils.java:158)
	at jcuda.jcublas.JCublas2.initialize(JCublas2.java:81)
	at jcuda.jcublas.JCublas2.<clinit>(JCublas2.java:66)
	at uncomplicate.neanderthal.internal.device.cublas$fn__38049.invokeStatic(cublas.clj:2007)

Shared Objects Present

λ megadrive scorpion → λ git master* → locate libcublas
/usr/lib/x86_64-linux-gnu/libcublas.so
/usr/lib/x86_64-linux-gnu/libcublas.so.10
/usr/lib/x86_64-linux-gnu/libcublas.so.10.1.0.105
/usr/lib/x86_64-linux-gnu/libcublasLt.so
/usr/lib/x86_64-linux-gnu/libcublasLt.so.10
/usr/lib/x86_64-linux-gnu/libcublasLt.so.10.1.0.105
/usr/lib/x86_64-linux-gnu/libcublasLt_static.a
/usr/lib/x86_64-linux-gnu/libcublas_static.a
/usr/lib/x86_64-linux-gnu/stubs/libcublas.so
/usr/lib/x86_64-linux-gnu/stubs/libcublasLt.so

Relevant Project CLJ

  :dependencies [[org.clojure/clojure            "1.10.0"]
                           [uncomplicate/neanderthal       "0.22.1"]]

Thank you.

Unresolved classname: FullStorage

Hello,

I installed MKL on my Ubuntu 17.10 just fine.
I had a couple issues getting emacs to load my environment variables so I got rid of my libmkl_rt.so: no such file or directory errors.

(Context: I'm requiring the 0.17.2 version)

But now when I try to evaluate

(ns dummy.example
  (:require [uncomplicate.neanderthal
             [core :refer :all]
             [native :refer :all]]))

It gives me this:

[.... bunch of logger errors...]
CompilerException java.lang.IllegalArgumentException: Unable to resolve classname: FullStorage, compiling:(uncomplicate/neanderthal/internal/host/mkl.clj:710:5) 

Did I do something wrong or is this a bug?

core compiles just fine. It's native that gives this error.

Provide graphs for benchmarks

Thanks for putting together the benchmarks, that's really helpful. It would be nice to be able to see a graph (perhaps on a log scale) to understand the numbers better. Perhaps reducing all numbers to 1 or 0 decimal places would make them easier to read too.

Support for arbitrary subvector views?

Hi, I am using neanderthal to do a particular kind of FEM calculations, for which it would be desirable to have vectors of element nodes that are only references to the data of all nodes, so that v(i) = N(some_arbitrary_f(i)), where N has considerably more elements than v. I saw that neanderthal already supports subvectors for consecutive indices. Is there an easy way to add more general views in the way described above, maybe by implementing the listed protocols?

Sum operation in CUDA versus MKL

Sum operation in CUDA versus MKL

Hi Dragan, It looks like the sum operation is only taking the first 32 rows or cols of the Matrix in CUDA.

Native seems fine. Examples below.

Native

(ns nz.co.arachnid.scorpion.matrixnative
  (:use [uncomplicate.neanderthal core native]))

;; Intel MKL Version

(defn large-square-matrix-mult-native
  "Demo function to do large square Matrix multiplications and time them."
  [n]
  (let [cnt        n
        matrix-a   (fge cnt cnt (repeat 1))
        matrix-b   (copy matrix-a)]
    (time
      (let [result (mm 1.0 matrix-a matrix-b)]
          ;; Return the Matrix and the sum of its elements
          {:sum-of-elements   (rationalize (sum result))
           :matrix            result}))))

(comment
  (large-square-matrix-mult-native 8) ;; 512
  (large-square-matrix-mult-native 16) ;; 4096
  (large-square-matrix-mult-native 32) ;; 32768
  (large-square-matrix-mult-native 64) ;; 262144 = 64 * 64 * 64
  (large-square-matrix-mult-native 128)) ;; 2097152 = 128 * 128 * 128

CUDA

(ns nz.co.arachnid.scorpion.matrixcuda
  (:require [uncomplicate.clojurecuda.core :refer :all])
  (:use [uncomplicate.neanderthal core cuda]))

(init)

;; =======================
;; Large Matrix Operations
;; =======================

(defn large-square-matrix-mult-cuda
  "Demo function to do large square Matrix multiplications and time them."
  [n]
  (with-default
    (with-default-engine
      (let [cnt        n
            matrix-a   (cuge cnt cnt (repeat 1))
            matrix-b   (copy matrix-a)]
        (time
          (let [result (mm 1.0 matrix-a matrix-b)]
            ;; Return the Matrix and the sum of its elements
            {:sum-of-elements       (rationalize (sum result))
             :matrix                result}))))))

(comment
  (large-square-matrix-mult-cuda 8) ;; 512
  (large-square-matrix-mult-cuda 16) ;; 4096
  (large-square-matrix-mult-cuda 32) ;; 32768
  (large-square-matrix-mult-cuda 64) ;; 131072 = 32 * 64 * 64
  (large-square-matrix-mult-cuda 128)) ;; 524288 = 32 * 128 * 128

mm! doesn't seem to work with symmetric matrices

Maybe I'm having some issue with my reading comprehension, or there is a bug

In the docs for mm! it says

If called with only 2 matrices, a and b, multiplies matrix a by a matrix b, and puts the
result in the one that is a GE matrix. In this case, exactly one of a or b has to be,
and one not be a GE matrix, but TR, or SY, or a matrix type that supports in-place multiplication.

I apologize in advance b/c I'm having a bit of trouble cooking up a simple example (b/c I don't know how to write a symmetric matrix by hand), but hopefully this illustrates the issue:

> (def A (dge [[43.0 36.0 38.0 90.0]
		[21.0 98.0 55.0 48.0]
		[72.0 13.0 98.0 12.0]
		[28.0 38.0 73.0 20.0]]))
#'linearsystems-part2.core/A
> (first-column-reflector A)
#RealUploMatrix[double, type:sy, mxn:4x4, layout:column, offset:0]
   ▥       ↓       ↓       ↓       ↓       ┓    
   →       0.38    *       *       *            
   →       0.32    0.83    *       *            
   →       0.34   -0.17    0.82    *            
   →       0.80   -0.41   -0.44   -0.03         
   ┗                                       ┛    
> (mm! (first-column-reflector A)
        A)
Execution error (ExceptionInfo) at uncomplicate.neanderthal.internal.host.mkl.DoubleSYEngine/mm (mkl.clj:1692).
In-place mm! is not supported for SY matrices.

Basically I've got some code in (first-column-reflector ..) that spits out a symmetric matrix and yet I can't multiply in-place a GE and SY matrix like the docs say I should be able to

Or am I doing something wrong?

Memory leak?

When using this package to perform computations over large numbers of matrices, the JVM keeps crashing due to running out of memory. I see that you recommend using the uncomplicate.commons.core/with-release method to release memory. But that doesn't seem to fix the problem. I've been using the native-double factory. The code I've been using is below:

(ns linear-algebra
  (:require [uncomplicate.commons.core :as uncomplicate]
            [uncomplicate.neanderthal.core :as thal]
            [uncomplicate.neanderthal.real :as thal-real]))

(defn unit-vec
  [factory v]
  (uncomplicate/let-release [v (thal/vctr factory v)
                             alpha-1 (thal/nrm2 v)
                             alpha (/ alpha-1)
                             result (thal/scal alpha v)]
    (seq result)))

(defn cosine-sim
  [factory v1 v2]
  (uncomplicate/let-release [v1 (unit-vec factory v1)
                             v2 (unit-vec factory v2)
                             result (thal/dot v1 v2)]
    result))

(defn unit-vec-sum
  [factory & vectors]
  (let [vectors (keep seq vectors)]
    (if (seq vectors)
      (->> vectors
           (reduce (fn [v1 v2]
                     (if v1
                       (uncomplicate/let-release [v1 (thal/vctr factory v1)
                                                  v2 (thal/vctr factory v2)
                                                  sum-v (thal/xpy v1 v2)]
                         (seq sum-v))
                       v2))
                   nil)
           (unit-vec factory)))))


(defn vectors->matrix
  [{:keys [factory]} vectors]
  (let [d (some #(count %) vectors)]
    (->> vectors
         (mapcat seq)
         (thal/ge factory d (count vectors)))))

(defn mdot
  [{:keys [vector-fn] :as params} s1 s2]
  (let [v1 (map vector-fn s1)
        v2 (map vector-fn s2)]
    (uncomplicate/let-release [s1-mat (vectors->matrix params v1)
                               s1-mat-trans (thal/trans s1-mat)
                               s2-mat (vectors->matrix params v2)]
      #_(log/info #_(thal/mrows s1) #_(thal/ncols s1) #_(thal/mrows s2) #_(thal/ncols s2))
      (thal/mm s1-mat-trans s2-mat))))


(defn best-in-row-from-matrix
  [score-mat init i s]
  (->> s
       (map-indexed vector)
       (reduce
         (fn [{:keys [score] :as best} [j s]]
           (uncomplicate/let-release [new-score (thal-real/entry score-mat i j)]
             (if (< score new-score)
               {:match s :score (float new-score)}
               best)))
         init)))

(defn find-best-match
  [params s1 s2]
  (uncomplicate/let-release [score-mat (mdot params s1 s2)]
    (when score-mat
      (->> s1
           (map-indexed vector)
           (reduce
             (fn [best [i sample]]
               (-> (best-in-row-from-matrix score-mat best i s2)
                   (assoc :sample sample)))
             {:score 0})))))

(defn find-best-row-matches
  [params s1 s2]
  (uncomplicate/let-release [score-mat (mdot params s1 s2)]
    (when score-mat
      (->> s1
           (map-indexed (fn [i sample]
                          (-> score-mat
                              (best-in-row-from-matrix {:score 0} i s2)
                              (assoc :sample sample))))
           (doall)))))

Library `neanderthal-mkl-0.23.0.dll` not found!

I have been using neanderthal for about a year for my personal project. I had been using clojure 1.8.0 and neanderthal 0.22.0 on my Windows 10 (and also Fedora Linux, but this issue shall focus on Windows 10).

I had a problem with my old laptop and had to re-setup my clojure environment on my current laptop. Everything clojure related worked except neanderthal. First there was the issue with jcuda and jcublas (my work does not use GPU computing) which was annoying but it got fixed looking at the hello-world example; not to mention most advices here are Mac based so I had to tinker around for Windows.

My project.clj looks like this

(defproject test "0.1.0-SNAPSHOT"
  :description "FIXME: write description"
  :url "http://example.com/FIXME"
  :license {:name "EPL-2.0 OR GPL-2.0-or-later WITH Classpath-exception-2.0"
            :url "https://www.eclipse.org/legal/epl-2.0/"}
  :dependencies [[org.clojure/clojure "1.10.0"]
                           [uncomplicate/neanderthal "0.23.1"]]
  :exclusions [org.jcuda/jcuda-natives org.jcuda/jcublas-natives]
  :plugins [[lein-with-env-vars "0.2.0"]]
  :env-vars {:PATH "C:\\Program Files\\clojure\\dll_for_neanderthal"}
  :repl-options {:init-ns test.core})

Anyways, I can now start neanderthal as shown below

>lein with-env-vars repl

Then,

test.core=> (ns example
       #_=>   (:use [uncomplicate.neanderthal core native]))
nil
example=> (def x (dv 1 2 3))
#'example/x
example=> (def y (dv 10 20 30))

It's just that currently it's practically unusable because when I call

#'example/y
example=> (dot x y)

it returns

java.lang.RuntimeException: Library 'neanderthal-mkl-0.23.0.dll' not found!
        at uncomplicate.neanderthal.internal.host.NarSystem.getLibPath(NarSystem.java:172)
        at uncomplicate.neanderthal.internal.host.NarSystem.loadLibrary(NarSystem.java:45)
        at uncomplicate.neanderthal.internal.host.CBLAS.<clinit>(CBLAS.java:29)
        at uncomplicate.neanderthal.internal.host.mkl.DoubleVectorEngine.dot(mkl.clj:423)
        at uncomplicate.neanderthal.core$dot.invokeStatic(core.clj:886)
        at uncomplicate.neanderthal.core$dot.invoke(core.clj:875)
        at example$eval29001.invokeStatic(form-init6432747691677904219.clj:1)
        at example$eval29001.invoke(form-init6432747691677904219.clj:1)
        at clojure.lang.Compiler.eval(Compiler.java:7176)
        at clojure.lang.Compiler.eval(Compiler.java:7131)
        at clojure.core$eval.invokeStatic(core.clj:3214)
        at clojure.core$eval.invoke(core.clj:3210)
        at clojure.main$repl$read_eval_print__9068$fn__9071.invoke(main.clj:414)
        at clojure.main$repl$read_eval_print__9068.invoke(main.clj:414)
        at clojure.main$repl$fn__9077.invoke(main.clj:435)
        at clojure.main$repl.invokeStatic(main.clj:435)
        at clojure.main$repl.doInvoke(main.clj:345)
        at clojure.lang.RestFn.invoke(RestFn.java:1523)
        at nrepl.middleware.interruptible_eval$evaluate.invokeStatic(interruptible_eval.clj:79)
        at nrepl.middleware.interruptible_eval$evaluate.invoke(interruptible_eval.clj:55)
        at nrepl.middleware.interruptible_eval$interruptible_eval$fn__939$fn__943.invoke(interruptible_eval.clj:142)
        at clojure.lang.AFn.run(AFn.java:22)
        at nrepl.middleware.session$session_exec$main_loop__1040$fn__1044.invoke(session.clj:171)
        at nrepl.middleware.session$session_exec$main_loop__1040.invoke(session.clj:170)
        at clojure.lang.AFn.run(AFn.java:22)
        at java.lang.Thread.run(Unknown Source)
Execution error at uncomplicate.neanderthal.internal.host.NarSystem/getLibPath (NarSystem.java:172).
Library 'neanderthal-mkl-0.23.0.dll' not found!

So I went back and checked my Intel MKL installation, checked my path and made sure I got the listed libraries. I also made sure I ran mklvars.bat. However none of these efforts fixed it.

I then wondered if the reason I could not run neanderthal was because I had installed 2019 MKL because

Neanderthal has been built and tested with Intel MKL 2018; please make sure that you use a compatible MKL version.

So I uninstalled the 2019 MKL and installed the MKL 2018.4.274. This still did not fix it.

Why am I getting ?

java.lang.RuntimeException: Library 'neanderthal-mkl-0.23.0.dll' not found!

i.e., why is it searching for neanderthal-mkl-0.23.0.dll? and how do I fix this? (so than I can continue using neanderthal like before)

Getting pointer to matrix/vector?

Hello, I'd like to use this library but require the following functionality. I can do the work of figuring out how to do it, but I wanted to ask you if it's even possible.

Given a vector or matrix created by, for example, (dv 10) or (dge 2 3) could I access the pointer to the location of that matrix in memory? I have some code that loads data from disk into vectors or matrices across different languages because in MATLAB/NumPy/Julia all matrices are the same in memory (so that BLAS/etc can use them)

I.e. I want to be able to write the following

(def my-matrix (dge 2 3))
(def matrix-pointer (function-i-will-write-to-get-pointer a))
(load-data matrix-pointer ... )
; my-matrix should now have the data loaded
(do-some-calculation my-matrix) 

Call to 'native_sin' is ambiguous

I'm in a macbook pro mid 2012 with a Intel 4000 graphics card with OpenCL 1.2.

I'm trying to run this code

(ns playground
  (:use [uncomplicate.neanderthal core native])
  (:require             
            [uncomplicate.clojurecl.info :as cl-info]
            [uncomplicate.clojurecl.core :as cl]
            [uncomplicate.commons.core :as unc-commons.core :refer [with-release let-release]]
            [uncomplicate.neanderthal
             [native :refer [fv fge native-float]]
             [core :refer [submatrix native asum]]
             [math :refer [sqrt log sin pi sqr]]
             [opencl :refer [clv clge] :as opencl]
             [random :refer [rand-normal! rand-uniform! rng-state]]]))

(cl/with-platform (first (cl/platforms))
    (let [dev (first (cl/sort-by-cl-version (cl/devices :gpu)))]
      (cl/with-context (cl/context [dev])
        (cl/with-queue (cl/command-queue-1 dev)
          (opencl/with-default-engine
            23)))))

Error is

{:name "CL_BUILD_PROGRAM_FAILURE",
 :code -11,
 :type :opencl-error,
 :details
 ({:build-status :error,
   :build-options
   "-DREAL=float -DREAL4=float4 -DWGS=512 -I /var/folders/xl/0gx4mcfd1qv1wvcxvcntqzfw0000gn/T/uncomplicate_10950292996318470328/",
   :build-log "REDACTED"
   :binary-type :none,
   :global-variable-total-size "CL_INVALID_OPERATION"})}

It appears to be that some errors are happening when trying to compile "random.cl", you can see the build log at https://gist.github.com/pfeodrippe/3e093390c5a93d59cc55077edb2011e9.

Documentation clarification for installing MKL on Mac OS X

I stumbled around trying to install MKL and figured out setting DYLD_LIBRARY_PATH on MAC OS X doesn’t work as one might expect anymore because because of system integrity protection (SIP) http://osxdaily.com/2015/10/05/disable-rootless-system-integrity-protection-mac-os-x/

I instead created links from the MKL libs to an existing allowed directory and that seems to work. For example:
ln -s /opt/intel/lib* /usr/local/lib
ln -s /opt/intel/mkl/lib/* /usr/local/lib

This is mentioned the docs (thanks!) but wanted to point out that it may be necessary if you don't want to relax the SIP settings and I thought clearer/stronger suggestion would alert people that this is an option. Thanks again.

Library 'neanderthal-mkl-0.25.0.dll' not found!

Hello
There seems to be a problem with version 0.25.4 i keep getting this error after upgrading from 0.22.1 which works fine, mkl libraries are installed and work fine with 0.22.1

java.lang.RuntimeException: Library 'neanderthal-mkl-0.25.0.dll' not found! at uncomplicate.neanderthal.internal.host.NarSystem.getLibPath(NarSystem.java:172) at uncomplicate.neanderthal.internal.host.NarSystem.loadLibrary(NarSystem.java:45) at uncomplicate.neanderthal.internal.host.MKL.<clinit>(MKL.java:16) at uncomplicate.neanderthal.internal.host.mkl$create_stream_ars5.invokeStatic(mkl.clj:76) at uncomplicate.neanderthal.internal.host.mkl$create_stream_ars5.invoke(mkl.clj:74) at clojure.lang.AFn.applyToHelper(AFn.java:154) at clojure.lang.AFn.applyTo(AFn.java:144) at clojure.lang.Compiler$InvokeExpr.eval(Compiler.java:3702) at clojure.lang.Compiler$DefExpr.eval(Compiler.java:457) at clojure.lang.Compiler.eval(Compiler.java:7182) at clojure.lang.Compiler.load(Compiler.java:7636) at clojure.lang.RT.loadResourceScript(RT.java:381) at clojure.lang.RT.loadResourceScript(RT.java:372) at clojure.lang.RT.load(RT.java:459) at clojure.lang.RT.load(RT.java:424) at clojure.core$load$fn__6839.invoke(core.clj:6126) at clojure.core$load.invokeStatic(core.clj:6125) at clojure.core$load.doInvoke(core.clj:6109) at clojure.lang.RestFn.invoke(RestFn.java:408) at clojure.core$load_one.invokeStatic(core.clj:5908) at clojure.core$load_one.invoke(core.clj:5903) at clojure.core$load_lib$fn__6780.invoke(core.clj:5948) at clojure.core$load_lib.invokeStatic(core.clj:5947) at clojure.core$load_lib.doInvoke(core.clj:5928) at clojure.lang.RestFn.applyTo(RestFn.java:142) at clojure.core$apply.invokeStatic(core.clj:667) at clojure.core$load_libs.invokeStatic(core.clj:5985) at clojure.core$load_libs.doInvoke(core.clj:5969) at clojure.lang.RestFn.applyTo(RestFn.java:137) at clojure.core$apply.invokeStatic(core.clj:667) at clojure.core$require.invokeStatic(core.clj:6007) at clojure.core$require.doInvoke(core.clj:6007) at clojure.lang.RestFn.invoke(RestFn.java:436) at uncomplicate.neanderthal.native$eval5873$loading__6721__auto____5874.invoke(native.clj:9 ) at uncomplicate.neanderthal.native$eval5873.invokeStatic(native.clj:9) at uncomplicate.neanderthal.native$eval5873.invoke(native.clj:9) at clojure.lang.Compiler.eval(Compiler.java:7177) at clojure.lang.Compiler.eval(Compiler.java:7166) at clojure.lang.Compiler.load(Compiler.java:7636) at clojure.lang.RT.loadResourceScript(RT.java:381) at clojure.lang.RT.loadResourceScript(RT.java:372) at clojure.lang.RT.load(RT.java:459) at clojure.lang.RT.load(RT.java:424) at clojure.core$load$fn__6839.invoke(core.clj:6126) at clojure.core$load.invokeStatic(core.clj:6125) at clojure.core$load.doInvoke(core.clj:6109) at clojure.lang.RestFn.invoke(RestFn.java:408) at clojure.core$load_one.invokeStatic(core.clj:5908) at clojure.core$load_one.invoke(core.clj:5903) at clojure.core$load_lib$fn__6780.invoke(core.clj:5948) at clojure.core$load_lib.invokeStatic(core.clj:5947) at clojure.core$load_lib.doInvoke(core.clj:5928) at clojure.lang.RestFn.applyTo(RestFn.java:142) at clojure.core$applyExecution error at uncomplicate.neanderthal.internal.host.NarSystem/getLibPath (NarSystem.java:172). Library 'neanderthal-mkl-0.25.0.dll' not found! .invokeStatic(core.clj:667) at clojure.core$load_libs.invokeStatic(core.clj:5989) at clojure.core$load_libs.doInvoke(core.clj:5969) at clojure.lang.RestFn.applyTo(RestFn.java:137) at clojure.core$apply.invokeStatic(core.clj:667) at clojure.core$require.invokeStatic(core.clj:6007) at clojure.core$require.doInvoke(core.clj:6007) at clojure.lang.RestFn.invoke(RestFn.java:408) at test.core$eval1455.invokeStatic(form-init5293041487798483533.clj:1) at test.core$eval1455.invoke(form-init5293041487798483533.clj:1) at clojure.lang.Compiler.eval(Compiler.java:7177) at clojure.lang.Compiler.eval(Compiler.java:7132) at clojure.core$eval.invokeStatic(core.clj:3214) at clojure.core$eval.invoke(core.clj:3210) at clojure.main$repl$read_eval_print__9086$fn__9089.invoke(main.clj:437) at clojure.main$repl$read_eval_print__9086.invoke(main.clj:437) at clojure.main$repl$fn__9095.invoke(main.clj:458) at clojure.main$repl.invokeStatic(main.clj:458) at clojure.main$repl.doInvoke(main.clj:368) attest.core=> clojure.lang.RestFn.invoke(RestFn.java:1523) at clojure.tools.nrepl.middleware.interruptible_eval$evaluate$fn__829.invoke(interruptible_eval.clj:87) at clojure.lang.AFn.applyToHelper(AFn.java:152) at clojure.lang.AFn.applyTo(AFn.java:144) at clojure.core$apply.invokeStatic(core.clj:665) at clojure.core$with_bindings_STAR_.invokeStatic(core.clj:1973) at clojure.core$with_bindings_STAR_.doInvoke(core.clj:1973) at clojure.lang.RestFn.invoke(RestFn.java:425) at clojure.tools.nrepl.middleware.interruptible_eval$evaluate.invokeStatic(interruptible_eval.clj:85) at clojure.tools.nrepl.middleware.interruptible_eval$evaluate.invoke(interruptible_eval.clj:55) at clojure.tools.nrepl.middleware.interruptible_eval$interruptible_eval$fn__874$fn__877.invoke(interruptible_eval.clj:222) at clojure.tools.nrepl.middleware.interruptible_eval$run_next$fn__869.invoke(interruptible_eval.clj:190) at clojure.lang.AFn.run(AFn.java:22) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source)

single precision not supported with MKL on macOS Sierra?

i really love this library, and i'm migrating from tensorflow. because i'm used to f32, i'm walking through the tutorials with single precision data, and encountered some unexpected behaviors:

(dot (dv (range 3)) (dv (range 3))) => 5.0
(dot (fv (range 3)) (fv (range 3))) => 0.0
(asum (dv (range 3))) => 3.0
(asum (fv (range 3))) => 0.0
(nrm1 (dv (range 3))) => 3.0
(nrm1 (fv (range 3))) => 0.0

(nrm2 (dv (range 3))) => 2.23606797749979
(nrm2 (fv (range 3))) => -1.0842022E-19

namely dot, asum, nrm1, nrm2 do not work for single precision.
(mv, mm, sum, nrmi work properly.)

i wonder, is this a bug, or intentional in that single precision CPU computing is not supported?

i'm on macOS Sierra 10.12.6. i installed MKL as instructed, and moved all the MKL dylibs & libiomp5 to /usr/local/lib/. i'm using neanderthal 0.14.0 and clojure 1.9.0-alpha17.

Build failing on Windows

When trying either lein test or lein midje on Windows I get the following error:

C:\Users\Mike\git\neanderthal>lein test
java.lang.IllegalArgumentException: Bad artifact coordinates uncomplicate:neanderthal-atlas:jar:amd64-Windows 8.1-gpp-jni:0.1.0, expected format is <groupId>:<artifactId>[:<extension>[:<classifier>]]:<version>
 at org.sonatype.aether.util.artifact.DefaultArtifact.<init> (DefaultArtifact.java:73)
    org.sonatype.aether.util.artifact.DefaultArtifact.<init> (DefaultArtifact.java:56)
    cemerick.pomegranate.aether$artifact.invoke (aether.clj:222)
    cemerick.pomegranate.aether$dependency.invoke (aether.clj:230)
    cemerick.pomegranate.aether$resolve_dependencies_STAR_$fn__190.invoke (aether.clj:708)
    clojure.core$map$fn__4553.invoke (core.clj:2624)
    clojure.lang.LazySeq.sval (LazySeq.java:40)
    clojure.lang.LazySeq.seq (LazySeq.java:49)
    clojure.lang.Cons.next (Cons.java:39)
    clojure.lang.PersistentVector.create (PersistentVector.java:68)
    clojure.lang.LazilyPersistentVector.create (LazilyPersistentVector.java:30)
    clojure.core$vec.invoke (core.clj:361)
    cemerick.pomegranate.aether$resolve_dependencies_STAR_.doInvoke (aether.clj:701)
    clojure.lang.RestFn.applyTo (RestFn.java:137)
    clojure.core$apply.invoke (core.clj:630)
    cemerick.pomegranate.aether$resolve_dependencies.doInvoke (aether.clj:729)
    clojure.lang.RestFn.invoke (RestFn.java:2088)
    leiningen.core.classpath/fn (classpath.clj:115)
.... etc .....

Under Java 11, cannot access jdk.internal.ref.Cleaner

Reproduction steps on Mac OS 10.13.6.

First clone the neanderthal repo.
Then cd to the hello-world example directory. Then run the following ...

Dorabs-iMac:hello-world dorab$ lein repl
nREPL server started on port 60233 on host 127.0.0.1 - nrepl://127.0.0.1:60233
REPL-y 0.4.3, nREPL 0.6.0
Clojure 1.10.0
OpenJDK 64-Bit Server VM 11.0.1+13
Docs: (doc function-name-here)
(find-doc "part-of-name-here")
Source: (source function-name-here)
Javadoc: (javadoc java-object-or-class-here)
Exit: Control+D or (exit) or (quit)
Results: Stored in vars *1, *2, *3, an exception in *e

user=> (require '[uncomplicate.commons.core :refer [with-release]])
nil
user=> (require '[uncomplicate.neanderthal.native :refer :all])
nil
user=> (require '[uncomplicate.neanderthal.core :refer :all])
nil
user=> (with-release [x (dv 1.0 2.0)] (println x))
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
#RealBlockVector[double, n:2, offset: 0, stride:1]
[ 1.00 2.00 ]

Execution error (IllegalAccessError) at uncomplicate.commons.core/eval1620$fn (core.clj:69).
class uncomplicate.commons.core$eval1620$fn__1621 (in unnamed module @0x7700fe63) cannot access class jdk.internal.ref.Cleaner (in module java.base) because module java.base does not export jdk.internal.ref to unnamed module @0x7700fe63

user=> Bye for now!
Dorabs-iMac:hello-world dorab$

java.lang.UnsatisfiedLinkError on Mac OS X

Hello,

First, sorry about the long post.

Here are my lein project.clj and a sample namespace. When loading it from lein repl, got a stacktrace list below.

(defproject matrix "0.1.0-SNAPSHOT"
:dependencies [[org.clojure/clojure "1.8.0"]
[com.taoensso/truss "1.2.0"]
[uncomplicate/clojurecl "0.6.4"]
[uncomplicate/fluokitten "0.5.0"]
[uncomplicate/neanderthal "0.6.2"]]

:profiles {:dev {:dependencies [[criterium "0.4.4"]]}
:uberjar {:aot :all}}
)

(ns matrix.core
(:require [uncomplicate.clojurecl.core :as cl]
[uncomplicate.commons.core :refer [with-release]]
[uncomplicate.neanderthal
[core :refer [asum dot axpy! mv! mm! transfer! copy]]
[native :refer [sv sge]]
[opencl :refer [with-default-engine clv clge]]]
[criterium.core :refer [quick-bench with-progress-reporting]]))

The interesting one is the nested cause:

Stack trace from the attempt to load the library as a resource:
java.lang.UnsatisfiedLinkError: /private/var/folders/xm/vkg11d9n74ngq3zsbjlms04w0000gn/T/libJOCLBlast_0_7_1-apple-x86_64.dylib: dlopen(/private/var/folders/xm/vkg11d9n74ngq3zsbjlms04w0000gn/T/libJOCLBlast_0_7_1-apple-x86_64.dylib, 1): Library not loaded: libclblast.dylib
Referenced from: /private/var/folders/xm/vkg11d9n74ngq3zsbjlms04w0000gn/T/libJOCLBlast_0_7_1-apple-x86_64.dylib

ls -lR that folder /private/var/... shows required dylib are there, but layout looks strange. Not sure this is leinignen issue or not.

/p/v/f/x/v/T ❯❯❯ ls -lR JOCL
-rw-r--r-- 1 houf staff 318908 May 25 10:50 libJOCLBlast_0_7_1-apple-x86_64.dylib
-rw-r--r-- 1 houf staff 180064 May 23 19:34 libJOCL_2_0_0-apple-x86_64.dylib

JOCLBlast_0_7_1-apple-x86_64_dependents:
total 0
drwxr-xr-x 3 houf staff 102 May 25 10:50 apple

JOCLBlast_0_7_1-apple-x86_64_dependents/apple:
total 0
drwxr-xr-x 3 houf staff 102 May 25 10:50 x86_64

JOCLBlast_0_7_1-apple-x86_64_dependents/apple/x86_64:
total 4272
-rw-r--r-- 1 houf staff 2184612 May 25 10:50 libclblast.dylib

============Full Stacktrace ==============
CompilerException java.lang.UnsatisfiedLinkError: Error while loading native library "JOCLBlast_0_7_1-apple-x86_64"
Operating system name: Mac OS X
Architecture : x86_64
Architecture bit size: 64
---(start of nested stack traces)---
Stack trace from the attempt to load the library as a file:
java.lang.UnsatisfiedLinkError: no JOCLBlast_0_7_1-apple-x86_64 in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1867)
at java.lang.Runtime.loadLibrary0(Runtime.java:870)
at java.lang.System.loadLibrary(System.java:1122)
at org.jocl.LibUtils.loadLibrary(LibUtils.java:136)
at org.jocl.blast.CLBlast.(CLBlast.java:53)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at clojure.lang.RT.classForName(RT.java:2168)
at clojure.lang.RT.classForName(RT.java:2177)
at clojure.lang.Compiler$HostExpr.maybeClass(Compiler.java:1030)
at clojure.lang.Compiler.macroexpand1(Compiler.java:6807)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:6854)
at clojure.lang.Compiler.analyze(Compiler.java:6669)
at clojure.lang.Compiler.analyze(Compiler.java:6625)
at clojure.lang.Compiler$BodyExpr$Parser.parse(Compiler.java:6001)
at clojure.lang.Compiler$LetExpr$Parser.parse(Compiler.java:6319)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:6868)
at clojure.lang.Compiler.analyze(Compiler.java:6669)
at clojure.lang.Compiler.analyze(Compiler.java:6625)
at clojure.lang.Compiler$BodyExpr$Parser.parse(Compiler.java:6001)
at clojure.lang.Compiler$FnMethod.parse(Compiler.java:5380)
at clojure.lang.Compiler$FnExpr.parse(Compiler.java:3972)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:6866)
at clojure.lang.Compiler.analyze(Compiler.java:6669)
at clojure.lang.Compiler.eval(Compiler.java:6924)
at clojure.lang.Compiler.load(Compiler.java:7379)
at clojure.lang.RT.loadResourceScript(RT.java:372)
at clojure.lang.RT.loadResourceScript(RT.java:363)
at clojure.lang.RT.load(RT.java:453)
at clojure.lang.RT.load(RT.java:419)
at clojure.core$load$fn__5677.invoke(core.clj:5893)
at clojure.core$load.invokeStatic(core.clj:5892)
at clojure.core$load.doInvoke(core.clj:5876)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core$load_one.invokeStatic(core.clj:5697)
at clojure.core$load_one.invoke(core.clj:5692)
at clojure.core$load_lib$fn__5626.invoke(core.clj:5737)
at clojure.core$load_lib.invokeStatic(core.clj:5736)
at clojure.core$load_lib.doInvoke(core.clj:5717)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply.invokeStatic(core.clj:648)
at clojure.core$load_libs.invokeStatic(core.clj:5778)
at clojure.core$load_libs.doInvoke(core.clj:5758)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invokeStatic(core.clj:648)
at clojure.core$require.invokeStatic(core.clj:5796)
at clojure.core$require.doInvoke(core.clj:5796)
at clojure.lang.RestFn.invoke(RestFn.java:482)
at uncomplicate.neanderthal.opencl$eval37781$loading__5569__auto____37782.invoke(opencl.clj:1)
at uncomplicate.neanderthal.opencl$eval37781.invokeStatic(opencl.clj:1)
at uncomplicate.neanderthal.opencl$eval37781.invoke(opencl.clj:1)
at clojure.lang.Compiler.eval(Compiler.java:6927)
at clojure.lang.Compiler.eval(Compiler.java:6916)
at clojure.lang.Compiler.load(Compiler.java:7379)
at clojure.lang.RT.loadResourceScript(RT.java:372)
at clojure.lang.RT.loadResourceScript(RT.java:363)
at clojure.lang.RT.load(RT.java:453)
at clojure.lang.RT.load(RT.java:419)
at clojure.core$load$fn__5677.invoke(core.clj:5893)
at clojure.core$load.invokeStatic(core.clj:5892)
at clojure.core$load.doInvoke(core.clj:5876)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core$load_one.invokeStatic(core.clj:5697)
at clojure.core$load_one.invoke(core.clj:5692)
at clojure.core$load_lib$fn__5626.invoke(core.clj:5737)
at clojure.core$load_lib.invokeStatic(core.clj:5736)
at clojure.core$load_lib.doInvoke(core.clj:5717)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply.invokeStatic(core.clj:648)
at clojure.core$load_libs.invokeStatic(core.clj:5778)
at clojure.core$load_libs.doInvoke(core.clj:5758)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invokeStatic(core.clj:648)
at clojure.core$require.invokeStatic(core.clj:5796)
at clojure.core$require.doInvoke(core.clj:5796)
at clojure.lang.RestFn.invoke(RestFn.java:457)
at matrix.core$eval20272$loading__5569__auto____20273.invoke(form-init3071421537802120931.clj:1)
at matrix.core$eval20272.invokeStatic(form-init3071421537802120931.clj:1)
at matrix.core$eval20272.invoke(form-init3071421537802120931.clj:1)
at clojure.lang.Compiler.eval(Compiler.java:6927)
at clojure.lang.Compiler.eval(Compiler.java:6916)
at clojure.lang.Compiler.eval(Compiler.java:6890)
at clojure.core$eval.invokeStatic(core.clj:3105)
at clojure.core$eval.invoke(core.clj:3101)
at clojure.main$repl$read_eval_print__7408$fn__7411.invoke(main.clj:240)
at clojure.main$repl$read_eval_print__7408.invoke(main.clj:240)
at clojure.main$repl$fn__7417.invoke(main.clj:258)
at clojure.main$repl.invokeStatic(main.clj:258)
at clojure.main$repl.doInvoke(main.clj:174)
at clojure.lang.RestFn.invoke(RestFn.java:1523)
at clojure.tools.nrepl.middleware.interruptible_eval$evaluate$fn__941.invoke(interruptible_eval.clj:87)
at clojure.lang.AFn.applyToHelper(AFn.java:152)
at clojure.lang.AFn.applyTo(AFn.java:144)
at clojure.core$apply.invokeStatic(core.clj:646)
at clojure.core$with_bindings_STAR_.invokeStatic(core.clj:1881)
at clojure.core$with_bindings_STAR_.doInvoke(core.clj:1881)
at clojure.lang.RestFn.invoke(RestFn.java:425)
at clojure.tools.nrepl.middleware.interruptible_eval$evaluate.invokeStatic(interruptible_eval.clj:85)
at clojure.tools.nrepl.middleware.interruptible_eval$evaluate.invoke(interruptible_eval.clj:55)
at clojure.tools.nrepl.middleware.interruptible_eval$interruptible_eval$fn__986$fn__989.invoke(interruptible_eval.clj:222)
at clojure.tools.nrepl.middleware.interruptible_eval$run_next$fn__981.invoke(interruptible_eval.clj:190)
at clojure.lang.AFn.run(AFn.java:22)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Stack trace from the attempt to load the library as a resource:
java.lang.UnsatisfiedLinkError: /private/var/folders/xm/vkg11d9n74ngq3zsbjlms04w0000gn/T/libJOCLBlast_0_7_1-apple-x86_64.dylib: dlopen(/private/var/folders/xm/vkg11d9n74ngq3zsbjlms04w0000gn/T/libJOCLBlast_0_7_1-apple-x86_64.dylib, 1): Library not loaded: libclblast.dylib
Referenced from: /private/var/folders/xm/vkg11d9n74ngq3zsbjlms04w0000gn/T/libJOCLBlast_0_7_1-apple-x86_64.dylib
Reason: image not found
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1941)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1824)
at java.lang.Runtime.load0(Runtime.java:809)
at java.lang.System.load(System.java:1086)
at org.jocl.LibUtils.loadLibraryResource(LibUtils.java:269)
at org.jocl.LibUtils.loadLibrary(LibUtils.java:151)
at org.jocl.blast.CLBlast.(CLBlast.java:53)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at clojure.lang.RT.classForName(RT.java:2168)
at clojure.lang.RT.classForName(RT.java:2177)
at clojure.lang.Compiler$HostExpr.maybeClass(Compiler.java:1030)
at clojure.lang.Compiler.macroexpand1(Compiler.java:6807)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:6854)
at clojure.lang.Compiler.analyze(Compiler.java:6669)
at clojure.lang.Compiler.analyze(Compiler.java:6625)
at clojure.lang.Compiler$BodyExpr$Parser.parse(Compiler.java:6001)
at clojure.lang.Compiler$LetExpr$Parser.parse(Compiler.java:6319)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:6868)
at clojure.lang.Compiler.analyze(Compiler.java:6669)
at clojure.lang.Compiler.analyze(Compiler.java:6625)
at clojure.lang.Compiler$BodyExpr$Parser.parse(Compiler.java:6001)
at clojure.lang.Compiler$FnMethod.parse(Compiler.java:5380)
at clojure.lang.Compiler$FnExpr.parse(Compiler.java:3972)
at clojure.lang.Compiler.analyzeSeq(Compiler.java:6866)
at clojure.lang.Compiler.analyze(Compiler.java:6669)
at clojure.lang.Compiler.eval(Compiler.java:6924)
at clojure.lang.Compiler.load(Compiler.java:7379)
at clojure.lang.RT.loadResourceScript(RT.java:372)
at clojure.lang.RT.loadResourceScript(RT.java:363)
at clojure.lang.RT.load(RT.java:453)
at clojure.lang.RT.load(RT.java:419)
at clojure.core$load$fn__5677.invoke(core.clj:5893)
at clojure.core$load.invokeStatic(core.clj:5892)
at clojure.core$load.doInvoke(core.clj:5876)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core$load_one.invokeStatic(core.clj:5697)
at clojure.core$load_one.invoke(core.clj:5692)
at clojure.core$load_lib$fn__5626.invoke(core.clj:5737)
at clojure.core$load_lib.invokeStatic(core.clj:5736)
at clojure.core$load_lib.doInvoke(core.clj:5717)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply.invokeStatic(core.clj:648)
at clojure.core$load_libs.invokeStatic(core.clj:5778)
at clojure.core$load_libs.doInvoke(core.clj:5758)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invokeStatic(core.clj:648)
at clojure.core$require.invokeStatic(core.clj:5796)
at clojure.core$require.doInvoke(core.clj:5796)
at clojure.lang.RestFn.invoke(RestFn.java:482)
at uncomplicate.neanderthal.opencl$eval37781$loading__5569__auto____37782.invoke(opencl.clj:1)
at uncomplicate.neanderthal.opencl$eval37781.invokeStatic(opencl.clj:1)
at uncomplicate.neanderthal.opencl$eval37781.invoke(opencl.clj:1)
at clojure.lang.Compiler.eval(Compiler.java:6927)
at clojure.lang.Compiler.eval(Compiler.java:6916)
at clojure.lang.Compiler.load(Compiler.java:7379)
at clojure.lang.RT.loadResourceScript(RT.java:372)
at clojure.lang.RT.loadResourceScript(RT.java:363)
at clojure.lang.RT.load(RT.java:453)
at clojure.lang.RT.load(RT.java:419)
at clojure.core$load$fn__5677.invoke(core.clj:5893)
at clojure.core$load.invokeStatic(core.clj:5892)
at clojure.core$load.doInvoke(core.clj:5876)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core$load_one.invokeStatic(core.clj:5697)
at clojure.core$load_one.invoke(core.clj:5692)
at clojure.core$load_lib$fn__5626.invoke(core.clj:5737)
at clojure.core$load_lib.invokeStatic(core.clj:5736)
at clojure.core$load_lib.doInvoke(core.clj:5717)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply.invokeStatic(core.clj:648)
at clojure.core$load_libs.invokeStatic(core.clj:5778)
at clojure.core$load_libs.doInvoke(core.clj:5758)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invokeStatic(core.clj:648)
at clojure.core$require.invokeStatic(core.clj:5796)
at clojure.core$require.doInvoke(core.clj:5796)
at clojure.lang.RestFn.invoke(RestFn.java:457)
at matrix.core$eval20272$loading__5569__auto____20273.invoke(form-init3071421537802120931.clj:1)
at matrix.core$eval20272.invokeStatic(form-init3071421537802120931.clj:1)
at matrix.core$eval20272.invoke(form-init3071421537802120931.clj:1)
at clojure.lang.Compiler.eval(Compiler.java:6927)
at clojure.lang.Compiler.eval(Compiler.java:6916)
at clojure.lang.Compiler.eval(Compiler.java:6890)
at clojure.core$eval.invokeStatic(core.clj:3105)
at clojure.core$eval.invoke(core.clj:3101)
at clojure.main$repl$read_eval_print__7408$fn__7411.invoke(main.clj:240)
at clojure.main$repl$read_eval_print__7408.invoke(main.clj:240)
at clojure.main$repl$fn__7417.invoke(main.clj:258)
at clojure.main$repl.invokeStatic(main.clj:258)
at clojure.main$repl.doInvoke(main.clj:174)
at clojure.lang.RestFn.invoke(RestFn.java:1523)
at clojure.tools.nrepl.middleware.interruptible_eval$evaluate$fn__941.invoke(interruptible_eval.clj:87)
at clojure.lang.AFn.applyToHelper(AFn.java:152)
at clojure.lang.AFn.applyTo(AFn.java:144)
at clojure.core$apply.invokeStatic(core.clj:646)
at clojure.core$with_bindings_STAR_.invokeStatic(core.clj:1881)
at clojure.core$with_bindings_STAR_.doInvoke(core.clj:1881)
at clojure.lang.RestFn.invoke(RestFn.java:425)
at clojure.tools.nrepl.middleware.interruptible_eval$evaluate.invokeStatic(interruptible_eval.clj:85)
at clojure.tools.nrepl.middleware.interruptible_eval$evaluate.invoke(interruptible_eval.clj:55)
at clojure.tools.nrepl.middleware.interruptible_eval$interruptible_eval$fn__986$fn__989.invoke(interruptible_eval.clj:222)
at clojure.tools.nrepl.middleware.interruptible_eval$run_next$fn__981.invoke(interruptible_eval.clj:190)
at clojure.lang.AFn.run(AFn.java:22)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
---(end of nested stack traces)---
, compiling:(uncomplicate/neanderthal/opencl/clblast.clj:461:3)

How to work with block matrices?

I'm currently trying to brush up on my linear algebra a bit on the side by going through a textbook. I had a pretty good go with just implementing everything in straight ELisp, but as the algorithms get more complicated I've been having more and more problems as I hit all sorts of weak spots in my naiive matrix datastructures.

So I'm trying to switch over to Neaderthal to make my life a bit easier and so I can focus more on the core algorithms. One core issue I've faced in my ELisp implementation is that a lot of algorithms rely on recursive block matrix operations - but I'm not seeing any facilities for working with block matrices in Neanderthal (probably do to my not understanding BLAS/Clojure sufficiently!)

I'm not really sure I'm looking to do too much here.. just ways to break matrices into blocks and stitch matrices together from blocks. Maybe this is already possible with the existing API? (the first part I can probably cobble together with submatrix) I just can't piece it all together in a coherent workflow at the moment. Any pointers would be appreciated :)

OpenCL 1.2 Error in 0.17.0

Hi here I am, again :)

After upgrade to 0.17.0 the following test code cannot be compiled (which runs perfectly on 0.16.1):

(with-default-1
  (with-default-engine
    (with-release [gpu-x (clv (range 100000))
                   gpu-y (copy gpu-x)]
      (dot gpu-x gpu-y))))

The compile error message is in the attached file. And I'm using my MacBook Pro with:

OS: macOS 10.13.1
Java: Java(TM) SE Runtime Environment (build 1.8.0_151-b12)
Leiningen: 2.8.1

error.txt

Comparison with netlib-java

This looks like an amazing library! I'm definitely convinced that this has better performance than Vectorz or Jblas, but what about a comparison with netlib-java? I've tried looking around for more recent benchmarks on netlib-java than the 2009 ones I found but I can't find any.

Thanks for your time!

java.lang.UnsatisfiedLinkError

I try to run cuda example code with this link and I have error is

java.lang.UnsatisfiedLinkError: /tmp/libneanderthal-mkl-0.14.02129154059413193959.so: libmkl_rt.so: cannot open shared object file: No such file or directory, compiling:(uncomplicate/neanderthal/internal/host/mkl.clj:102:5)

my ubuntu installed cuda with version 7.5

Unable to run benchmarks in Q4 2017

I was unable to execute the benchmarking code because I was unable to find mikera.matrixx, mikera.matrixx.algo anywhere ( not even a github repo ).

Should we consider removing it?

[Newbie issue] Try to follow GPU series but cannot install Neanderthal

I tried to followed

https://dragan.rocks/articles/19/Deep-Learning-in-Clojure-From-Scratch-to-GPU-1-Representing-Layers-and-Connections

And as I have some AI and statistics background (Fastai, Leela zero etc.), I enjoy both the GPU part and matrix one. But when I tried to run the code, I can't. There are two cliff between clojure and the GPU part and the Neanderthal. I can do cli -m core as under in the clojure in 60s plus and run lein no issue.

But how one can install the jar under Mac? Clicking the jar links to clojar.org just gave you a message. And I am not sure I follow the base one etc. I have a eGPU for Macbook and another old MacBook has old Nvidia. I would try that on top of Intel MKL. But that the other cliff. The first cliff of Neanderthal cannot be crossed yet.

Any help would be much appreciate ... something like this:

https://medium.com/@swlkr/go-from-zero-to-clojure-in-60-seconds-6550613c0699

mm! is slower and crashing on Macbook pro gpu

Hello,

Trying a few examples today. On my macbook pro (ealy 2013), ran this code


(ns matrix.core
  (:require
   [criterium.core :refer [quick-bench with-progress-reporting]]
   [uncomplicate.commons.core :refer [with-release]]
   [uncomplicate.clojurecl.core
    :refer [with-default with-platform platforms with-context context
            with-queue sort-by-cl-version devices finish!]]
   [uncomplicate.clojurecl.legacy
    :refer [with-default-1 command-queue-1]]
   [uncomplicate.neanderthal
    [core :refer [asum dot axpy! mv! mm! transfer! copy]]
    [native :refer [sv sge]]
    [opencl :refer [with-default-engine clv clge]]]))

(with-platform (first (platforms))
  (let [dev (first (sort-by-cl-version (devices :gpu)))]
    (with-context (context [dev])
      (with-queue (command-queue-1 dev)
        (with-default-engine
          (let [cnt 4096]
            (with-release [host-a (sge cnt cnt (range (* cnt cnt)))
                           host-b (copy host-a)
                           host-c (copy host-a)
                           gpu-a (transfer! host-a (clge cnt cnt))
                           gpu-b (copy gpu-a)
                           gpu-c (copy gpu-a)]
              (println "CPU:")
              (time (mm! 3 host-a host-b 2 host-c))
              (println "GPU:")
              (mm! 3 gpu-a gpu-b 2 gpu-c)
              (println (finish!))
              (println gpu-c)
              (time (do (mm! 3 gpu-a gpu-b 2 gpu-c) (finish!))))
            ))))))

First gpu device is Intel HD Graphics 4000. GPU is slower.

:device-type :gpu, :vendor "Intel", :vendor-id 16925696, :device-version "OpenCL 1.2 ", :driver-version "1.2(Apr 26 2016 00:33:44)"

CPU:
"Elapsed time: 835.101025 msecs"
GPU:

object[org.jocl.cl_command_queue 0x72581c95 cl_command_queue[0x7f897a5b03f0]]

CLGeneralMatrix[float, COL, mxn: 4096x4096, offset:0, ld:4096>]

"Elapsed time: 1968.578958 msecs"

object[org.jocl.cl_command_queue 0x72581c95 "cl_command_queue[0x7f897a5b03f0]"]

Run the same code by switching to second gpu device - NVIDIA GeForce GT 650M.

:device-type :gpu, :vendor "NVIDIA", :vendor-id 16918272, :device-version "OpenCL 1.2 ", :driver-version "10.10.10 310.42.25f01"

JVM crashed in native code.

# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00000001386dd2d6, pid=1169, tid=0x000000000000e453
#
# JRE version: Java(TM) SE Runtime Environment (8.0_92-b14) (build 1.8.0_92-b14)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.92-b14 mixed mode bsd-amd64 compressed oops)
# Problematic frame:
# C  [libclh.dylib+0xaa2d6]  cuiModuleUnloadEx+0x66

Stack: [0x0000700000e41000,0x0000700000ec1000],  sp=0x0000700000ec07f0,  free space=509k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C  [libclh.dylib+0xaa2d6]  cuiModuleUnloadEx+0x66
C  [libclh.dylib+0xa8f2e]  cuiModuleUnload+0xe
C  [GeForceGLDriver+0x30b3dd]  gldCopyTextureDataToBufferWithQueue+0x11fd
C  [GeForceGLDriver+0x30d8a1]  gldExecuteKernel+0x17b
C  [OpenCL+0x34a7]
C  [OpenCL+0x200da]  clSetEventCallback+0x1700
C  [OpenCL+0x239cc]  clFinish+0x2f9
C  [libdispatch.dylib+0x240b]  _dispatch_client_callout+0x8
C  [libdispatch.dylib+0x703b]  _dispatch_queue_drain+0x2f2
C  [libdispatch.dylib+0xd707]  _dispatch_queue_invoke+0x225
C  [libdispatch.dylib+0x5d53]  _dispatch_root_queue_drain+0x21a
C  [libdispatch.dylib+0x5b00]  _dispatch_worker_thread3+0x5b
C  [libsystem_pthread.dylib+0x34de]  _pthread_wqthread+0x469
C  [libsystem_pthread.dylib+0x1341]  start_wqthread+0xd

Are these results expected on old macbook pro? Would like to see some results from newer mac.

Another note, I did a quick attempt on AWS G2 instance using Amazon Linux AMI with NVIDIA GRID GPU Driver. OS failed to load libJOCL_2_0_0-linux-x86_64.so with LinkError because libstdc++ does not support CXXABI_1.3.8 (is there jocl built for CXXABI_1.3.7?). I may try to build a custom AMI. It'd be really helpful if someone did it before give some guidance, e.g. what linux distribution, opencl package, versions etc.

Thanks,
Feng

Cannot find jcuda jars

Hello,

I tried the simplest thing, adding this line to my project.clj from a fresh lein new:

[uncomplicate/neanderthal "0.18.0"]

Then tried to run lein repl and got this error:

Could not find artifact org.jcuda:jcuda-natives:jar:apple-x86_64:0.9.0 in central (https://repo1.maven.org/maven2/)
Could not find artifact org.jcuda:jcuda-natives:jar:apple-x86_64:0.9.0 in clojars (https://clojars.org/repo/)
Could not find artifact org.jcuda:jcublas-natives:jar:apple-x86_64:0.9.0 in central (https://repo1.maven.org/maven2/)
Could not find artifact org.jcuda:jcublas-natives:jar:apple-x86_64:0.9.0 in clojars (https://clojars.org/repo/)

What's up? Are there references to jars that don't exist? I thought I may need to add the clojurecuda dep as well (as mentioned by the Getting Started page) so I added this line as well:

[uncomplicate/clojurecuda "0.3.0"]

but I get the same error. Any ideas? On MacOSX 10.11.6.

Running without the MKL?

I'm probably misunderstanding something :)

From reading the documentation it seems like you can run Neanderthal with different backends which correspond do different namespaces. The native ns being the Intel MKL backend and then there are OpenCL and CUDA backends (and the ATLAS one is gone..)

I'm looking to run on an ARM machine later, so I was trying to set myself up use OpenCL backend and my namespace doesn't require the neanderthal native namespace and yet it still searches for the MKL

(ns asparapiss.core
  (:require [uncomplicate.neanderthal.core :as nc]
                [uncomplicate.neanderthal.opencl :as no])

Is what I'm trying to do impossible?

Sulong for native interop?

Sulong (https://github.com/graalvm/sulong) will run on unmodified JVM in Java 9. It is the basis for native extension interop for JRuby/Truffle. Full paper at http://ssw.jku.at/General/Staff/ManuelRigger/VMIL16.pdf

They make several claims regarding their FFI: 1) 0-overhead calls into native, 2) inlining of native calls. This is in addition to their primary claim of interpreting LLVM bitcode at seeds comparable to gcc o3.

This might be interesting for a) Neanderthal's FFI, and b) particularly as an evolution of Fluokitten. Once a higher-level matrix operation has been specified, one can write a Truffle interpreter for that operation in terms of the Sulong LLVM interpreter. And have that specialize down to the fastest thing possible.

I'm not exactly sure how it would relate to the OpenCL / Cuda side of things though.

Would be curious what you think (if this would be a useful technology to look at for these sorts of things)

Mysterious SLF4J errors

Hey @blueberry , I'm probably doing something wrong here

After fighting with the MLK for a while (It's a bit of a mess on Ubuntu 18.04) I made a new project using lein new app neand-test
Then I add neanderthal and change hello world to print out (dv 1 2 3)
See the diff here: https://github.com/geokon-gh/neand-test/commit/1159754f6e89fd2dcb14ed79d570bcf78fd78426

Then I go into the terminal, cd into the project and run lein run and I get

geokon@ux305-neon:~/USB/Projects/neand-test$ lein run
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
#RealBlockVector[double, n:3, offset: 0, stride:1]
[   1.00    2.00    3.00 ]

So it seems to run fine, but this error comes up each time.

If I look at the dependencies I don't even see SLF4J, so I'm not sure where it comes from

geokon@ux305-neon:~/USB/Projects/neand-test$ lein deps :tree
 [clojure-complete "0.2.5" :exclusions [[org.clojure/clojure]]]
 [nrepl "0.6.0" :exclusions [[org.clojure/clojure]]]
 [org.clojure/clojure "1.10.0"]
   [org.clojure/core.specs.alpha "0.2.44"]
   [org.clojure/spec.alpha "0.2.176"]
 [uncomplicate/neanderthal "0.22.0"]
   [org.apache.commons/commons-math3 "3.6.1"]
   [org.jcuda/jcublas "10.0.0"]
     [org.jcuda/jcublas-natives "10.0.0" :classifier "linux-x86_64"]
   [org.jocl/jocl-blast "1.5.0"]
   [uncomplicate/clojurecl "0.10.6"]
     [org.clojure/core.async "0.4.490"]
       [org.clojure/tools.analyzer.jvm "0.7.2"]
         [org.clojure/core.memoize "0.5.9"]
           [org.clojure/core.cache "0.6.5"]
             [org.clojure/data.priority-map "0.0.7"]
         [org.clojure/tools.analyzer "0.6.9"]
         [org.clojure/tools.reader "1.0.0-beta4"]
         [org.ow2.asm/asm-all "4.2"]
     [org.jocl/jocl "2.0.1"]
   [uncomplicate/clojurecuda "0.6.2"]
     [org.jcuda/jcuda "10.0.0"]
       [org.jcuda/jcuda-natives "10.0.0" :classifier "linux-x86_64"]
   [uncomplicate/commons "0.7.2"]
   [uncomplicate/fluokitten "0.9.1"]
   [uncomplicate/neanderthal-native "0.21.0"]

Have you seen this before?
I noticed it was mentioned in passing in issue #27 - but was tangential to the main problem

Unable to use without CUDA

I'm trying to use neanderthal for the first time on my laptop which does not have a discrete GPU. Neanderthal's Getting Started page implies CUDA cruft is not required to use neanderthal, but when I start up a REPL with the current release of neanderthal included as a lein project dependency I get errors similar to:

Could not find artifact org.jcuda:jcuda-natives:jar:apple-x86_64:0.9.2

Do I need to follow the installation instructions for GPU support even though it's not something I can even use? My laptop is a 13" MacBook Pro w/ Intel Iris.

Thanks for any help.

Core dump with scal!

I get a core dump on Windows using Neanderthal when executing the following:

(core/scal! 1 (core/create-vector cblas/cblas-double (range 5)))

Not sufficiently familiar with Neanderthal internals to understand what is causing this. Any ideas?

Without calling scal! the vector seems to be constructed just fine, it is definitely the scal! that is causing the core dump.

#
#  EXCEPTION_ILLEGAL_INSTRUCTION (0xc000001d) at pc=0x000000006830ee78, pid=8632, tid=952
#
# JRE version: Java(TM) SE Runtime Environment (8.0_40-b26) (build 1.8.0_40-b26)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.40-b25 mixed mode windows-amd64 compressed oops)
# Problematic frame:
# C  [neanderthal-atlas-0.3.18978921121746295551.dll+0xee78]
#
# Failed to write core dump. Minidumps are not enabled by default on client versions of Windows
#
# An error report file with more information is saved as:
# C:\Users\Mike\git\neanderthal\hs_err_pid8632.log
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#

Error loading JCudaRuntime in 0.13.3 and 0.14.0 on Mac

MacBook Pro, macOS Sierra 10.12.5
GPU: AMD Radeom R9 M270X (Note: So I always use OpenCL for computing on this machine, no CUDA related software installed.)

The following lines are copied from the Hello World example, which worked perfectly with neanderthal 0.13.2 and earlier versions.

(require '[uncomplicate.commons.core :refer [with-release]])
(require '[uncomplicate.clojurecl.core :refer [with-platform platforms with-context context with-queue sort-by-cl-version devices]])
(require '[uncomplicate.clojurecl.legacy :refer [with-default-1 command-queue-1]])
(require '[uncomplicate.neanderthal.core :refer [asum]])
(require '[uncomplicate.neanderthal.opencl :refer [clv with-default-engine]])

But when I change the dependency in project.clj from 0.13.2 to 0.13.3 OR 0.14.0, the following error spawned when execute the last line:

CompilerException java.lang.UnsatisfiedLinkError: Error while loading native library "JCudaRuntime-0.8.0-apple-x86_64"
Operating system name: Mac OS X
Architecture         : x86_64
Architecture bit size: 64
---(start of nested stack traces)---
Stack trace from the attempt to load the library as a file:
java.lang.UnsatisfiedLinkError: no JCudaRuntime-0.8.0-apple-x86_64 in java.library.path
……
Stack trace from the attempt to load the library as a resource:
java.lang.UnsatisfiedLinkError: /private/var/folders/pj/spb2zy094gn2kkt8wnsdmn6h0000gn/T/libJCudaRuntime-0.8.0-apple-x86_64.dylib: dlopen(/private/var/folders/pj/spb2zy094gn2kkt8wnsdmn6h0000gn/T/libJCudaRuntime-0.8.0-apple-x86_64.dylib, 1): Library not loaded: @rpath/CUDA.framework/Versions/A/CUDA
  Referenced from: /private/var/folders/pj/spb2zy094gn2kkt8wnsdmn6h0000gn/T/libJCudaRuntime-0.8.0-apple-x86_64.dylib
  Reason: image not found
……

I guess that in between 0.13.2 and 0.13.3 some dependency on JCuda imported even if only OpenCL implementation used.

If any further info needed please tell me here. BTW very much thanks for bring us so cool lib!

Q extraction from QR-decomposition fails

Hi Dragan,

I try to extract Q for my core.matrix wrapper. It works on the REPL and returns the proper result, but I get the following error on the compliance test suite:

"QR" #uncomplicate.neanderthal.internal.common.OrthogonalFactorization{:eng #object[uncomplicate.neanderthal.internal.host.mkl.DoubleGEEngine 0x607e6542 "uncomplicate.neanderthal.internal.host.mkl.DoubleGEEngine@607e6542"], :or #RealGEMatrix[double, mxn:3x4, layout:column, offset:0]
   ▥       ↓       ↓       ↓       ↓       ┓    
   →      -3.16   -0.63   -5.69   -6.96         
   →       0.00   -1.90   -1.26   -1.90         
   →       0.72   -1.00   10.00    0.00         
   ┗                                       ┛    
, :jpiv nil, :tau #RealBlockVector[double, n:3, offset: 0, stride:1]
[   1.32    1.00    0.00 ]
, :master true, :fresh #object[clojure.lang.Atom 0x3654474 {:status :ready, :val true}], :m 3, :n 3, :or-type :qr, :api-orm #object[uncomplicate.neanderthal.internal.api$eval12129$fn__12213$G__12070__12226 0x298e3c19 "uncomplicate.neanderthal.internal.api$eval12129$fn__12213$G__12070__12226@298e3c19"], :api-org #object[uncomplicate.neanderthal.internal.api$eval12129$fn__12308$G__12102__12317 0x2945ae72 "uncomplicate.neanderthal.internal.api$eval12129$fn__12308$G__12102__12317@2945ae72"]}

Intel MKL ERROR: Parameter 2 was incorrect on entry to DORGQR.

lein test :only denisovan.core-test/compliance-test

ERROR in (compliance-test) (core.clj:4617)
Uncaught exception, not in assertion.
expected: nil
  actual: clojure.lang.ExceptionInfo: There has been an illegal argument in the native function call.
 at clojure.core$ex_info.invokeStatic (core.clj:4617)
    clojure.core$ex_info.invoke (core.clj:4617)
    uncomplicate.neanderthal.internal.host.mkl.DoubleGEEngine.gqr (mkl.clj:725)
    uncomplicate.neanderthal.internal.api$eval12129$fn__12308$G__12103__12312.invoke (api.clj:59)
    uncomplicate.neanderthal.internal.api$eval12129$fn__12308$G__12102__12317.invoke (api.clj:59)
    uncomplicate.neanderthal.internal.common.OrthogonalFactorization.org (common.clj:262)
    uncomplicate.neanderthal.linalg$org.invokeStatic (linalg.clj:419)
    uncomplicate.neanderthal.linalg$org.invoke (linalg.clj:409)
    denisovan.core$eval40810$fn__40811.invoke (core.clj:570)

Any ideas?

Error after Version Update

UPGRADE PATH:
Recording here in case anyone else has a similar issues.

Updating from 0.22.1 to 0.25.1 my installation printed this error (when the REPL is started):

Intel MKL FATAL ERROR: cannot load libmkl_vml_avx2.dylib or libmkl_vml_mc.dylib.
Subprocess failed

and refused to start. Reverted to 0.22.1 and everything still seemed to be working.

I copied libmkl_vml_avx2.dylib and libmkl_vml_mc.dylib into /usr/local/lib and this fixed the problem for 0.25.1 (documentation doesn't mention these files but does mention that there may be specific files for different intel architectures).

I also had to update any namespace references to "aux" since it was migrated to "auxil".

This is all on a laptop:

macOS Mojave
Version 10.14.3
MacBook Pro (15-inch, 2017)
Processor 2.8 GHz Intel Core i7
Memory 16 GB 2133 MHz LPDDR3
Startup Disk Macintosh HD
Graphics Radeon Pro 555 2048 MB
Intel HD Graphics 630 1536 MB

issue with ev! when eigenvalues have multiplicity

I was trying the examples from the tutorial: https://dragan.rocks/articles/17/Clojure-Linear-Algebra-Refresher-Eigenvalues-and-Eigenvectors

My env:
[uncomplicate/neanderthal "0.20.4"]
OS: Debian 9
MKL: 2019 Initial release

Noticed a few differences:

  1. The signature of ev! is now different from what is shown in example. Now it takes 4 arguments while in example it is shown taking 3 args.
  2. The calculation seems to be erroneous. I tried the same but getting different results. Also, the last test -Ax+λb = 0 is failing as can be seen below: (however, it works fine if tested on an example which doesn't have multiplicity > 1)
(require '[uncomplicate.neanderthal
           [core :refer [col entry mv scal axpy]]
           [native :refer [dge]]
           [linalg :refer [ev!]]])

(let [a (dge 3 3 [5 4 2, 4 5 2, 2 2 2])
      vr (dge 3 3)
      w (dge 3 2)]
  (ev! a w nil vr)
  [(col w 0)
   vr
   (let [l (entry w 0 0)
         v (col vr 0)]
     (axpy -1 (mv a v) (scal l v)))])

;; output =>
;;
;; [#RealBlockVector[double, n:3, offset: 0, stride:1]
;; [   1.00   10.00    1.00 ]
;;  #RealGEMatrix[double, mxn:3x3, layout:column, offset:0]
;;    ▥       ↓       ↓       ↓       ┓    
;;    →      -0.75    0.67    0.00         
;;    →       0.60    0.67   -0.45         
;;    →       0.30    0.33    0.89         
;;    ┗                               ┛    
;;  #RealBlockVector[double, n:3, offset: 0, stride:1]
;; [   0.00   -5.37    0.00 ]
;; ]

Ubuntu ATLAS installation and setup challenges (SOLVED) (NOT RELEVANT SINCE 2017)

On Ubuntu 15.10 with BLAS and ATLAS installed from reps (ATLAS was not custom built). Neanderthal loads correctly, dv works OK. But the attempt to (copy (dv 1 2 3)) fails with

java: symbol lookup error: /tmp/libneanderthal-atlas-0.2.1-SNAPSHOT5638624967954043829.so: undefined symbol: cblas_dcopy
Subprocess failed

It also fails on asum, and I would guess on all BLAS functions...

The following packages are definitely installed:

libblas3 (apt-cache show 's version 1.2.20110419-10), libblas-dev, libblas-common, libatlas3-base, libatlas-dev.

The following shared libraries are available in /usr/lib:

libblas.so, libblas.so.3, libblas.so.3.0, libatlas.so, libatlas.so.3, libatlas.so.3gf, libcblas.so, libcblas.so.3 and libcblas.so.3gf.

Is there something missing?

Dependent jar missing for macOS (neanderthal 0.18.0)

OS: macOS High Sierra 10.13.3
JDK: 1.8.0_162
Leiningen: Leiningen 2.8.1 on Java 1.8.0_162 Java HotSpot(TM) 64-Bit Server VM

lein deps
Could not find artifact org.jcuda:jcuda-natives:jar:apple-x86_64:0.9.0 in central (https://repo1.maven.org/maven2/)
Could not find artifact org.jcuda:jcuda-natives:jar:apple-x86_64:0.9.0 in clojars (https://repo.clojars.org/)
Could not find artifact org.jcuda:jcublas-natives:jar:apple-x86_64:0.9.0 in central (https://repo1.maven.org/maven2/)
Could not find artifact org.jcuda:jcublas-natives:jar:apple-x86_64:0.9.0 in clojars (https://repo.clojars.org/)
This could be due to a typo in :dependencies, file system permissions, or network issues.
If you are behind a proxy, try setting the 'http_proxy' environment variable.

Support pointwise comparison, sign, max

It would be beneficial to be able to set all non-positive entries of a vector, e.g. for ReLU activations in neural networks. This can be achieved by applying max(0, x) pointwise. Similarly sign, <, >, = might prove handy if they return 1.0 for truth and 0.0 else. In R, Python, Matlab, ... this is the way to do selection of values in variables in vectorized fashion.

install error on ubuntu 17.04

project.clj contains
:dependencies [[org.clojure/clojure "1.8.0"]
[uncomplicate/neanderthal "0.10.0"]
]

user=> (ns example
#_=> (:use [uncomplicate.neanderthal core native]))
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.

CompilerException java.lang.UnsatisfiedLinkError: /tmp/libneanderthal-mkl-0.9.09155295397512166145.so: libmkl_rt.so: cannot open shared object file: No such file or directory, compiling:(uncomplicate/neanderthal/internal/host/mkl.clj:98:5)
user=>

I'm on Ubuntu 17.04 (64-bit) with a 6 GB GTX 1060 with 1280 CUDA Cores.

Any advice?

Using opencl on mac os x using Jogamp

Hello Thanks for the great work.
I am trying to load opencl on Mac OS X in repl. As stated in documentation, i am getting errors for missing : java.lang.NullPointerException: No resource found with name '/lib/libJOCL_0_2_0-apple-x86_64.dylib'

If i understand correctly, the solution would be to build latest : https://github.com/gpu/JOCL on Mac.
I tried but seemed to hit some roadblocks.

I found that jocl jars for mac osx are available at : http://jogamp.org/deployment/webstart-next/archive/jogamp-all-platforms.7z

How much would it be possible to switch between different OpenCl bindings ?

Display of floats in Neanderthal

Is there a way to control the display of significant digits in Neanderthal?

For example when I run:

;;; Calculate x in x = inverseA b
;; create matrix A 2x2
( def A ( dge 2 2 [3.8 1.2 7.2 -0.9] ) )
;; create vector b 2x1
( def b ( dv 16.5 -22.1 ) )
;; compute inverse of A and store the result in inv-A
( def inv-A ( tri ( trf A ) ) )
;; compute x
( mv inv-A b )

I get x to be,

#RealBlockVector[double, n:2, offset: 0, stride: 1]
[ -11.96 8.61 ]

If I do the example in Numpy

import numpy as np
from numpy.linalg import inv
A = np.array([[3.8, 7.2], [1.3, -0.9]])
b = np.array([16.5, -22.1])
inv_A = inv(A)

inv_A.dot(b) returns

array([-11.28873239,   8.24960876])

In Matlab you can control the display of floating-point numbers as

% for displaying 5-digit floating point
format short e
% for displaying 15-digit floating point
format long

With Neanderthal

#RealBlockVector[double, n:2, offset: 0, stride: 1]
[ -11.96 8.61 ]

My HP-15c gives the output: -11.2887 and 8.2496.

Is this just a rounding-off display issue while running Neanderthal? Its output [ -11.96 8.61 ] is significantly different from the actual answer [-11.2887 8.2496].

The bbsolute error is [0.6713 0.3604]. Relative error is [-0.0595 -0.0437].

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.