Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 03A86200C62 for ; Wed, 26 Apr 2017 19:57:09 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 02337160BA8; Wed, 26 Apr 2017 17:57:09 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 49193160B8F for ; Wed, 26 Apr 2017 19:57:08 +0200 (CEST) Received: (qmail 93748 invoked by uid 500); 26 Apr 2017 17:57:07 -0000 Mailing-List: contact issues-help@systemml.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@systemml.incubator.apache.org Delivered-To: mailing list issues@systemml.incubator.apache.org Received: (qmail 93739 invoked by uid 99); 26 Apr 2017 17:57:07 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 26 Apr 2017 17:57:07 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 229E1D567D for ; Wed, 26 Apr 2017 17:57:07 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.202 X-Spam-Level: X-Spam-Status: No, score=-99.202 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id 9tRHiaxY_Dju for ; Wed, 26 Apr 2017 17:57:06 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 7F3535FB38 for ; Wed, 26 Apr 2017 17:57:05 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id B7BD2E0BDF for ; Wed, 26 Apr 2017 17:57:04 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 21DEF21DE4 for ; Wed, 26 Apr 2017 17:57:04 +0000 (UTC) Date: Wed, 26 Apr 2017 17:57:04 +0000 (UTC) From: "Niketan Pansare (JIRA)" To: issues@systemml.incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Comment Edited] (SYSTEMML-1561) Improve constant folding during compilation MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Wed, 26 Apr 2017 17:57:09 -0000 [ https://issues.apache.org/jira/browse/SYSTEMML-1561?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15985257#comment-15985257 ] Niketan Pansare edited comment on SYSTEMML-1561 at 4/26/17 5:57 PM: -------------------------------------------------------------------- [~mwdusenb@us.ibm.com] We definitely need to address this issue. As an FYI, Caffe2DML works around this issue by computing the shapes at compile time rather than runtime. was (Author: niketanpansare): [~mwdusenb@us.ibm.com] We definitely need to address this issue. As an FYI, Caffe2DML addresses this issue by computing the shapes at compile time rather than runtime. > Improve constant folding during compilation > ------------------------------------------- > > Key: SYSTEMML-1561 > URL: https://issues.apache.org/jira/browse/SYSTEMML-1561 > Project: SystemML > Issue Type: Improvement > Reporter: Mike Dusenberry > Attachments: scenario1_plan.txt, scenario1.py, scenario2_plan.txt, scenario2.py > > > In our `nn` library, our convolution and pooling layers have to pass around the spatial dimensions (height and width) of the images that are stretched out into rows of the input/output matrices. These output dimensions are computed within the forward functions of the above layers as small scalar equations. From a mathematical standpoint, these sizes can be determined at compile time, and it is nice to have these size equations in DML (v.s. hiding them inside the engine within built-in functions). However, we do not currently evaluate these expressions during compilation, and thus we are left with unknown sizes even during recompilation. This naturally leads to max memory estimates and thus often leads to unnecessary distributed runtime ops rather than simple CP ones. > I have two related scenarios for which this is a problem. They both involve the {{Houtc1}} & {{Woutc1}} values that are returned from a `conv2d::forward(...)` function. These represent the spatial dimensions of the volume with each of the rows of the output {{outc1}} of the function, and the third dimension is {{F1}}. Thus, {{outc1}} has a number of columns equal to {{F1*Houtc1*Wouc1}}. > In the first scenario ({{scenario1.py}}), a random matrix {{doutc1}} is created that should have the same dimensions as {{outc1}}. For the columns, if I use {{cols=ncol(outc1)}} in this rand statement, the size will be propagated and CP ops will be compiled and run. I I instead use {{cols=F1*Houtc1*Woutc1}}, the size will forever be unknown, even during recompilation, and thus Spark ops will be compiled and run. I have included the recompile hops plan ({{scenario1_plan.txt}}). > In the second scenario ({{scenario2.py}}), a {{max_pool2d::forward(...)}} function is inserted after the {{conv2d::forward(...)}} function that requires the {{Houtc1}} and {{Woutc1}} variables to be supplied as arguments. Since those latter variables are not executed during compilation time, the max pooling sizes remain unknown, even during recompilation, and thus Spark ops will be compiled and run. I have included the recompile hops plan ({{scenario2_plan.txt}}). > We should either improve or fix our constant folding rewrites so that these scenarios are fixed, as they are necessary for performant deep learning applications. Note too that this issue will be present in other non-deep learning scenarios as well. > Mailing list thread: https://www.mail-archive.com/dev@systemml.incubator.apache.org/msg01657.html -- This message was sent by Atlassian JIRA (v6.3.15#6346)