From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Nala Ginrut Newsgroups: gmane.lisp.guile.user Subject: Re: "AIscm" array JIT Date: Sat, 11 Jun 2016 01:38:46 +0800 Organization: HFG Message-ID: <1465580326.4741.8.camel@gmail.com> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1465580534 4780 80.91.229.3 (10 Jun 2016 17:42:14 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 10 Jun 2016 17:42:14 +0000 (UTC) To: Jan Wedekind , guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Fri Jun 10 19:42:08 2016 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1bBQPM-0001mB-HS for guile-user@m.gmane.org; Fri, 10 Jun 2016 19:39:48 +0200 Original-Received: from localhost ([::1]:43600 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bBQPL-0005zP-LM for guile-user@m.gmane.org; Fri, 10 Jun 2016 13:39:47 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55087) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bBQP0-0005zI-FZ for guile-user@gnu.org; Fri, 10 Jun 2016 13:39:28 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bBQOw-0008HE-AO for guile-user@gnu.org; Fri, 10 Jun 2016 13:39:25 -0400 Original-Received: from mail-pa0-x22f.google.com ([2607:f8b0:400e:c03::22f]:33652) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bBQOw-0008H4-0f for guile-user@gnu.org; Fri, 10 Jun 2016 13:39:22 -0400 Original-Received: by mail-pa0-x22f.google.com with SMTP id b13so3023754pat.0 for ; Fri, 10 Jun 2016 10:39:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:subject:from:to:date:in-reply-to:references:organization :mime-version:content-transfer-encoding; bh=peyV3hO/qeSzzb5AH5dR4XrqdOq9MMcPMNxQWfGprEg=; b=OMHGG7A5y0oPopUMLB6E8BrQfe4dIjA1awySWAKzTTg2jko2I8sv7ctjLhghtUHWsV qsi8Iip8/U4eQkhw8K++qcat3VtW+LhamBlaB7sg7JSWQ1ZOs5I9PFb2/6vCYotj1cBZ wDil5I+jAd7+H/mfWVLP6lYQCOWqowIsMDCihpCDflsXOEX/FH3Bo0tpBpsrJu5N6SfP TH5cKj+nhyZPYOvGWmH789Kp2ldhU+g3kolisLSZ+yCabznjKPolsecu0KspAbdEPLGt kPDiAwk7k6AKM52YW1+XV+jmN5ZHS0xSEZyjMN7gCtGbV0yufrJufrwDQWse4xUoKrSG kw9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:organization:mime-version:content-transfer-encoding; bh=peyV3hO/qeSzzb5AH5dR4XrqdOq9MMcPMNxQWfGprEg=; b=FMDLBezSVV32dWjkSYoqygn475h/bM5JjBZhXLI119Y7SPDgDQgTKlhd9oPUosvR1q wQJRdUuFhJiAEwdIzfgJnKS842IFJIIwDBxqIrb7/n0MJ0qKWlLMPVxuQDDUFRV8jRCL NztpKLtHXLGYT5OlmmT7xRNI8icCHQeFadY2dKN1Y0DA3yFeCH72fuBe692wT4/S6JlY RrDqclZjGxAk0m1OoOXJmJI6OvC8fG7hrsm8ePJoJ3VrVMiz4gWOUTE4DWB/i4KSQB4V BHWUm/NKVo/deKkA1WGK13+BkrIlQJlKuoR30OukSz8AFhVllYXbbLa96JTg2bKgjWSW UmyA== X-Gm-Message-State: ALyK8tIZVbkmOePQtjnFU6Dh6NMWFFuouEpjoKY07alLdCfLFGe8cPHJe+cPUd8Mk3CgHg== X-Received: by 10.66.47.133 with SMTP id d5mr3586790pan.48.1465580360918; Fri, 10 Jun 2016 10:39:20 -0700 (PDT) Original-Received: from localhost (li88-185.members.linode.com. [74.207.246.185]) by smtp.gmail.com with ESMTPSA id g195sm19211302pfb.7.2016.06.10.10.39.19 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 10 Jun 2016 10:39:20 -0700 (PDT) In-Reply-To: X-Mailer: Evolution 3.18.5.1-1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400e:c03::22f X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.org gmane.lisp.guile.user:12609 Archived-At: I've installed from debian repo and tried all the example code, very cool and impressive! Thanks for the work! Last months I tried matrix operations in Guile and ChezScheme, it's too slow. I expect to do some machine learning things to control robot car with the camera. And I found AIscm has the basic things what I want. Please continue the work, it's useful. ;-) On Wed, 2016-06-08 at 22:16 +0100, Jan Wedekind wrote: > Hi, >    I am working on a compact library [1] for JIT compilation of > array  > operations. It only runs on AMD64 processors. Currently it supports > array  > operations using booleans, integers, and integer RGB and integer > complex  > numbers. >    There are still important things missing: floating point numbers,  > compiling calls to C methods (e.g. sin, cos, ...), tensor > operations,  > convolutions, ... I would like to eventually do numerical processing  > similar to Python's NumPy (but more generic), Theano (but more > compact  > syntax as facilitated by macros), and OpenCV. >    Here is an example adding an integer to each element of a 2D array > and  > returning the result: > >      scheme@(guile-user)> (use-modules (oop goops) (aiscm jit) (aiscm > int) >                                        (aiscm pointer) (aiscm > sequence)) >      scheme@(guile-user)> (+ (arr (2 3 5) (7 11 13)) 3) >      $1 = #>>>: >      ((5 6 8) >       (10 14 16)) > >    The fallback method for the GOOPS generic "+" adds a JIT compiled > plus  > operation for the specific array types to the generic and then calls > "+"  > again. >    The corresponding machine code to produce the unsigned byte array > is  > shown below: > >       0:   4c 89 64 24 f0          mov    QWORD PTR [rsp-0x10],r12 >       5:   48 89 6c 24 e8          mov    QWORD PTR [rsp-0x18],rbp >       a:   4c 89 7c 24 e0          mov    QWORD PTR [rsp-0x20],r15 >       f:   4c 89 74 24 d8          mov    QWORD PTR [rsp-0x28],r14 >      14:   4c 89 6c 24 d0          mov    QWORD PTR [rsp-0x30],r13 >      19:   48 89 5c 24 c8          mov    QWORD PTR [rsp-0x38],rbx >      1e:   48 89 7c 24 f8          mov    QWORD PTR [rsp-0x8],rdi >      23:   4c 8b 64 24 08          mov    r12,QWORD PTR [rsp+0x8] >      28:   48 8b 7c 24 18          mov    rdi,QWORD PTR [rsp+0x18] >      2d:   48 8b 6c 24 20          mov    rbp,QWORD PTR [rsp+0x20] >      32:   8a 44 24 28             mov    al,BYTE PTR [rsp+0x28] >      36:   48 6b de 01             imul   rbx,rsi,0x1 >      3a:   49 8b f0                mov    rsi,r8 >      3d:   4d 6b cc 01             imul   r9,r12,0x1 >      41:   4c 8b fd                mov    r15,rbp >      44:   49 be 00 00 00 00 00    movabs r14,0x0 >      4b:   00 00 00 >      4e:   4c 8b 44 24 f8          mov    r8,QWORD PTR [rsp-0x8] >      53:   4d 3b f0                cmp    r14,r8 >      56:   74 3e                   je     0x96 >      58:   49 ff c6                inc    r14 >      5b:   4c 6b d9 01             imul   r11,rcx,0x1 >      5f:   4c 8b ee                mov    r13,rsi >      62:   4c 6b d7 01             imul   r10,rdi,0x1 >      66:   4d 8b e7                mov    r12,r15 >      69:   48 bd 00 00 00 00 00    movabs rbp,0x0 >      70:   00 00 00 >      73:   48 3b ea                cmp    rbp,rdx >      76:   74 16                   je     0x8e >      78:   48 ff c5                inc    rbp >      7b:   45 8a 04 24             mov    r8b,BYTE PTR [r12] >      7f:   44 02 c0                add    r8b,al >      82:   45 88 45 00             mov    BYTE PTR [r13+0x0],r8b >      86:   4d 03 eb                add    r13,r11 >      89:   4d 03 e2                add    r12,r10 >      8c:   eb e5                   jmp    0x73 >      8e:   48 03 f3                add    rsi,rbx >      91:   4d 03 f9                add    r15,r9 >      94:   eb b8                   jmp    0x4e >      96:   4c 8b 64 24 f0          mov    r12,QWORD PTR [rsp-0x10] >      9b:   48 8b 6c 24 e8          mov    rbp,QWORD PTR [rsp-0x18] >      a0:   4c 8b 7c 24 e0          mov    r15,QWORD PTR [rsp-0x20] >      a5:   4c 8b 74 24 d8          mov    r14,QWORD PTR [rsp-0x28] >      aa:   4c 8b 6c 24 d0          mov    r13,QWORD PTR [rsp-0x30] >      af:   48 8b 5c 24 c8          mov    rbx,QWORD PTR [rsp-0x38] >      b4:   c3                      ret > > > >    Any comments,suggestions, and feedback are welcome! > > Regards > Jan > > [1] https://github.com/wedesoft/aiscm >