Add QED Model (#25)

Reviewed-on: Rubydragon/MetagraphOptimization.jl#25
Co-authored-by: Anton Reinhard <anton.reinhard@proton.me>
Co-committed-by: Anton Reinhard <anton.reinhard@proton.me>
This commit is contained in:
2023-12-07 02:54:15 +01:00
committed by Anton Reinhard
parent 938bf216e5
commit c90346e948
47 changed files with 4013 additions and 905 deletions

View File

@@ -123,7 +123,6 @@ function remove_edge!(graph::DAG, node1::Node, node2::Node; track = true, invali
pre_length1 = length(node1.parents)
pre_length2 = length(node2.children)
#TODO: filter is very slow
for i in eachindex(node1.parents)
if (node1.parents[i] == node2)
splice!(node1.parents, i)
@@ -252,7 +251,6 @@ function invalidate_caches!(graph::DAG, operation::NodeFusion)
delete!(graph.possibleOperations, operation)
# delete the operation from all caches of nodes involved in the operation
# TODO: filter is very slow
for n in [1, 3]
for i in eachindex(operation.input[n].nodeFusions)
if operation == operation.input[n].nodeFusions[i]

View File

@@ -41,7 +41,7 @@ function show(io::IO, graph::DAG)
if length(graph.nodes) <= 20
show_nodes(io, graph)
else
print("Total: ", length(graph.nodes), ", ")
print(io, "Total: ", length(graph.nodes), ", ")
first = true
i = 0
for (type, number) in zip(keys(nodeDict), values(nodeDict))
@@ -49,12 +49,12 @@ function show(io::IO, graph::DAG)
if first
first = false
else
print(", ")
print(io, ", ")
end
if (i % 3 == 0)
print("\n ")
print(io, "\n ")
end
print(type, ": ", number)
print(io, type, ": ", number)
end
end
println(io)