systemml-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matthias Boehm (JIRA)" <j...@apache.org>
Subject [jira] [Created] (SYSTEMML-2040) Repeated IPA function inling leads to replicated prints
Date Fri, 08 Dec 2017 03:06:00 GMT
Matthias Boehm created SYSTEMML-2040:
----------------------------------------

             Summary: Repeated IPA function inling leads to replicated prints
                 Key: SYSTEMML-2040
                 URL: https://issues.apache.org/jira/browse/SYSTEMML-2040
             Project: SystemML
          Issue Type: Bug
            Reporter: Matthias Boehm


Due to multiple rounds of IPA with a reused function call graph, the same function is inlined
multiple times leading to replication of operations. For most types of operations, common-subexpression
elimination removes this redundancy, but for prints and rand without seeds this leads to unnecessary
redundancy. For example,
{code}
s = "Debug info: " + sum(matrix(1,10,10))
z = foo(s);

foo = function(String msg) return (boolean flag) {
    is_debug = TRUE;
    if( is_debug ) {
        print(msg); flag = TRUE;
    } 
    else {
        flag = FALSE;
    }   
}
{code}

generates the following runtime plan with 3 replicated prints

{code}
PROGRAM
--MAIN PROGRAM
----GENERIC (lines 1-2) [recompile=false]
------(19) dg(rand) [10,10,1000,1000,100] [0,0,0 -> 0MB], CP
------(20) ua(+RC) (19) [0,0,-1,-1,-1] [0,0,0 -> 0MB], CP
------(21) b(+) (20) [0,0,-1,-1,-1] [0,0,0 -> 0MB], CP
------(5) u(print) (21) [-1,-1,-1,-1,-1] [0,0,0 -> 0MB]
------(7) TWrite z [0,0,-1,-1,-1] [0,0,0 -> 0MB], CP
------(5) u(print) (21) [-1,-1,-1,-1,-1] [0,0,0 -> 0MB]
------(7) TWrite z [0,0,-1,-1,-1] [0,0,0 -> 0MB], CP
------(5) u(print) (21) [-1,-1,-1,-1,-1] [0,0,0 -> 0MB]
------(7) TWrite z [0,0,-1,-1,-1] [0,0,0 -> 0MB], CP
{code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message