Fix GlobalMetric Estimator Cost function compare

This commit is contained in:
Anton Reinhard 2024-03-06 23:44:47 +01:00
parent 86ad9ed5e8
commit 2e16b0dca7
13 changed files with 1478 additions and 35 deletions

View File

@ -2,3 +2,4 @@
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
DocumenterTools = "35a29f4d-8980-5a13-9543-d66fff28ecb8"
MetagraphOptimization = "3e869610-d48d-4942-ba70-c1b702a33ca4"
QEDprocesses = "46de9c38-1bb3-4547-a1ec-da24d767fdad"

BIN
images/cpu_vs_gpu_abc.pdf Normal file

Binary file not shown.

BIN
images/cpu_vs_gpu_qed.pdf Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,3 @@
"""
CDCost
@ -34,7 +33,7 @@ function isless(cost1::CDCost, cost2::CDCost)::Bool
end
function zero(type::Type{CDCost})
return (data = 0.0, computeEffort = 00.0, computeIntensity = 0.0)::CDCost
return (data = 0.0, computeEffort = 0.0, computeIntensity = 0.0)::CDCost
end
function typemax(type::Type{CDCost})

View File

@ -42,10 +42,10 @@ Create a short string suitable as a filename or similar, describing the given pr
julia> using MetagraphOptimization
julia> String(parse_process("ke->ke", QEDModel()))
qed_ke-ke
"qed_ke-ke"
julia> print(parse_process("kk->ep", QEDModel()))
qed_kk-ep
QED Process: 'kk->ep'
```
"""
function String(process::QEDProcessDescription)

View File

@ -1,32 +1,32 @@
# TODO use correct numbers
# compute effort numbers were measured on a home pc system using likwid
"""
compute_effort(t::ComputeTaskQED_S1)
Return the compute effort of an S1 task.
"""
compute_effort(t::ComputeTaskQED_S1)::Float64 = 11.0
compute_effort(t::ComputeTaskQED_S1)::Float64 = 475.0
"""
compute_effort(t::ComputeTaskQED_S2)
Return the compute effort of an S2 task.
"""
compute_effort(t::ComputeTaskQED_S2)::Float64 = 12.0
compute_effort(t::ComputeTaskQED_S2)::Float64 = 505.0
"""
compute_effort(t::ComputeTaskQED_U)
Return the compute effort of a U task.
"""
compute_effort(t::ComputeTaskQED_U)::Float64 = 1.0
compute_effort(t::ComputeTaskQED_U)::Float64 = (291.0 + 467.0 + 16.0 + 17.0) / 4.0 # The exact FLOPS count depends heavily on the type of particle, take an average value here
"""
compute_effort(t::ComputeTaskQED_V)
Return the compute effort of a V task.
"""
compute_effort(t::ComputeTaskQED_V)::Float64 = 6.0
compute_effort(t::ComputeTaskQED_V)::Float64 = (1150.0 + 764.0 + 828.0) / 3.0
"""
compute_effort(t::ComputeTaskQED_P)

View File

@ -21,7 +21,7 @@ function optimize_step!(optimizer::GreedyOptimizer, graph::DAG)
lowestCost = reduce(
(acc, op) -> begin
op_cost = operation_effect(optimizer.estimator, graph, op)
if op_cost < acc
if isless(op_cost, acc)
result = op
return op_cost
end
@ -50,7 +50,7 @@ function fixpoint_reached(optimizer::GreedyOptimizer, graph::DAG)
lowestCost = reduce(
(acc, op) -> begin
op_cost = operation_effect(optimizer.estimator, graph, op)
if op_cost < acc
if isless(op_cost, acc)
return op_cost
end
return acc

View File

@ -18,7 +18,7 @@ function schedule_dag(::GreedyScheduler, graph::DAG, machine::Machine)
sizehint!(schedule, length(graph.nodes))
# keep an accumulated cost of things scheduled to this device so far
deviceAccCost = PriorityQueue{AbstractDevice, Int}()
deviceAccCost = PriorityQueue{AbstractDevice, Float64}()
for device in machine.devices
enqueue!(deviceAccCost, device => 0)
end