Return-Path: X-Original-To: apmail-horn-dev-archive@minotaur.apache.org Delivered-To: apmail-horn-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D2F0418B32 for ; Thu, 29 Oct 2015 04:51:21 +0000 (UTC) Received: (qmail 56396 invoked by uid 500); 29 Oct 2015 04:51:21 -0000 Delivered-To: apmail-horn-dev-archive@horn.apache.org Received: (qmail 56361 invoked by uid 500); 29 Oct 2015 04:51:21 -0000 Mailing-List: contact dev-help@horn.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@horn.incubator.apache.org Delivered-To: mailing list dev@horn.incubator.apache.org Received: (qmail 56349 invoked by uid 99); 29 Oct 2015 04:51:21 -0000 Received: from Unknown (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 29 Oct 2015 04:51:21 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id E615AC0F5F for ; Thu, 29 Oct 2015 04:51:20 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 3.15 X-Spam-Level: *** X-Spam-Status: No, score=3.15 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, HTML_MESSAGE=3, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd4-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-eu-west.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id k4o1GRX5-o-X for ; Thu, 29 Oct 2015 04:51:08 +0000 (UTC) Received: from mail-yk0-f182.google.com (mail-yk0-f182.google.com [209.85.160.182]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with ESMTPS id 3984820924 for ; Thu, 29 Oct 2015 04:51:07 +0000 (UTC) Received: by ykba4 with SMTP id a4so31099636ykb.3 for ; Wed, 28 Oct 2015 21:51:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=3KNB4dlmMx+d6zVmoog4nVBZe37Cibm88STbt1r0Kh4=; b=IMATOJbUIM/F8zcEswqN9Su9Nx6urYWVmEu8zZIVI2tUqPj8cUlYjgFDAbKwdJubr2 k4zg03RnP0rjhfNXU0CXpppWlv2SSihfCBV0K5F4OKju2IQPgSIKsgarriBBZEbHjPIv mchuG80OBnppatnPX6v4fshTsP9Tgg/70dzmCP7u39vXmr1ab2KW+/g89HL4EV/3sPN+ ypKFT97N5NxE/pvtykKBw6ZRW6XuK2pm1nR7Aq1CYMej4uswym3xLwyQkQmzp9/L5mKY HdbjCJ8Bru7kirRYJNJ449LrcPmqFRxnces4zdEaGjekUrLDjOsoQ6izsU33F05oOYKf IAOg== MIME-Version: 1.0 X-Received: by 10.13.203.141 with SMTP id n135mr15110761ywd.335.1446094266045; Wed, 28 Oct 2015 21:51:06 -0700 (PDT) Received: by 10.37.217.216 with HTTP; Wed, 28 Oct 2015 21:51:05 -0700 (PDT) In-Reply-To: References: Date: Thu, 29 Oct 2015 13:51:05 +0900 Message-ID: Subject: Re: Java On GPU: Rootbear, Java 8 From: Shubham Mehta To: dev@horn.incubator.apache.org Content-Type: multipart/alternative; boundary=001a114e43e00a1d000523370fb9 --001a114e43e00a1d000523370fb9 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable That's really a good point. I also guess that we will need to provide mathematical functions, so that Users can defined there neuron object using these functions. Does anyone happen to know any project where GPU enable/disable functionality was given before? On Thu, Oct 29, 2015 at 1:16 PM, Edward J. Yoon wrote: > We also need to think whether hiding GPU acceleration code is possible. > > To support enable/disable GPU acceleration without code changing from > user-side, we maybe should not allow user to write a formula for some > calculations directly within neuron-centric programming model if we > can't accelerate the calculations of (user-defined) neuron objects > directly on GPU. > > I roughly guess we will need to provide arithmetic operation methods > like functional lang e.g., multiply(), ..., etc. Then, we can generate > the code for GPU internally. > > > On Thu, Oct 29, 2015 at 9:20 AM, Shubham Mehta > wrote: > > GPU programming can be done two ways: > > -> CUDA: It has very limited vendors > > -> OpenCl: It is much more portable > > > > A comparative study between *CUDA* and *OpenCL*: > > http://wiki.tiker.net/CudaVsOpenCL > > > > *Conclusion: *I personally think that we should go with OpenCL. Though, > we > > lose a bit on performance. > > > > If we go by OpenCL then rootbeer option is ruled out. Also, it is not > > maintained at present. I suggest that we should go for *Aparapi*( > > https://github.com/aparapi/aparapi) which is also open source and well > > maintained. *Aparapi *is based on OpenCL. > > > > A comparative study between *JCuda *and* Aparapi*: > > http://www.des.udc.es/~juan/papers/eoops2013.pdf > > Its comnclusion says that JCuda requires more programming effort but ca= n > > give better performance when used with optimized CUDA libraries (CUFFT > and > > CUBLABS) > > > > > > > > > > > > On Wed, Oct 28, 2015 at 1:30 PM, Edward J. Yoon > > wrote: > > > >> Cool, I can look at about GC problem of rootbeer and Java8 closely. > >> > >> On Wednesday, 28 October 2015, Shubham Mehta > > >> wrote: > >> > >> > Hi, > >> > > >> > As you know Edward suggested that we can go by Rootbear( > >> > > >> > > >> > https://raw.githubusercontent.com/pcpratts/rootbeer1/master/doc/rootbeer1= _paper.pdf > >> . > >> > ). > >> > So, I was going through their paper regarding how they supported GPU > >> > acceleration for Java. > >> > > >> > The main idea is cross compilation of Java bytecode to CUDA. They ha= ve > >> > tried to get highest performance in (de)serialization to and from GP= U > >> > memory by comparing few approaches: JNI, Pure Java and Reflection. > >> Finally, > >> > they used Pure Java to read everything into Java byte array. After > that, > >> > one JNI call to copy everything to GPU memory. > >> > > >> > Each Java Object is represented in GPU memory as two segments-Static > mem. > >> > and Instance mem. They mostly haven't done Garbage Collection on GPU= , > >> which > >> > I think shouldn't bother us. > >> > > >> > For code conversion to CUDA, they use *Soot Optimization Framework* > (Raja > >> > Vall=C3=A9e-Rai, Laurie Hendren, Vijay Sundaresan, Patrick Lam, Etie= nne > Gagnon > >> > and Phong Co. Soot - a Java Optimization Framework) to load .class > files > >> > from jar to an intermediate in memory representation called Jimple > which > >> is > >> > then analyzed to generate CUDA code. > >> > > >> > *In short, it will server our purpose to run computation support GPU= s > for > >> > neuron-centric programming model.* > >> > > >> > But before taking final decision, it would be great if someone can > look > >> > into the following paper: > >> > "*Evaluation of Java for General Purpose GPU Computing "* > >> > This paper cites Rootbear and has done comparative study of all > available > >> > framework for running Java code on GPGPU. I couldn't access it. > >> > > >> > Also, I read that Java 8 provides parallel stream APIs with lambda > >> > expressions to facilitate parallel programming for multi-core CPUs a= nd > >> > many-code GPUs. Does anyone know about this in more detail? > >> > > >> > Lastly, people are trying to use ML to decide between GPU and CPU > during > >> > runtime. I don't know how well it scales. It is very recent study. > >> > "*Machine-Learning-based Performance Heuristics for Runtime CPU/GPU > >> > Selection*" > >> > > >> > Best Regards, > >> > Shubham > >> > > >> > > >> > > >> > > >> > > >> > > >> > -- > >> > Shubham Mehta > >> > B.Tech 2015 > >> > Computer Science and Engineering > >> > IIT Bombay > >> > > >> > >> > >> -- > >> Best Regards, Edward J. Yoon > >> > > > > > > > > -- > > Shubham Mehta > > B.Tech 2015 > > Computer Science and Engineering > > IIT Bombay > > > > -- > Best Regards, Edward J. Yoon > --=20 Shubham Mehta Software Engineer Samsung Electronics Suwon, South Korea --001a114e43e00a1d000523370fb9--