Skip to content

Commit 91ce070

Browse files
committed
chore: minor cleanup
1 parent a35f162 commit 91ce070

6 files changed

Lines changed: 21 additions & 70 deletions

File tree

benchmark/Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ PrettyTables = "3"
88
julia = "1.11"
99

1010
[workspace]
11-
projects = ["nn", "misc", "polybench"]
11+
projects = ["nn", "misc", "polybench", "comrade"]
Lines changed: 12 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -26,33 +26,15 @@ VLBIImagePriors = "b1ba175b-8447-452c-b961-7db2d6f7a029"
2626
VLBILikelihoods = "90db92cd-0007-4c0a-8e51-dbf0782ce592"
2727
VLBISkyModels = "d6343c73-7174-4e0f-bb64-562643efbeca"
2828

29-
[sources.Comrade]
30-
rev = "ptiede-reactant"
31-
url = "https://github.com/ptiede/Comrade.jl"
32-
33-
[sources.ComradeBase]
34-
rev = "main"
35-
url = "https://github.com/ptiede/ComradeBase.jl"
36-
37-
[sources.NFFT]
38-
rev = "ptiede-reactant"
39-
url = "https://github.com/ptiede/NFFT.jl"
40-
41-
[sources.Reactant]
42-
path = "../../"
43-
44-
[sources.TransformVariables]
45-
rev = "ptiede-reactant"
46-
url = "https://github.com/ptiede/TransformVariables.jl"
47-
48-
[sources.VLBIImagePriors]
49-
rev = "ptiede-reactantperf"
50-
url = "https://github.com/ptiede/VLBIImagePriors.jl"
51-
52-
[sources.VLBILikelihoods]
53-
rev = "ptiede-reactant"
54-
url = "https://github.com/ptiede/VLBILikelihoods.jl"
55-
56-
[sources.VLBISkyModels]
57-
rev = "ptiede-reactnfft"
58-
url = "https://github.com/EHTJulia/VLBISkyModels.jl"
29+
[sources]
30+
Comrade = {url = "https://github.com/ptiede/Comrade.jl", rev = "ptiede-reactant"}
31+
ComradeBase = {url = "https://github.com/ptiede/ComradeBase.jl", rev = "main"}
32+
NFFT = {url = "https://github.com/ptiede/NFFT.jl", rev = "ptiede-reactant"}
33+
Reactant = {path = "../.."}
34+
TransformVariables = {url = "https://github.com/ptiede/TransformVariables.jl", rev = "ptiede-reactant"}
35+
VLBIImagePriors = {url = "https://github.com/ptiede/VLBIImagePriors.jl", rev = "ptiede-reactantperf"}
36+
VLBILikelihoods = {url = "https://github.com/ptiede/VLBILikelihoods.jl", rev = "ptiede-reactant"}
37+
VLBISkyModels = {url = "https://github.com/EHTJulia/VLBISkyModels.jl", rev = "ptiede-reactnfft"}
38+
39+
[compat]
40+
julia = "1.11"
Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,7 @@ function gradref(tpostr, xr)
1212
end
1313

1414
function run_comrade_benchmark!(
15-
results::Dict,
16-
benchmark_name::String,
17-
backend::String,
18-
tpostr,
15+
results::Dict, benchmark_name::String, backend::String, tpostr
1916
)
2017
# TODO which Enzyme passes do I want to enable and disable
2118
run_benchmark!(results, benchmark_name, backend, tpostr, "forward", "Default")
@@ -27,11 +24,10 @@ function run_benchmark!(
2724
results::Dict,
2825
benchmark_name::String,
2926
backend::String,
30-
tpost,
27+
tpost,
3128
fwd_or_bwd::String,
32-
tag::String
29+
tag::String,
3330
)
34-
3531
if !haskey(results, "TFLOP/s")
3632
results["TFLOP/s"] = Dict{String,Float64}()
3733
end
@@ -59,10 +55,7 @@ function run_benchmark!(
5955
error("Unknown fwd_or_bwd: $(fwd_or_bwd)")
6056
end
6157

62-
prof_result = Reactant.Profiler.profile_with_xprof(
63-
fn,tpost, x; nrepeat=10, warmup=3
64-
)
65-
58+
prof_result = Reactant.Profiler.profile_with_xprof(fn, tpost, x; nrepeat=10, warmup=3)
6659

6760
results["Runtime (s)"][full_benchmark_name] =
6861
prof_result.profiling_result.runtime_ns / 1e9
@@ -84,5 +77,3 @@ function run_benchmark!(
8477
@info print_stmt
8578
return nothing
8679
end
87-
88-
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,11 @@
11
# Comrade Benchmarks Runner
22
# This script runs all Comrade benchmarks and stores results to a JSON file
3-
4-
using Pkg
5-
6-
@static if VERSION v"1.10-" && VERSION < v"1.11"
7-
Pkg.add([
8-
PackageSpec(; name="ComradeBase", rev="main"),
9-
PackageSpec(; name="Comrade", rev="ptiede-reactant"),
10-
PackageSpec(; name="VLBISkyModels", rev="ptiede-reactnfft"),
11-
PackageSpec(; name="VLBILikelihoods", rev="ptiede-reactant"),
12-
PackageSpec(; name="VLBIImagePriors", rev="ptiede-reactantperf"),
13-
PackageSpec(;
14-
url="https://github.com/ptiede/TransformVariables.jl", rev="ptiede-reactant"
15-
),
16-
PackageSpec(;
17-
url="https://github.com/ptiede/NFFT.jl", rev="ptiede-reactant"
18-
)
19-
])
20-
Pkg.develop(; path=joinpath(@__DIR__, "../../"))
21-
end
22-
23-
243
# Load dependencies
254
using Reactant
265
using Chairmarks: @b
276
using Random: Random
287
using Printf: @sprintf
298

30-
31-
32-
using Reactant
339
using LinearAlgebra
3410
using AbstractFFTs
3511

@@ -52,6 +28,8 @@ include("common.jl")
5228

5329
@info sprint(io -> versioninfo(io; verbose=true))
5430

31+
backend = get_backend()
32+
5533
include("comimager.jl")
5634

5735
function run_all_benchmarks(backend::String)
@@ -63,7 +41,6 @@ function run_all_benchmarks(backend::String)
6341
tpostr = build_post(μas2rad(200.0), 64, dataf)
6442
run_comrade_benchmark!(results, "Comrade EHT Imaging 64 x 64", backend, tpostr)
6543

66-
6744
tpostr = build_post(μas2rad(200.0), 128, dataf)
6845
run_comrade_benchmark!(results, "Comrade EHT Imaging 128 x 128", backend, tpostr)
6946

@@ -73,5 +50,6 @@ function run_all_benchmarks(backend::String)
7350
return results
7451
end
7552

53+
res = run_all_benchmarks(backend)
7654

77-
res = run_all_benchmarks(get_backend())
55+
save_results(results, joinpath(@__DIR__, "results"), "comrade", backend)

0 commit comments

Comments
 (0)