Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot make sample from README working #7

Closed
anquegi opened this issue Oct 3, 2016 · 4 comments
Closed

Cannot make sample from README working #7

anquegi opened this issue Oct 3, 2016 · 4 comments

Comments

@anquegi
Copy link

anquegi commented Oct 3, 2016

Hi thanks for this nice library, when I try to use it I get the following error I'm Working on MAC OS X El Capitan

CL-USER> (lisp-implementation-type)
"SBCL"
CL-USER> (lisp-implementation-version)
"1.3.9"
CL-USER> (software-type)
"Darwin"
CL-USER> (software-version)
"15.6.0"
CL-USER> (ql:quickload :lisp-matrix)
To load "lisp-matrix":
  Load 1 ASDF system:
    lisp-matrix
; Loading "lisp-matrix"
..
(:LISP-MATRIX)
CL-USER> (in-package :lisp-matrix-user)
#<PACKAGE "LISP-MATRIX-USER">
LISP-MATRIX-USER> (M* (ones 2 2 :implementation :foreign-array)
    (ones 2 2 :implementation :foreign-array))

Given this error in the SLDB

There is no applicable method for the generic function
  #<STANDARD-GENERIC-FUNCTION LISP-MATRIX:GEMM (8)>
when called with arguments
  (1.0d0
   #<FA-SIMPLE-MATRIX-DOUBLE  2 x 2
 1.0d0 1.0d0
 1.0d0 1.0d0>
   #<FA-SIMPLE-MATRIX-DOUBLE  2 x 2
 1.0d0 1.0d0
 1.0d0 1.0d0>
   0.0d0
   #<LA-SIMPLE-MATRIX-DOUBLE  2 x 2
 0.0d0 0.0d0
 0.0d0 0.0d0>).
   [Condition of type SIMPLE-ERROR]

Restarts:
 0: [RETRY] Retry calling the generic function.
 1: [*ABORT] Return to SLIME's top level.
 2: [ABORT] abort thread (#<THREAD "repl-thread" RUNNING {1005098003}>)

Backtrace:
  0: ((:METHOD NO-APPLICABLE-METHOD (T)) #<STANDARD-GENERIC-FUNCTION LISP-MATRIX:GEMM (8)> 1.0d0 #<FA-SIMPLE-MATRIX-DOUBLE  2 x 2 ..) [fast-method]
  1: (SB-PCL::CALL-NO-APPLICABLE-METHOD #<STANDARD-GENERIC-FUNCTION LISP-MATRIX:GEMM (8)> (1.0d0 #<FA-SIMPLE-MATRIX-DOUBLE  2 x 2 ..)
  2: (SB-INT:SIMPLE-EVAL-IN-LEXENV (M* (ONES 2 2 :IMPLEMENTATION :FOREIGN-ARRAY) (ONES 2 2 :IMPLEMENTATION :FOREIGN-ARRAY)) #<NULL-LEXENV>)
  3: (EVAL (M* (ONES 2 2 :IMPLEMENTATION :FOREIGN-ARRAY) (ONES 2 2 :IMPLEMENTATION :FOREIGN-ARRAY)))
  4: (SWANK::%EVAL-REGION "(M* (ones 2 2 :implementation :foreign-array) ..)
  5: ((LAMBDA NIL :IN SWANK::%LISTENER-EVAL))
  6: (SWANK-REPL::TRACK-PACKAGE #<CLOSURE (LAMBDA NIL :IN SWANK::%LISTENER-EVAL) {100488260B}>)
  7: (SWANK::CALL-WITH-BUFFER-SYNTAX NIL #<CLOSURE (LAMBDA NIL :IN SWANK::%LISTENER-EVAL) {10048825EB}>)
  8: (SWANK::%LISTENER-EVAL "(M* (ones 2 2 :implementation :foreign-array) ..)
  9: (SB-INT:SIMPLE-EVAL-IN-LEXENV (SWANK-REPL:LISTENER-EVAL "(M* (ones 2 2 :implementation :foreign-array) ..)
 10: (EVAL (SWANK-REPL:LISTENER-EVAL "(M* (ones 2 2 :implementation :foreign-array) ..)
 11: (SWANK:EVAL-FOR-EMACS (SWANK-REPL:LISTENER-EVAL "(M* (ones 2 2 :implementation :foreign-array) ..)
 12: (SWANK::PROCESS-REQUESTS NIL)
 13: ((LAMBDA NIL :IN SWANK::HANDLE-REQUESTS))
 14: ((LAMBDA NIL :IN SWANK::HANDLE-REQUESTS))
 15: (SWANK/SBCL::CALL-WITH-BREAK-HOOK #<FUNCTION SWANK:SWANK-DEBUGGER-HOOK> #<CLOSURE (LAMBDA NIL :IN SWANK::HANDLE-REQUESTS) {10050A000B}>)
 16: ((FLET SWANK/BACKEND:CALL-WITH-DEBUGGER-HOOK :IN "/Users/toni/quicklisp/dists/quicklisp/software/slime-v2.18/swank/sbcl.lisp") #<FUNCTION SWANK:SWANK-DEBUGGER-HOOK> #<CLOSURE (LAMBDA NIL :IN SWANK::HA..
 17: (SWANK::CALL-WITH-BINDINGS ((*STANDARD-INPUT* . #1=#<SWANK/GRAY::SLIME-INPUT-STREAM {1004ED6043}>) (*STANDARD-OUTPUT* . #2=#<SWANK/GRAY::SLIME-OUTPUT-STREAM {1004FA6EA3}>) (*TRACE-OUTPUT* . #2#) (*ERR..
 18: (SWANK::HANDLE-REQUESTS #<SWANK::MULTITHREADED-CONNECTION {10042816F3}> NIL)
 19: ((FLET #:WITHOUT-INTERRUPTS-BODY-1179 :IN SB-THREAD::INITIAL-THREAD-FUNCTION-TRAMPOLINE))
 20: ((FLET SB-THREAD::WITH-MUTEX-THUNK :IN SB-THREAD::INITIAL-THREAD-FUNCTION-TRAMPOLINE))
 21: ((FLET #:WITHOUT-INTERRUPTS-BODY-359 :IN SB-THREAD::CALL-WITH-MUTEX))
 22: (SB-THREAD::CALL-WITH-MUTEX #<CLOSURE (FLET SB-THREAD::WITH-MUTEX-THUNK :IN SB-THREAD::INITIAL-THREAD-FUNCTION-TRAMPOLINE) {D279CFB}> #<SB-THREAD:MUTEX "thread result lock" owner: #<SB-THREAD:THREAD "..
 23: (SB-THREAD::INITIAL-THREAD-FUNCTION-TRAMPOLINE #<SB-THREAD:THREAD "repl-thread" RUNNING {1005098003}> NIL #<CLOSURE (LAMBDA NIL :IN SWANK-REPL::SPAWN-REPL-THREAD) {1005097F7B}> (#<SB-THREAD:THREAD "re..
 24: ("foreign function: call_into_lisp")
 25: ("foreign function: new_thread_trampoline")
 26: ("foreign function: _pthread_body")
 27: ("foreign function: _pthread_body")
 28: ("foreign function: thread_start")

When I do not add the :implementation key argument, it works as expected


LISP-MATRIX-USER> (M* (ones 2 2)
    (ones 2 2))
#<LA-SIMPLE-MATRIX-DOUBLE  2 x 2
 2.0d0 2.0d0
 2.0d0 2.0d0>

So is a error about type LA-* and FA-* types, I'm not sure what happens

@blindglobe
Copy link
Owner

Do the files in the examples directory work if you step through them?

Best,
-tony

On Monday, 3 October 2016, Antonio Juan [email protected] wrote:

Hi thanks for this nice library, when I try to use it I get the following
error I'm Working on MAC OS X El Capitan

CL-USER> (lisp-implementation-type)
"SBCL"
CL-USER> (lisp-implementation-version)
"1.3.9"
CL-USER> (software-type)
"Darwin"
CL-USER> (software-version)
"15.6.0"
CL-USER> (ql:quickload :lisp-matrix)
To load "lisp-matrix":
Load 1 ASDF system:
lisp-matrix
; Loading "lisp-matrix"
..
(:LISP-MATRIX)
CL-USER> (in-package :lisp-matrix-user)
#<PACKAGE "LISP-MATRIX-USER">
LISP-MATRIX-USER> (M* (ones 2 2 :implementation :foreign-array)
(ones 2 2 :implementation :foreign-array))

Given this error in the SLDB

There is no applicable method for the generic function
#<STANDARD-GENERIC-FUNCTION LISP-MATRIX:GEMM (8)>
when called with arguments
(1.0d0
#<FA-SIMPLE-MATRIX-DOUBLE 2 x 2
1.0d0 1.0d0
1.0d0 1.0d0>
#<FA-SIMPLE-MATRIX-DOUBLE 2 x 2
1.0d0 1.0d0
1.0d0 1.0d0>
0.0d0
#<LA-SIMPLE-MATRIX-DOUBLE 2 x 2
0.0d0 0.0d0
0.0d0 0.0d0>).
[Condition of type SIMPLE-ERROR]

Restarts:
0: [RETRY] Retry calling the generic function.
1: [*ABORT] Return to SLIME's top level.
2: [ABORT] abort thread (#<THREAD "repl-thread" RUNNING {1005098003}>)

Backtrace:
0: ((:METHOD NO-APPLICABLE-METHOD (T)) #<STANDARD-GENERIC-FUNCTION LISP-MATRIX:GEMM (8)> 1.0d0 #<FA-SIMPLE-MATRIX-DOUBLE 2 x 2 ..) [fast-method]
1: (SB-PCL::CALL-NO-APPLICABLE-METHOD #<STANDARD-GENERIC-FUNCTION LISP-MATRIX:GEMM (8)> (1.0d0 #<FA-SIMPLE-MATRIX-DOUBLE 2 x 2 ..)
2: (SB-INT:SIMPLE-EVAL-IN-LEXENV (M* (ONES 2 2 :IMPLEMENTATION :FOREIGN-ARRAY) (ONES 2 2 :IMPLEMENTATION :FOREIGN-ARRAY)) #)
3: (EVAL (M* (ONES 2 2 :IMPLEMENTATION :FOREIGN-ARRAY) (ONES 2 2 :IMPLEMENTATION :FOREIGN-ARRAY)))
4: (SWANK::%EVAL-REGION "(M* (ones 2 2 :implementation :foreign-array) ..)
5: ((LAMBDA NIL :IN SWANK::%LISTENER-EVAL))
6: (SWANK-REPL::TRACK-PACKAGE #<CLOSURE (LAMBDA NIL :IN SWANK::%LISTENER-EVAL) {100488260B}>)
7: (SWANK::CALL-WITH-BUFFER-SYNTAX NIL #<CLOSURE (LAMBDA NIL :IN SWANK::%LISTENER-EVAL) {10048825EB}>)
8: (SWANK::%LISTENER-EVAL "(M* (ones 2 2 :implementation :foreign-array) ..)
9: (SB-INT:SIMPLE-EVAL-IN-LEXENV (SWANK-REPL:LISTENER-EVAL "(M* (ones 2 2 :implementation :foreign-array) ..)
10: (EVAL (SWANK-REPL:LISTENER-EVAL "(M* (ones 2 2 :implementation :foreign-array) ..)
11: (SWANK:EVAL-FOR-EMACS (SWANK-REPL:LISTENER-EVAL "(M* (ones 2 2 :implementation :foreign-array) ..)
12: (SWANK::PROCESS-REQUESTS NIL)
13: ((LAMBDA NIL :IN SWANK::HANDLE-REQUESTS))
14: ((LAMBDA NIL :IN SWANK::HANDLE-REQUESTS))
15: (SWANK/SBCL::CALL-WITH-BREAK-HOOK # #<CLOSURE (LAMBDA NIL :IN SWANK::HANDLE-REQUESTS) {10050A000B}>)
16: ((FLET SWANK/BACKEND:CALL-WITH-DEBUGGER-HOOK :IN "/Users/toni/quicklisp/dists/quicklisp/software/slime-v2.18/swank/sbcl.lisp") # #<CLOSURE (LAMBDA NIL :IN SWANK::HA..
17: (SWANK::CALL-WITH-BINDINGS ((STANDARD-INPUT . #1=#<SWANK/GRAY::SLIME-INPUT-STREAM {1004ED6043}>) (STANDARD-OUTPUT . #2=#<SWANK/GRAY::SLIME-OUTPUT-STREAM {1004FA6EA3}>) (TRACE-OUTPUT . #2#) (*ERR..
18: (SWANK::HANDLE-REQUESTS #<SWANK::MULTITHREADED-CONNECTION {10042816F3}> NIL)
19: ((FLET #:WITHOUT-INTERRUPTS-BODY-1179 :IN SB-THREAD::INITIAL-THREAD-FUNCTION-TRAMPOLINE))
20: ((FLET SB-THREAD::WITH-MUTEX-THUNK :IN SB-THREAD::INITIAL-THREAD-FUNCTION-TRAMPOLINE))
21: ((FLET #:WITHOUT-INTERRUPTS-BODY-359 :IN SB-THREAD::CALL-WITH-MUTEX))
22: (SB-THREAD::CALL-WITH-MUTEX #<CLOSURE (FLET SB-THREAD::WITH-MUTEX-THUNK :IN SB-THREAD::INITIAL-THREAD-FUNCTION-TRAMPOLINE) {D279CFB}> #<SB-THREAD:MUTEX "thread result lock" owner: #<SB-THREAD:THREAD "..
23: (SB-THREAD::INITIAL-THREAD-FUNCTION-TRAMPOLINE #<SB-THREAD:THREAD "repl-thread" RUNNING {1005098003}> NIL #<CLOSURE (LAMBDA NIL :IN SWANK-REPL::SPAWN-REPL-THREAD) {1005097F7B}> (#<SB-THREAD:THREAD "re..
24: ("foreign function: call_into_lisp")
25: ("foreign function: new_thread_trampoline")
26: ("foreign function: _pthread_body")
27: ("foreign function: _pthread_body")
28: ("foreign function: thread_start")

When I do not add the :implementation key argument, it works as expected

LISP-MATRIX-USER> (M* (ones 2 2)
(ones 2 2))
#<LA-SIMPLE-MATRIX-DOUBLE 2 x 2
2.0d0 2.0d0
2.0d0 2.0d0>

So is a error about type LA-* and FA-* types, I'm not sure what happens


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#7, or mute the thread
https://github.com/notifications/unsubscribe-auth/AABb3jw2_qGL2VhW5-X4XraVVNVUCCINks5qwMnrgaJpZM4KMYqH
.

Sent from }*~£%¥>%=,?

@anquegi
Copy link
Author

anquegi commented Oct 4, 2016

Hi, thanks for your quick answer, when I tried the test I get this, it seems the same result as you expect in the src file lisp-matrix/src/unittests/test.lisp

(describe (run-lisp-matrix-tests))           ; long summary
;; current: 69 tests, 2 errors

but I also get 3 failures


LISP-MATRIX-UNITTESTS> (describe (run-lisp-matrix-tests))
Start: LISP-MATRIX-UT
Start: LISP-MATRIX-UT-VECTORS
Start: LISP-MATRIX-UT-VECTORS-GEMM
Start: LISP-MATRIX-UT-MATRIX
Start: LISP-MATRIX-UT-MATRIX-GEMM
Start: LISP-MATRIX-UT-MATRIX-LAPACK
Start: LISP-MATRIX-UT-MATRIX-VIEWS
Start: LISP-MATRIX-UT-DATATRANS
Test Report for LISP-MATRIX-UT: 69 tests run, 2 Errors, 3 Failures.

ERROR  : lisp-matrix-ut-matrix : matrix-foreign-array-integer-values
  Documentation: NIL
  Source       : /Users/toni/.roswell/lisp/quicklisp/dists/quicklisp/software/lisp-matrix-20150505-git/src/unittests/unittests-matrix.lisp
  Condition    : There is no applicable method for the generic function
                   #<STANDARD-GENERIC-FUNCTION LISP-MATRIX::MAKE-FA-MATRIX (4)>
                 when called with arguments
                   (2 5 NIL :INITIAL-ELEMENT NIL).
  During       : (TESTING)
  Code         : (
  ((ENSURE
    (MAKE-MATRIX 2 5 :IMPLEMENTATION :FOREIGN-ARRAY :ELEMENT-TYPE
                 'INTEGER :INITIAL-CONTENTS
                 #2A((1 2 3 4 5) (6 7 8 9 10))))))

ERROR  : lisp-matrix-ut-matrix-gemm : sticky-matmult-cases
  Documentation: NIL
  Source       : /Users/toni/.roswell/lisp/quicklisp/dists/quicklisp/software/lisp-matrix-20150505-git/src/unittests/unittests-matrix-lapack.lisp
  Condition    : There is no applicable method for the generic function
                   #<STANDARD-GENERIC-FUNCTION LISP-MATRIX:GEMM (8)>
                 when called with arguments
                   (1.0d0
                    #<FA-SIMPLE-MATRIX-DOUBLE  2 x 2
                  1.0d0 2.0d0
                  6.0d0 7.0d0>
                    #<FA-SIMPLE-MATRIX-DOUBLE  2 x 2
                  1.0d0 2.0d0
                  6.0d0 7.0d0>
                    0.0d0
                    #<LA-SIMPLE-MATRIX-DOUBLE  2 x 2
                  0.0d0 0.0d0
                  0.0d0 0.0d0>).
  During       : (TESTING)
  Code         : (
  ((LET ((M2-FA
          (MAKE-MATRIX 2 5 :IMPLEMENTATION :FOREIGN-ARRAY :ELEMENT-TYPE
                       #1='DOUBLE-FLOAT :INITIAL-CONTENTS
                       #2A((1.0d0 2.0d0 3.0d0 4.0d0 5.0d0)
                           (6.0d0 7.0d0 8.0d0 9.0d0 10.0d0))))
         (M3-FA
          (MAKE-MATRIX 2 2 :IMPLEMENTATION :FOREIGN-ARRAY :ELEMENT-TYPE
                       #1# :INITIAL-CONTENTS
                       #2A((1.0d0 2.0d0) (6.0d0 7.0d0)))))
     (M* M3-FA M3-FA)
     (M* M2-FA (TRANSPOSE-MATRIX M2-FA))
     (M* M3-FA (TRANSPOSE-MATRIX M3-FA)))))

Failure: lisp-matrix-ut-matrix-lapack : dot
  Documentation: NIL
  Source       : /Users/toni/.roswell/lisp/quicklisp/dists/quicklisp/software/lisp-matrix-20150505-git/src/unittests/unittests-matrix-lapack.lisp
  Condition    : Ensure failed: (=
                                 (DOT
                                  (ONES 2 2 :ELEMENT-TYPE
                                        'SINGLE-FLOAT)
                                  (SCAL 0.5
                                        (ONES 2 2 :ELEMENT-TYPE
                                              'SINGLE-FLOAT)))
                                 2.0) ()
  During       : (END-TEST)
  Code         : (
  ((LISP-MATRIX-UNITTESTS::FOR-ALL-IMPLEMENTATIONS
     (LIFT:ENSURE (= (DOT #1=(ONES 2 2) (SCAL 0.5d0 #1#)) 2.0d0))
     (LIFT:ENSURE
      (= (DOT #2=(ONES 2 2 :ELEMENT-TYPE 'SINGLE-FLOAT) (SCAL 0.5 #2#))
         2.0)))))

Failure: lisp-matrix-ut-matrix-lapack : nrm2
  Documentation: NIL
  Source       : /Users/toni/.roswell/lisp/quicklisp/dists/quicklisp/software/lisp-matrix-20150505-git/src/unittests/unittests-matrix-lapack.lisp
  Condition    : Ensure failed: (=
                                 (NRM2
                                  (ONES 2 2 :ELEMENT-TYPE
                                        'SINGLE-FLOAT))
                                 2.0) ()
  During       : (END-TEST)
  Code         : (
  ((LISP-MATRIX-UNITTESTS::FOR-ALL-IMPLEMENTATIONS
     (LIFT:ENSURE (= (NRM2 (ONES 2 2)) 2.0d0))
     (LIFT:ENSURE (= (NRM2 (ONES 2 2 :ELEMENT-TYPE 'SINGLE-FLOAT)) 2.0))
     (LIFT:ENSURE
      (= (NRM2 (ONES 2 2 :ELEMENT-TYPE '(COMPLEX SINGLE-FLOAT)))
         #C(2.0 0.0)))
     (LIFT:ENSURE
      (= (NRM2 (ONES 2 2 :ELEMENT-TYPE '(COMPLEX DOUBLE-FLOAT)))
         #C(2.0d0 0.0d0))))))

Failure: lisp-matrix-ut-matrix-lapack : asum
  Documentation: NIL
  Source       : /Users/toni/.roswell/lisp/quicklisp/dists/quicklisp/software/lisp-matrix-20150505-git/src/unittests/unittests-matrix-lapack.lisp
  Condition    : Ensure failed: (=
                                 (ASUM
                                  (ONES 2 2 :ELEMENT-TYPE
                                        'SINGLE-FLOAT))
                                 4.0) ()
  During       : (END-TEST)
  Code         : (
  ((LISP-MATRIX-UNITTESTS::FOR-ALL-IMPLEMENTATIONS
     (LIFT:ENSURE (= (ASUM (ONES 2 2)) 4.0d0))
     (LIFT:ENSURE (= (ASUM (ONES 2 2 :ELEMENT-TYPE 'SINGLE-FLOAT)) 4.0))
     (LIFT:ENSURE
      (= (ASUM (ONES 2 2 :ELEMENT-TYPE '(COMPLEX SINGLE-FLOAT)))
         #C(4.0 0.0)))
     (LIFT:ENSURE
      (= (ASUM (ONES 2 2 :ELEMENT-TYPE '(COMPLEX DOUBLE-FLOAT)))
         #C(4.0d0 0.0d0))))))

Test Report for LISP-MATRIX-UT: 69 tests run, 2 Errors, 3 Failures.
; No value

I hope this helps

@anquegi
Copy link
Author

anquegi commented Oct 4, 2016

Well, sorry for not reading, I was reading tests instead of examples, finally I get the point, closing the issue

@anquegi anquegi closed this as completed Oct 4, 2016
@blindglobe
Copy link
Owner

No problem! You were right in that I need to fix a few other things. And
lisp-matrix still needs lots of cleaning....

Please keep me up to date on all problems you find! I might actually have
time later this week to fix a few more and develop some stuff.

On Oct 4, 2016 11:58, "Antonio Juan" [email protected] wrote:

Closed #7 #7.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#7 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AABb3pmXNlJLirOEyx-SvUocyjp9zs60ks5qwiM_gaJpZM4KMYqH
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants