Skip to content

More memory than expected in graph_exp_native_jl: #61

@jarlebring

Description

@jarlebring

The generated code for graph_exp_native_jl needs less memory when the norm is increased:

julia> (graph_bad,_)=graph_exp_native_jl(1.0); gen_code("/tmp/bad.jl",graph_bad);
julia> (graph_good,_)=graph_exp_native_jl(2.5); gen_code("/tmp/good.jl",graph_good);

bad.jl:

    # max_memslots=7
    n=size(A,1)
    # The first slots are precomputed nodes [:A]
    memslots2 = similar(A,T)
    memslots3 = similar(A,T)
    memslots4 = similar(A,T)
    memslots5 = similar(A,T)
    memslots6 = similar(A,T)
    memslots7 = similar(A,T)
    # Assign precomputed nodes memslots 
    memslots1=A # overwrite A
    # Uniform scaling is exploited.
    # No matrix I explicitly allocated.
    value_one=ValueOne()
    # Computation order: A2 A4 A6 A8 Ua U V Z X P

good.jl:

    # max_memslots=6
    n=size(A,1)
    # The first slots are precomputed nodes [:A]
    memslots2 = similar(A,T)
    memslots3 = similar(A,T)
    memslots4 = similar(A,T)
    memslots5 = similar(A,T)
    memslots6 = similar(A,T)
    # Assign precomputed nodes memslots 
    memslots1=A # overwrite A
    # Uniform scaling is exploited.
    # No matrix I explicitly allocated.
    value_one=ValueOne()
    # Computation order: A2 A4 A6 Ub3 Ub Uc U Vb3 Vb V Z X P

This seems counterintuitive since "bad" is a lower degree Padé approximant. Is a different topological order possible to get better topological order for "bad"? This can be quite tricky to investigate since we probably need to study what happens after extract_sums.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy