Return-Path: X-Original-To: apmail-giraph-dev-archive@www.apache.org Delivered-To: apmail-giraph-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 01CADD2FB for ; Fri, 1 Mar 2013 09:02:28 +0000 (UTC) Received: (qmail 94694 invoked by uid 500); 1 Mar 2013 09:02:27 -0000 Delivered-To: apmail-giraph-dev-archive@giraph.apache.org Received: (qmail 94644 invoked by uid 500); 1 Mar 2013 09:02:27 -0000 Mailing-List: contact dev-help@giraph.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@giraph.apache.org Delivered-To: mailing list dev@giraph.apache.org Received: (qmail 94619 invoked by uid 99); 1 Mar 2013 09:02:26 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Mar 2013 09:02:26 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of claudio.martella@gmail.com designates 209.85.128.172 as permitted sender) Received: from [209.85.128.172] (HELO mail-ve0-f172.google.com) (209.85.128.172) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Mar 2013 09:02:20 +0000 Received: by mail-ve0-f172.google.com with SMTP id cz11so2731285veb.3 for ; Fri, 01 Mar 2013 01:02:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:mime-version:in-reply-to:references:from:date:message-id :subject:to:content-type; bh=vPDxj0nDN9E6IVaMmNHfBudi9LJ1dzBH9cIFkc//XNE=; b=Lta13xo4U/bYys58taJWfAeY1jPU4IqWSQMMVgQIsn5qBju+5uG/Xnceg7HdBoLvQ+ coaI8QAAu4k4PTmxtJc0Uw3nPTeu3SRUUeuSI2KBa3O6KPUuia0CLf9Bjbs/AKROaGOu BPKjVGvntVfADl19H5OmkTpTogXGgRQdOUXpujzeghUkS7scVCWDiQY3Ukv0fTMH4Lhv VN2pA9qMkexHqfkjqmPCVVc8bK591GcW6hASVV1ckCNP8IgDdk1GvelaasMtnruF56LW VhbIvvImFp+/qeCP4ABSQUsjjESLnFjjqISceN2YQd9zD2aInPBG6vh4DGqn+EH4K9Kw eBhw== X-Received: by 10.58.23.199 with SMTP id o7mr3902660vef.2.1362128520110; Fri, 01 Mar 2013 01:02:00 -0800 (PST) MIME-Version: 1.0 Received: by 10.220.189.1 with HTTP; Fri, 1 Mar 2013 01:01:40 -0800 (PST) In-Reply-To: <566834A0CA4ED742A53644FF331260D4380E84BA@PRN-MBX02-5.TheFacebook.com> References: <566834A0CA4ED742A53644FF331260D4380E84BA@PRN-MBX02-5.TheFacebook.com> From: Claudio Martella Date: Fri, 1 Mar 2013 10:01:40 +0100 Message-ID: Subject: Re: LongDoubleFloatDoubleVertex To: "dev@giraph.apache.org" Content-Type: multipart/alternative; boundary=047d7b339a15946a9904d6d942bd X-Virus-Checked: Checked by ClamAV on apache.org --047d7b339a15946a9904d6d942bd Content-Type: text/plain; charset=ISO-8859-1 Imagine you're infering an "is_a" property. e.g. you have lion - is_a -> mammal - is_a -> animal. by propagation you'd infer lion - is_a -> animal. Clearly, i'm talking about a graph that does not only have is_a typed edges. Two things can be noted: (1) one could filter out non is_a edges directly at loading in this case but (2) you'd want more complex of these, e.g. a path (a concatenation of is_a with lives_in or something?) to find out at query time or something. This is one example. I think most of our algorithms out there touch all the edges and iterate over (why else using such a big framework and loading the whole graph at first place?), so I'd optimise for them or avoid penalising them, but I would not remove from the API random access to edges either. After all, the idea is to have them implement their (to come) Edges class. On Fri, Mar 1, 2013 at 9:37 AM, Alessandro Presta wrote: > On 3/1/13 12:33 AM, "Claudio Martella" wrote: > > >On Fri, Mar 1, 2013 at 5:13 AM, Alessandro Presta > >wrote: > > > >> On 2/28/13 5:08 PM, "Jake Mannix" wrote: > >> > >> >On Thu, Feb 28, 2013 at 4:18 PM, Alessandro Presta > >> >wrote: > >> > > >> >> It's not like it causes problems, it's just that it's a pretty big > >> >> dependency to justify for a small example. > >> >> > >> >> As for the motivation, if your point is to prove the framework's > >> >> superiority in some context, then you can use the simplest possible > >> >> implementation (ArrayList). > >> >> > >> > > >> >This takes up LOTS of memory. Primitives rule, objects drool (memory). > >> > >> Ok, but having to copy the keys and values to external arrays (which is > >> what you have to do with Mahout's hash map) is even worse. A good > >> implementation of (long, double) edges (e.g. for RandomWalkVertex) is > >> primitive arrays. > >> > >> > > >> > > >> >> The Giraph framework is all about iterating over edges, so an > >> >> implementation that doesn't support that with reasonable efficiency > >> >> doesn't make a lot of sense to me. > >> >> > >> >> It also follows that hash map-based implementations only make sense > >>for > >> >> algorithms that make use of mutations. > >> >> > >> > > >> >Agreed, maps aren't absolutely necessary for immutable graphs. But > >>random > >> >access to collections of integers _is_ necessary for many algorithms. > >> >It's > >> >not all just iteration over lists. > >> > >> Can you give me some concrete examples of algorithms where random access > >> to the edges is required? > >> I'm really interested in this, because I'm considering killing > >> getEdgeValue() if there are no use cases. > >> > > > >My example would be typed/labeled graphs (e.g. RDF) for reasoning and > >traversals based on particular patterns/path. > > > > Can you be a bit more specific? I'm interested in knowing if this > algorithm would call getEdgeValue(id) for some target vertex id. > > > > >> > >> > > >> > > >> >> That said, something like a Trove hash map would probably be more > >> >> appropriate (more efficient than the standard Java HashMap, at the > >> >>expense > >> >> of generality). That could be a good candidate for a > >> >> LongDoubleHashMapEdges implementation. > >> >> I can give that a shot if it sounds good. > >> >> > >> > > >> >Trove is LGPL, IIRC, so that doesn't work in Apache projects. > >> > >> Whoops, totally missed that part. > >> > >> > > >> >What does Giraph depend on of Mahout now? Just mahout-collections? > >> >That's > >> >not a very big dependency, and has all sorts of primitive-to-primitive > >> >collections, > >> >and from what I've seen benchmarked, just as good or better than Trove. > >> > Carrot2's > >> >hppc may be better yet, but I'm not sure if that is stably released > >>yet. > >> > >> I'll take a look at HPPC and Mahout collections then. They all seem to > >> provide the same stuff, so I'll consider benchmarks and convenience of > >>the > >> API. Thanks for the pointers. > >> > >> > > >> > > >> >> > >> >> On 2/28/13 4:03 PM, "Jake Mannix" wrote: > >> >> > >> >> >Is the mahout dependency causing problems? > >> >> > > >> >> >It would be nice if we could actually implement some of the > >>algorithms > >> >> >that > >> >> >Mahout does via map-reduce in Giraph's BSP formalism, to show off > >>how > >> >>it > >> >> >improves things. Using the Mahout primitives can show that it's not > >> >>about > >> >> >the inner loop implementation, but the framework itself... > >> >> > > >> >> > > >> >> >On Thu, Feb 28, 2013 at 1:55 PM, Eli Reisman > >> >> >wrote: > >> >> > > >> >> >> I like the idea of refactoring it into something more appropriate > >> >>for us > >> >> >> and ditching the Mahout dep. Good looking out. > >> >> >> > >> >> >> > >> >> >> On Thu, Feb 28, 2013 at 10:15 AM, Claudio Martella < > >> >> >> claudio.martella@gmail.com> wrote: > >> >> >> > >> >> >> > I agree, at this point we could have a RandomWalkVertex with > >>edge > >> >> >>values, > >> >> >> > and a "null-edged" vertex for the PR benchmarks. > >> >> >> > We make everybody happy and avoid code duplication. > >> >> >> > > >> >> >> > > >> >> >> > On Thu, Feb 28, 2013 at 7:12 PM, Alessandro Presta > >> >> >> >> >> > >wrote: > >> >> >> > > >> >> >> > > Hi Gianmarco, > >> >> >> > > > >> >> >> > > Yes, there will be more efficient implementations. > >> >> >> > > In the redesign I'm working on (GIRAPH-528), there will be > >>only > >> >>one > >> >> >> > Vertex > >> >> >> > > class and edge storage is delegated to a VertexEdges class. > >> >> >> > > So far I'm adding some generic implementations > >>(ByteArrayEdges, > >> >> >> > > ArrayListEdges, HashMapEdges) that work for all types, and > >>some > >> >> >> optimized > >> >> >> > > ones (LongDoubleArrayEdges, LongNullArrayEdges). > >> >> >> > > > >> >> >> > > Do you specifically need edge values to be float while the > >>other > >> >> >>types > >> >> >> > are > >> >> >> > > double? > >> >> >> > > It seems to me it would make sense to change RandomWalkVertex > >>to > >> >>use > >> >> >> > > double edge values instead, and avoid code duplication (i.e. > >> >>adding > >> >> >>a > >> >> >> > > LongFloatArrayEdges that's basically the same). We're not > >>Trove > >> >> >>after > >> >> >> > all. > >> >> >> > > Makes sense? > >> >> >> > > > >> >> >> > > Thanks for the feedback, > >> >> >> > > > >> >> >> > > Alessandro > >> >> >> > > > >> >> >> > > > >> >> >> > > On 2/28/13 1:54 AM, "Gianmarco De Francisci Morales" > >> >> >> > >> >> >> > > wrote: > >> >> >> > > > >> >> >> > > >Hi, > >> >> >> > > > > >> >> >> > > >Maybe the specific implementation can be thrown away, but > >> >> >>personally I > >> >> >> > > >feel > >> >> >> > > >very strongly for the need of a good LongDoubleFloatDouble > >> >>vertex. > >> >> >> > > >It's the base for any serious random walk algorithm. > >> >> >> > > > > >> >> >> > > >I would call for a refactoring rather than a removal. > >> >> >> > > > > >> >> >> > > >Just my 2c. > >> >> >> > > > > >> >> >> > > >Cheers, > >> >> >> > > > > >> >> >> > > >-- > >> >> >> > > >Gianmarco > >> >> >> > > > > >> >> >> > > > > >> >> >> > > >On Thu, Feb 28, 2013 at 7:54 AM, Alessandro Presta > >> >> >> > > >wrote: > >> >> >> > > > > >> >> >> > > >> Hi all, > >> >> >> > > >> > >> >> >> > > >> Does anyone feel strongly for LongDoubleFloatDoubleVertex? > >> >> >> > > >> Reasons why I think it should be removed: > >> >> >> > > >> > >> >> >> > > >> 1. Right now it's incorrect (returns target vertex id as > >> >>edge > >> >> >> > value). > >> >> >> > > >> 2. Iteration will always be inefficient, since the > >> >>underlying > >> >> >> > Mahout > >> >> >> > > >> open-addressing hash map implementation doesn't provide > >> >> >>iterators. > >> >> >> It > >> >> >> > > >> provides a way to copy the keys and values to external > >> >> >>arrays/lists. > >> >> >> > > >> 3. It's the only reason why we have Mahout as a > >>dependency. > >> >> >> > > >> > >> >> >> > > >> I think we should strive to provide model implementations > >>that > >> >> >>are > >> >> >> > > >>generic > >> >> >> > > >> and/or extremely efficient. This one satisfies neither. > >> >> >> > > >> > >> >> >> > > >> Thanks, > >> >> >> > > >> > >> >> >> > > >> Alessandro > >> >> >> > > >> > >> >> >> > > > >> >> >> > > > >> >> >> > > >> >> >> > > >> >> >> > -- > >> >> >> > Claudio Martella > >> >> >> > claudio.martella@gmail.com > >> >> >> > > >> >> >> > >> >> > > >> >> > > >> >> > > >> >> >-- > >> >> > > >> >> > -jake > >> >> > >> >> > >> > > >> > > >> >-- > >> > > >> > -jake > >> > >> > > > > > >-- > > Claudio Martella > > claudio.martella@gmail.com > > -- Claudio Martella claudio.martella@gmail.com --047d7b339a15946a9904d6d942bd--