2023-08-29 12:57:46 +02:00
|
|
|
"""
|
|
|
|
MetagraphOptimization
|
|
|
|
|
|
|
|
A module containing tools to work on DAGs.
|
|
|
|
"""
|
2023-06-22 17:24:35 +02:00
|
|
|
module MetagraphOptimization
|
2023-06-29 16:22:58 +02:00
|
|
|
|
2023-12-07 02:54:15 +01:00
|
|
|
using QEDbase
|
2024-07-03 20:24:53 +02:00
|
|
|
using QEDcore
|
|
|
|
using QEDprocesses
|
2023-12-07 02:54:15 +01:00
|
|
|
|
2023-11-17 01:31:31 +01:00
|
|
|
# graph types
|
2023-08-29 12:57:46 +02:00
|
|
|
export DAG
|
|
|
|
export Node
|
|
|
|
export Edge
|
|
|
|
export ComputeTaskNode
|
|
|
|
export DataTaskNode
|
|
|
|
export AbstractTask
|
|
|
|
export AbstractComputeTask
|
|
|
|
export AbstractDataTask
|
|
|
|
export DataTask
|
|
|
|
export FusedComputeTask
|
2023-08-28 13:52:54 +02:00
|
|
|
export PossibleOperations
|
|
|
|
export GraphProperties
|
2023-08-29 12:57:46 +02:00
|
|
|
|
2023-11-17 01:31:31 +01:00
|
|
|
# graph functions
|
2023-08-29 12:57:46 +02:00
|
|
|
export make_node
|
|
|
|
export make_edge
|
|
|
|
export insert_node
|
|
|
|
export insert_edge
|
|
|
|
export is_entry_node
|
|
|
|
export is_exit_node
|
|
|
|
export parents
|
|
|
|
export children
|
|
|
|
export compute
|
2023-11-17 01:31:31 +01:00
|
|
|
export data
|
|
|
|
export compute_effort
|
2023-11-22 13:51:54 +01:00
|
|
|
export task
|
2023-08-28 13:32:22 +02:00
|
|
|
export get_properties
|
2023-08-29 12:57:46 +02:00
|
|
|
export get_exit_node
|
2023-11-22 13:51:54 +01:00
|
|
|
export operation_stack_length
|
2023-10-12 17:51:03 +02:00
|
|
|
export is_valid, is_scheduled
|
2023-08-29 12:57:46 +02:00
|
|
|
|
2023-11-17 01:31:31 +01:00
|
|
|
# graph operation related
|
2023-08-29 12:57:46 +02:00
|
|
|
export Operation
|
|
|
|
export AppliedOperation
|
|
|
|
export NodeFusion
|
|
|
|
export NodeReduction
|
|
|
|
export NodeSplit
|
|
|
|
export push_operation!
|
|
|
|
export pop_operation!
|
|
|
|
export can_pop
|
|
|
|
export reset_graph!
|
|
|
|
export get_operations
|
|
|
|
|
2023-11-17 01:31:31 +01:00
|
|
|
# ABC model
|
|
|
|
export ParticleValue
|
|
|
|
export ParticleA, ParticleB, ParticleC
|
2023-12-07 02:54:15 +01:00
|
|
|
export ABCParticle, ABCProcessDescription, ABCProcessInput, ABCModel
|
|
|
|
export ComputeTaskABC_P
|
|
|
|
export ComputeTaskABC_S1
|
|
|
|
export ComputeTaskABC_S2
|
|
|
|
export ComputeTaskABC_V
|
|
|
|
export ComputeTaskABC_U
|
|
|
|
export ComputeTaskABC_Sum
|
|
|
|
|
|
|
|
# QED model
|
|
|
|
export FeynmanDiagram, FeynmanVertex, FeynmanTie, FeynmanParticle
|
2024-07-03 20:24:53 +02:00
|
|
|
export GenericQEDProcess, QEDModel
|
2023-12-07 02:54:15 +01:00
|
|
|
export ComputeTaskQED_P
|
|
|
|
export ComputeTaskQED_S1
|
|
|
|
export ComputeTaskQED_S2
|
|
|
|
export ComputeTaskQED_V
|
|
|
|
export ComputeTaskQED_U
|
|
|
|
export ComputeTaskQED_Sum
|
|
|
|
export gen_graph
|
2023-06-29 16:22:58 +02:00
|
|
|
|
2023-11-17 01:31:31 +01:00
|
|
|
# code generation related
|
2023-08-31 18:47:05 +02:00
|
|
|
export execute
|
2023-10-12 17:51:03 +02:00
|
|
|
export parse_dag, parse_process
|
|
|
|
export gen_process_input
|
2024-05-08 12:03:27 +02:00
|
|
|
export get_compute_function, get_cuda_kernel
|
2024-01-03 16:38:32 +01:00
|
|
|
export gen_tape, execute_tape
|
2023-10-12 17:51:03 +02:00
|
|
|
|
2023-11-17 01:31:31 +01:00
|
|
|
# estimator
|
|
|
|
export cost_type, graph_cost, operation_effect
|
|
|
|
export GlobalMetricEstimator, CDCost
|
|
|
|
|
2023-11-22 13:51:54 +01:00
|
|
|
# optimization
|
2024-05-08 12:03:27 +02:00
|
|
|
export AbstractOptimizer, GreedyOptimizer, RandomWalkOptimizer
|
|
|
|
export ReductionOptimizer, SplitOptimizer, FusionOptimizer
|
2023-11-22 13:51:54 +01:00
|
|
|
export optimize_step!, optimize!
|
|
|
|
export fixpoint_reached, optimize_to_fixpoint!
|
|
|
|
|
2023-11-17 01:31:31 +01:00
|
|
|
# machine info
|
2023-10-12 17:51:03 +02:00
|
|
|
export Machine
|
|
|
|
export get_machine_info
|
2023-08-31 18:24:48 +02:00
|
|
|
|
2023-08-17 18:46:57 +02:00
|
|
|
export ==, in, show, isempty, delete!, length
|
2023-06-29 16:22:58 +02:00
|
|
|
|
|
|
|
export bytes_to_human_readable
|
|
|
|
|
2023-12-07 02:54:15 +01:00
|
|
|
# TODO: this is probably not good
|
|
|
|
import QEDprocesses.compute
|
|
|
|
|
2023-08-17 18:46:57 +02:00
|
|
|
import Base.length
|
2023-05-26 19:25:21 +02:00
|
|
|
import Base.show
|
|
|
|
import Base.==
|
2023-08-28 13:32:22 +02:00
|
|
|
import Base.+
|
|
|
|
import Base.-
|
2023-05-26 19:25:21 +02:00
|
|
|
import Base.in
|
2023-06-27 20:05:27 +02:00
|
|
|
import Base.copy
|
2023-08-17 14:15:02 +02:00
|
|
|
import Base.isempty
|
|
|
|
import Base.delete!
|
2023-08-21 13:29:55 +02:00
|
|
|
import Base.insert!
|
|
|
|
import Base.collect
|
2023-05-25 17:20:16 +02:00
|
|
|
|
2024-07-03 20:24:53 +02:00
|
|
|
include("QEDprocesses_patch.jl")
|
2023-06-29 16:22:58 +02:00
|
|
|
|
2023-10-12 17:51:03 +02:00
|
|
|
include("devices/interface.jl")
|
2023-08-24 15:11:54 +02:00
|
|
|
include("task/type.jl")
|
|
|
|
include("node/type.jl")
|
|
|
|
include("diff/type.jl")
|
2023-08-28 13:32:22 +02:00
|
|
|
include("properties/type.jl")
|
2023-08-24 15:11:54 +02:00
|
|
|
include("operation/type.jl")
|
|
|
|
include("graph/type.jl")
|
2024-01-03 16:38:32 +01:00
|
|
|
include("scheduler/type.jl")
|
2023-06-29 16:22:58 +02:00
|
|
|
|
2023-08-22 13:21:26 +02:00
|
|
|
include("trie.jl")
|
|
|
|
include("utility.jl")
|
|
|
|
|
2023-08-24 15:11:54 +02:00
|
|
|
include("diff/print.jl")
|
|
|
|
include("diff/properties.jl")
|
2023-08-21 12:54:45 +02:00
|
|
|
|
2023-08-24 15:11:54 +02:00
|
|
|
include("graph/compare.jl")
|
|
|
|
include("graph/interface.jl")
|
|
|
|
include("graph/mute.jl")
|
|
|
|
include("graph/print.jl")
|
|
|
|
include("graph/properties.jl")
|
|
|
|
include("graph/validate.jl")
|
2023-08-21 12:54:45 +02:00
|
|
|
|
2023-08-24 15:11:54 +02:00
|
|
|
include("node/compare.jl")
|
|
|
|
include("node/create.jl")
|
|
|
|
include("node/print.jl")
|
|
|
|
include("node/properties.jl")
|
|
|
|
include("node/validate.jl")
|
2023-08-21 12:54:45 +02:00
|
|
|
|
2023-08-24 15:11:54 +02:00
|
|
|
include("operation/utility.jl")
|
2023-11-22 13:51:54 +01:00
|
|
|
include("operation/iterate.jl")
|
2023-08-24 15:11:54 +02:00
|
|
|
include("operation/apply.jl")
|
|
|
|
include("operation/clean.jl")
|
|
|
|
include("operation/find.jl")
|
|
|
|
include("operation/get.jl")
|
|
|
|
include("operation/print.jl")
|
|
|
|
include("operation/validate.jl")
|
|
|
|
|
2023-08-28 13:32:22 +02:00
|
|
|
include("properties/create.jl")
|
|
|
|
include("properties/utility.jl")
|
|
|
|
|
2023-08-29 12:57:46 +02:00
|
|
|
include("task/create.jl")
|
2023-08-24 15:11:54 +02:00
|
|
|
include("task/compare.jl")
|
2023-10-12 17:51:03 +02:00
|
|
|
include("task/compute.jl")
|
2023-08-24 15:11:54 +02:00
|
|
|
include("task/properties.jl")
|
|
|
|
|
2023-11-17 01:31:31 +01:00
|
|
|
include("estimator/interface.jl")
|
|
|
|
include("estimator/global_metric.jl")
|
|
|
|
|
2023-11-22 13:51:54 +01:00
|
|
|
include("optimization/interface.jl")
|
|
|
|
include("optimization/greedy.jl")
|
|
|
|
include("optimization/random_walk.jl")
|
|
|
|
include("optimization/reduce.jl")
|
2024-05-08 12:03:27 +02:00
|
|
|
include("optimization/fuse.jl")
|
|
|
|
include("optimization/split.jl")
|
2023-11-22 13:51:54 +01:00
|
|
|
|
2023-10-12 17:51:03 +02:00
|
|
|
include("models/interface.jl")
|
|
|
|
include("models/print.jl")
|
|
|
|
|
2024-07-02 10:50:30 +02:00
|
|
|
include("models/physics_models/interface.jl")
|
|
|
|
|
2024-07-03 20:24:53 +02:00
|
|
|
#=
|
2024-07-02 10:50:30 +02:00
|
|
|
include("models/physics_models/abc/types.jl")
|
|
|
|
include("models/physics_models/abc/particle.jl")
|
|
|
|
include("models/physics_models/abc/compute.jl")
|
|
|
|
include("models/physics_models/abc/create.jl")
|
|
|
|
include("models/physics_models/abc/properties.jl")
|
|
|
|
include("models/physics_models/abc/parse.jl")
|
|
|
|
include("models/physics_models/abc/print.jl")
|
2024-07-03 20:24:53 +02:00
|
|
|
=#
|
2024-07-02 10:50:30 +02:00
|
|
|
|
|
|
|
include("models/physics_models/qed/types.jl")
|
|
|
|
include("models/physics_models/qed/particle.jl")
|
|
|
|
include("models/physics_models/qed/diagrams.jl")
|
|
|
|
include("models/physics_models/qed/compute.jl")
|
|
|
|
include("models/physics_models/qed/create.jl")
|
|
|
|
include("models/physics_models/qed/properties.jl")
|
|
|
|
include("models/physics_models/qed/parse.jl")
|
|
|
|
include("models/physics_models/qed/print.jl")
|
2023-12-07 02:54:15 +01:00
|
|
|
|
2023-10-12 17:51:03 +02:00
|
|
|
include("devices/measure.jl")
|
|
|
|
include("devices/detect.jl")
|
|
|
|
include("devices/impl.jl")
|
|
|
|
|
|
|
|
include("devices/numa/impl.jl")
|
|
|
|
include("devices/cuda/impl.jl")
|
2024-05-08 19:26:18 +02:00
|
|
|
include("devices/rocm/impl.jl")
|
2024-07-03 20:24:53 +02:00
|
|
|
#include("devices/oneapi/impl.jl")
|
2023-10-12 17:51:03 +02:00
|
|
|
|
|
|
|
include("scheduler/interface.jl")
|
|
|
|
include("scheduler/greedy.jl")
|
2023-06-29 13:57:45 +02:00
|
|
|
|
2024-01-03 16:38:32 +01:00
|
|
|
include("code_gen/type.jl")
|
|
|
|
include("code_gen/tape_machine.jl")
|
|
|
|
include("code_gen/function.jl")
|
2023-08-31 18:47:05 +02:00
|
|
|
|
2023-06-22 17:24:35 +02:00
|
|
|
end # module MetagraphOptimization
|