-
Notifications
You must be signed in to change notification settings - Fork 1
Closed
Description
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
Labels
No labels