Compare commits

..

39 Commits

Author SHA1 Message Date
3a5d4fedd7 Add results in zip file
Some checks failed
MetagraphOptimization_CI / test (push) Failing after 10m0s
MetagraphOptimization_CI / docs (push) Successful in 8m53s
2024-05-08 11:32:29 +02:00
723c460cf6 Format eval scripts
All checks were successful
MetagraphOptimization_CI / docs (push) Successful in 7m17s
MetagraphOptimization_CI / test (push) Successful in 22m30s
2024-03-13 20:48:44 +01:00
810695171a Cleanup
Some checks failed
MetagraphOptimization_CI / test (push) Failing after 7m44s
MetagraphOptimization_CI / docs (push) Successful in 8m28s
2024-03-13 18:51:31 +01:00
70127817b3 Final data and eval scripts 2024-03-12 20:40:26 +01:00
d121daf206 Evaluate new reduce data 2024-03-08 03:11:55 +01:00
f5157b6395 Evaluate new reduce data 2024-03-08 01:19:50 +01:00
961b616ad1 Evaluate full node data 2024-03-08 00:45:28 +01:00
ddfc9191d5 evaluation 2024-03-07 22:53:26 +01:00
ae99be7207 Improve qed_bench_redcution_steps_gpu 2024-03-07 22:28:50 +01:00
371467c2bc Full node fix 2024-03-07 16:53:59 +01:00
1d957bc128 Minor experiment fixes 2024-03-07 02:02:43 +01:00
d036f21862 Use CUDA kernels in bench scripts 2024-03-07 00:08:04 +01:00
2e16b0dca7 Fix GlobalMetric Estimator Cost function compare 2024-03-06 23:45:02 +01:00
86ad9ed5e8 Add kernel generating function 2024-03-06 23:41:58 +01:00
0d9b066915 A100 bench 2024-03-06 00:34:33 +01:00
b39bc480a1 full node bench testing 2024-03-05 20:55:04 +01:00
b7f8e4a6b3 Add split and fuse optimizers similar to reduce optimizer 2024-03-05 15:41:30 +01:00
71219f101e Add full node bench example 2024-03-05 13:15:55 +01:00
f3dab45f31 Add reduction bench data and images 2024-03-04 22:53:54 +01:00
2784c82c23 Add reduce data 2024-02-29 10:58:12 +01:00
78717c2b43 Move reduction notebook, add reduce_bench eval script 2024-02-26 22:10:21 +01:00
4584285126 Fix hemera scripts 2024-02-26 11:41:43 +01:00
fc31299d1e Fix GPU bench scripts 2024-02-22 15:16:35 +01:00
f4747bfc9d Fix gpu gres for slurm 2024-02-21 17:03:47 +01:00
daf22ecdb0 Clean up data 2024-02-21 16:57:57 +01:00
17c2df800c Add reduction benchmarks 2024-02-20 21:18:19 +01:00
fce9110e2a Add new gen results 2024-02-19 01:20:22 +01:00
52e7bf43ad EOD 2024-02-14 15:52:07 +01:00
8bbbc72bfc Evaluate memory footprints of hemera, generate process numbers in notebook 2024-02-13 23:38:55 +01:00
6a02f3bee6 Add new GPU data point; Add smaller diagram number function 2024-02-13 16:43:48 +01:00
5be483c4c1 Prepare hemera execution benchmark 2024-02-13 15:58:10 +01:00
4c05167901 Add notebook with number of Feynman Diagrams function 2024-02-13 15:53:47 +01:00
6186776059 Evaluation scripts and images 2024-02-13 11:52:02 +01:00
c6ebf91079 add one-sided diagram generation for compton 2024-02-12 18:54:40 +01:00
a198f37f8e hemera benchmark 2024-02-12 14:38:55 +01:00
312d93cb4c Add graph gen benchmark, eval script, and result image 2024-02-07 19:48:03 +01:00
007d970a12 Add specialized compton diagram generation function for much improved runtime 2024-02-06 10:58:29 +01:00
3ac9954d32 Add evaluation script, run script, csv data and first plots 2024-02-06 09:35:04 +01:00
7098d1801a Add qed bench run script and singularity container 2024-02-02 07:05:51 +01:00
12 changed files with 32 additions and 80 deletions

View File

@ -17,9 +17,9 @@ jobs:
fetch-depth: 0
- name: Setup Julia environment
uses: https://github.com/julia-actions/setup-julia@v2
uses: https://github.com/julia-actions/setup-julia@v1.9.2
with:
version: '1.10'
version: '1.9.2'
- name: Instantiate
run: |
@ -58,9 +58,9 @@ jobs:
fetch-depth: 0
- name: Setup Julia environment
uses: https://github.com/julia-actions/setup-julia@v2
uses: https://github.com/julia-actions/setup-julia@v1.9.2
with:
version: '1.10'
version: '1.9.2'
- name: Build docs
run: |

View File

@ -1,10 +1,9 @@
authors = ["Anton Reinhard <anton.reinhard@proton.me>"]
name = "MetagraphOptimization"
uuid = "3e869610-d48d-4942-ba70-c1b702a33ca4"
authors = ["Anton Reinhard <anton.reinhard@proton.me>"]
version = "0.1.0"
[deps]
AMDGPU = "21141c5a-9bdb-4563-92ae-f87d6854732e"
AccurateArithmetic = "22286c92-06ac-501d-9306-4abd417d9753"
CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"
Combinatorics = "861a8166-3701-5b0c-9a16-15d98fcdc6aa"
@ -19,7 +18,6 @@ Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Roots = "f2b01f46-fcfa-551c-844a-d8ac1e96c665"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"
oneAPI = "8f75cd03-7ff8-4ecb-9b8f-daf728133b1b"
[extras]
CUDA_Runtime_jll = "76a88914-d11a-5bdc-97e0-2f5a05c973a2"

View File

@ -196,8 +196,10 @@ include("devices/impl.jl")
include("devices/numa/impl.jl")
include("devices/cuda/impl.jl")
include("devices/rocm/impl.jl")
include("devices/oneapi/impl.jl")
# can currently not use AMDGPU because of incompatability with the newest rocm drivers
# include("devices/rocm/impl.jl")
# oneapi seems also broken for now
# include("devices/oneapi/impl.jl")
include("scheduler/interface.jl")
include("scheduler/greedy.jl")

View File

@ -84,13 +84,11 @@ Compute a sum over the vector. Use an algorithm that accounts for accumulated er
Linearly many FLOP with growing data.
"""
function compute(::ComputeTaskABC_Sum, data...)::Float64
return sum_kbn([data...])
#=s = 0.0im
s = 0.0im
for d in data
s += d
end
return s=#
return s
end
function compute(::ComputeTaskABC_Sum, data::AbstractArray)::Float64

View File

@ -27,6 +27,9 @@ Return a ProcessInput of randomly generated [`ABCParticle`](@ref)s from a [`ABCP
Note: This uses RAMBO to create a valid process with conservation of momentum and energy.
"""
function gen_process_input(processDescription::ABCProcessDescription)
inParticleTypes = keys(processDescription.inParticles)
outParticleTypes = keys(processDescription.outParticles)
massSum = 0
inputMasses = Vector{Float64}()
for (particle, n) in processDescription.inParticles
@ -63,7 +66,8 @@ function gen_process_input(processDescription::ABCProcessDescription)
index = 1
for (particle, n) in processDescription.outParticles
for _ in 1:n
push!(outputParticles, particle(final_momenta[index]))
mom = final_momenta[index]
push!(outputParticles, particle(SFourMomentum(-mom.E, mom.px, mom.py, mom.pz)))
index += 1
end
end

View File

@ -313,7 +313,7 @@ Return the factor of a vertex in a QED feynman diagram.
return -1im * e * gamma()
end
@inline function QED_inner_edge(p::QEDParticle)
@inline function QED_inner_edge(p::QEDParticle)::DiracMatrix
return propagator(particle(p), p.momentum)
end

View File

@ -27,8 +27,7 @@ function optimize_step!(optimizer::RandomWalkOptimizer, graph::DAG)
# push
# choose one of fuse/split/reduce
# TODO refactor fusions so they actually work
option = rand(r, 2:3)
option = rand(r, 1:3)
if option == 1 && !isempty(operations.nodeFusions)
push_operation!(graph, rand(r, collect(operations.nodeFusions)))
return true

View File

@ -48,7 +48,7 @@ function insert_helper!(
trie::NodeIdTrie{NodeType},
node::NodeType,
depth::Int,
) where {TaskType <: AbstractDataTask, NodeType <: DataTaskNode{TaskType}}
) where {TaskType <: AbstractTask, NodeType <: Union{DataTaskNode{TaskType}, ComputeTaskNode{TaskType}}}
if (length(children(node)) == depth)
push!(trie.value, node)
return nothing
@ -62,26 +62,6 @@ function insert_helper!(
end
return insert_helper!(trie.children[id], node, depth)
end
# TODO: Remove this workaround once https://github.com/JuliaLang/julia/issues/54404 is fixed in julia 1.10+
function insert_helper!(
trie::NodeIdTrie{NodeType},
node::NodeType,
depth::Int,
) where {TaskType <: AbstractComputeTask, NodeType <: ComputeTaskNode{TaskType}}
if (length(children(node)) == depth)
push!(trie.value, node)
return nothing
end
depth = depth + 1
id = node.children[depth].id
if (!haskey(trie.children, id))
trie.children[id] = NodeIdTrie{NodeType}()
end
return insert_helper!(trie.children[id], node, depth)
end
"""
insert!(trie::NodeTrie, node::Node)
@ -91,17 +71,7 @@ Insert the given node into the trie. It's sorted by its type in the first layer,
function insert!(
trie::NodeTrie,
node::NodeType,
) where {TaskType <: AbstractDataTask, NodeType <: DataTaskNode{TaskType}}
if (!haskey(trie.children, NodeType))
trie.children[NodeType] = NodeIdTrie{NodeType}()
end
return insert_helper!(trie.children[NodeType], node, 0)
end
# TODO: Remove this workaround once https://github.com/JuliaLang/julia/issues/54404 is fixed in julia 1.10+
function insert!(
trie::NodeTrie,
node::NodeType,
) where {TaskType <: AbstractComputeTask, NodeType <: ComputeTaskNode{TaskType}}
) where {TaskType <: AbstractTask, NodeType <: Union{DataTaskNode{TaskType}, ComputeTaskNode{TaskType}}}
if (!haskey(trie.children, NodeType))
trie.children[NodeType] = NodeIdTrie{NodeType}()
end

View File

@ -1,8 +1,6 @@
using MetagraphOptimization
using Random
RNG = Random.MersenneTwister(321)
function test_known_graph(name::String, n, fusion_test = true)
@testset "Test $name Graph ($n)" begin
graph = parse_dag(joinpath(@__DIR__, "..", "input", "$name.txt"), ABCModel())
@ -11,7 +9,7 @@ function test_known_graph(name::String, n, fusion_test = true)
if (fusion_test)
test_node_fusion(graph)
end
test_random_walk(RNG, graph, n)
test_random_walk(graph, n)
end
end
@ -45,7 +43,7 @@ function test_node_fusion(g::DAG)
end
end
function test_random_walk(RNG, g::DAG, n::Int64)
function test_random_walk(g::DAG, n::Int64)
@testset "Test Random Walk ($n)" begin
# the purpose here is to do "random" operations and reverse them again and validate that the graph stays the same and doesn't diverge
reset_graph!(g)
@ -56,18 +54,18 @@ function test_random_walk(RNG, g::DAG, n::Int64)
for i in 1:n
# choose push or pop
if rand(RNG, Bool)
if rand(Bool)
# push
opt = get_operations(g)
# choose one of fuse/split/reduce
option = rand(RNG, 1:3)
option = rand(1:3)
if option == 1 && !isempty(opt.nodeFusions)
push_operation!(g, rand(RNG, collect(opt.nodeFusions)))
push_operation!(g, rand(collect(opt.nodeFusions)))
elseif option == 2 && !isempty(opt.nodeReductions)
push_operation!(g, rand(RNG, collect(opt.nodeReductions)))
push_operation!(g, rand(collect(opt.nodeReductions)))
elseif option == 3 && !isempty(opt.nodeSplits)
push_operation!(g, rand(RNG, collect(opt.nodeSplits)))
push_operation!(g, rand(collect(opt.nodeSplits)))
else
i = i - 1
end
@ -89,6 +87,8 @@ function test_random_walk(RNG, g::DAG, n::Int64)
end
end
Random.seed!(0)
test_known_graph("AB->AB", 10000)
test_known_graph("AB->ABBB", 10000)
test_known_graph("AB->ABBBBB", 1000, false)

View File

@ -9,7 +9,7 @@ import MetagraphOptimization.ABCParticle
import MetagraphOptimization.interaction_result
const RTOL = sqrt(eps(Float64))
RNG = Random.MersenneTwister(0)
RNG = Random.default_rng()
function check_particle_reverse_moment(p1::SFourMomentum, p2::SFourMomentum)
@test isapprox(abs(p1.E), abs(p2.E))
@ -123,8 +123,6 @@ expected_result = execute(graph, process_2_4, machine, particles_2_4)
end
end
#=
TODO: fix precision(?) issues
@testset "AB->ABBB after random walk" begin
for i in 1:50
graph = parse_dag(joinpath(@__DIR__, "..", "input", "AB->ABBB.txt"), ABCModel())
@ -134,7 +132,6 @@ TODO: fix precision(?) issues
@test isapprox(execute(graph, process_2_4, machine, particles_2_4), expected_result; rtol = RTOL)
end
end
=#
@testset "AB->AB large sum fusion" begin
for _ in 1:20
@ -234,19 +231,3 @@ end
@test isapprox(execute(graph, process_2_2, machine, particles_2_2), expected_result; rtol = RTOL)
end
end
@testset "$(process) after random walk" for process in ["ke->ke", "ke->kke", "ke->kkke"]
process = parse_process("ke->kkke", QEDModel())
inputs = [gen_process_input(process) for _ in 1:100]
graph = gen_graph(process)
gt = execute.(Ref(graph), Ref(process), Ref(machine), inputs)
for i in 1:50
graph = gen_graph(process)
optimize!(RandomWalkOptimizer(RNG), graph, 100)
@test is_valid(graph)
func = get_compute_function(graph, process, machine)
@test isapprox(func.(inputs), gt; rtol = RTOL)
end
end

View File

@ -1,7 +1,7 @@
using MetagraphOptimization
using Random
RNG = Random.MersenneTwister(0)
RNG = Random.default_rng()
graph = parse_dag(joinpath(@__DIR__, "..", "input", "AB->ABBB.txt"), ABCModel())

View File

@ -15,7 +15,7 @@ import MetagraphOptimization.QED_vertex
def_momentum = SFourMomentum(1.0, 0.0, 0.0, 0.0)
RNG = Random.MersenneTwister(0)
RNG = Random.default_rng()
testparticleTypes = [
PhotonStateful{Incoming, PolX},