Skip to content

Instantly share code, notes, and snippets.

@tkf
Last active December 11, 2021 13:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tkf/19d0e682253bb4f944b1c143641451fb to your computer and use it in GitHub Desktop.
Save tkf/19d0e682253bb4f944b1c143641451fb to your computer and use it in GitHub Desktop.
*.ipynb
/backup
/build
/data
/environments
/result
/tmp
/var
using BenchmarkTools
using Gaius
SUITE = BenchmarkGroup()
for n in [500, 800, 1200]
A = randn(n, n)
B = randn(n, n)
C = similar(B)
Gaius.mul!(C, A, B) # warmup
SUITE["n=$n"] = @benchmarkable Gaius.mul!($C, $A, $B)
end
using BenchmarkTools
using Gaius
SUITE = BenchmarkGroup()
for n in [500, 1000, 1500, 2000]
A = randn(n, n)
B = randn(n)
C = similar(B)
Gaius.mul!(C, A, B) # warmup
SUITE["n=$n"] = @benchmarkable Gaius.mul!($C, $A, $B)
end
DATA_COMMIT_MESSAGE ?= $(COMMIT_MESSAGE)
DATA_GIT = git --no-pager -C data
.PHONY: is-data-* commit-data update-data publish-data clean-data
commit-data:
test -e data/.git
$(DATA_GIT) add .
$(DATA_GIT) commit --allow-empty-message --message $(DATA_COMMIT_MESSAGE)
update-data: $(DATA_TARGETS)
$(MAKE) commit
is-data-clean:
@test -z "$$($(DATA_GIT) status --short --untracked-files=no)"
is-data-synchronized: is-data-clean
$(DATA_GIT) pull --ff-only
$(DATA_GIT) push # verify push-ability
publish-data: is-data-synchronized clean-data
$(MAKE) update-data
$(DATA_GIT) push
clean-data:
rm -fv data/*
JULIA ?= julia
JULIA_CMD ?= JULIA_LOAD_PATH=: $(JULIA) --color=yes --startup-file=no
BENCHMARK_SCRIPTS = $(wildcard bench_*.jl)
BENCHMARK_TARGETS = $(patsubst %.jl, $(BUILD)/%/.done, $(BENCHMARK_SCRIPTS))
BENCHMARKS = $(patsubst bench_%.jl, bench-%, $(BENCHMARK_SCRIPTS))
export JULIA_PKG_PRECOMPILE_AUTO = 0
export SUPPRESS_GAIUS_WARNING = true
BUILD = build
.PHONY: default all benchmark bench-* clean backup instantiate refresh update
default: benchmark
refresh: update-patch
benchmark: $(BENCHMARK_TARGETS)
$(BENCHMARKS): bench-%: $(BUILD)/bench_%/.done
$(BENCHMARK_TARGETS): \
$(BUILD)/%/.done: \
var/instantiate-baseline.done \
var/instantiate-target.done \
info
@mkdir -p $(BUILD)/$*
$(JULIA_CMD) --project run_benchmarks.jl $*.jl $(BUILD)/$*
touch $@
info:
@rm -rf build/info
@mkdir -p build/info
git show --format='format:%H' --no-patch > build/info/git-rev-sha1
git show --format='format:%T' --no-patch > build/info/git-tree-sha1
instantiate: var/instantiate-baseline.done var/instantiate-target.done
var/instantiate-baseline.done var/instantiate-target.done: \
var/instantiate-%.done: environments/%/Manifest.toml environments/%/Project.toml
@mkdir -p var
$(JULIA_CMD) --project=environments/%* -e 'using Pkg; Pkg.instantiate()'
touch $@
environments/baseline/Project.toml \
environments/target/Project.toml:
%/Project.toml: Project.toml
mkdir -pv $*
cp --archive $< $@
environments/baseline/Manifest.toml: Manifest.toml
mkdir -p environments/baseline
cp --archive $< $@
environments/target/Manifest.toml: Manifest.toml manifest.patch
mkdir -p environments/target tmp
cp --target-directory=tmp Project.toml Manifest.toml
patch --directory=tmp < manifest.patch
JULIA_LOAD_PATH=@:@stdlib $(JULIA_CMD) --project=tmp \
-e 'using Pkg; Pkg.resolve(); Pkg.instantiate()'
mv tmp/Project.toml environments/target/
mv tmp/Manifest.toml $@
update-patch:
if diff -u Manifest.toml environments/target/Manifest.toml > manifest.patch.tmp; \
then \
exit 1; \
else \
mv manifest.patch.tmp manifest.patch; \
exit 0; \
fi
plot_mat_vec_mul.ipynb plot_mat_mat_mul.ipynb: %.ipynb: %.jl
$(JULIA_CMD) --project=. -e 'using Literate; Literate.notebook(ARGS[1])' $<
result/00_plot_mat_mat_mul.ipynb: plot_mat_mat_mul.ipynb
cp $< $@
result/01_plot_mat_vec_mul.ipynb: plot_mat_vec_mul.ipynb
cp $< $@
clean: clean-result
backup:
mkdir -pv backup
rm -rf tmp/backup
mkdir -pv tmp/backup/build
mv $(BUILD)/*/ tmp/backup/build/
mv environments tmp/backup/
mv tmp/backup backup/backup-$$(date +%Y-%m-%d-%H%M%S)
RESULT_TARGETS = result/00_plot_mat_mat_mul.ipynb result/01_plot_mat_vec_mul.ipynb
include result.mk
data/data.tar.xz:
mkdir -pv data
rm -fv $@
tar caf $@ build/*/ environments
DATA_TARGETS = data/data.tar.xz
include data.mk
all: benchmark
$(MAKE) --always-make $(DATA_TARGETS) $(RESULT_TARGETS)
--- Manifest.toml 2021-11-14 18:27:40.042948978 -0500
+++ environments/target/Manifest.toml 2021-11-14 18:28:46.550412509 -0500
@@ -205,9 +205,9 @@
[[Gaius]]
deps = ["LinearAlgebra", "LoopVectorization", "Random", "StructArrays", "UnsafeArrays", "VectorizationBase"]
-git-tree-sha1 = "5d8c867605ca119455772381c1c3823361cb1dbf"
-repo-rev = "master"
-repo-url = "https://github.com/MasonProtter/Gaius.jl.git"
+git-tree-sha1 = "b85c1a72591a775679f7ef5e4b223ee5c56ffb4d"
+repo-rev = "refactor-block_size"
+repo-url = "https://github.com/tkf/Gaius.jl.git"
uuid = "bffe22d1-cb55-4f4e-ac2c-f4dd4bf58912"
version = "0.6.7"
# This file is machine-generated - editing it directly is not advised
[[Accessors]]
deps = ["Compat", "CompositionsBase", "ConstructionBase", "Future", "LinearAlgebra", "MacroTools", "Requires", "Test"]
git-tree-sha1 = "f3af337c03cc23fdc7ccd4d1352cca279bc447e9"
uuid = "7d9f7c33-5ae7-4f3b-8dc6-eff91059b697"
version = "0.1.5"
[[Adapt]]
deps = ["LinearAlgebra"]
git-tree-sha1 = "84918055d15b3114ede17ac6a7182f68870c16f7"
uuid = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
version = "3.3.1"
[[ArgCheck]]
git-tree-sha1 = "dedbbb2ddb876f899585c4ec4433265e3017215a"
uuid = "dce04be8-c92d-5529-be00-80e4d2c0e197"
version = "2.1.0"
[[ArgTools]]
uuid = "0dad84c5-d112-42e6-8d28-ef12dabb789f"
[[ArrayInterface]]
deps = ["Compat", "IfElse", "LinearAlgebra", "Requires", "SparseArrays", "Static"]
git-tree-sha1 = "e527b258413e0c6d4f66ade574744c94edef81f8"
uuid = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9"
version = "3.1.40"
[[Artifacts]]
uuid = "56f22d72-fd6d-98f1-02f0-08ddc0907c33"
[[AutoHashEquals]]
git-tree-sha1 = "45bb6705d93be619b81451bb2006b7ee5d4e4453"
uuid = "15f4f7f2-30c1-5605-9d31-71845cf9641f"
version = "0.2.0"
[[Base64]]
uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
[[BenchmarkConfigSweeps]]
deps = ["Accessors", "ArgCheck", "AutoHashEquals", "BenchmarkTools", "JSON3", "StructTypes", "Tables"]
git-tree-sha1 = "ee26b6d00c5fcc882e9278a2b467741c835483b4"
repo-rev = "master"
repo-url = "https://github.com/tkf/BenchmarkConfigSweeps.jl.git"
uuid = "5dead3b6-c9e4-435a-a292-80e2716ed6d9"
version = "0.1.0-DEV"
[[BenchmarkTools]]
deps = ["JSON", "Logging", "Printf", "Profile", "Statistics", "UUIDs"]
git-tree-sha1 = "61adeb0823084487000600ef8b1c00cc2474cd47"
uuid = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
version = "1.2.0"
[[BitTwiddlingConvenienceFunctions]]
deps = ["Static"]
git-tree-sha1 = "bc1317f71de8dce26ea67fcdf7eccc0d0693b75b"
uuid = "62783981-4cbd-42fc-bca8-16325de8dc4b"
version = "0.1.1"
[[CPUSummary]]
deps = ["Hwloc", "IfElse", "Static"]
git-tree-sha1 = "87b0c9c6ee0124d6c1f4ce8cb035dcaf9f90b803"
uuid = "2a0fbf3d-bb9c-48f3-b0a9-814d99fd7ab9"
version = "0.1.6"
[[ChainRulesCore]]
deps = ["Compat", "LinearAlgebra", "SparseArrays"]
git-tree-sha1 = "f885e7e7c124f8c92650d61b9477b9ac2ee607dd"
uuid = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
version = "1.11.1"
[[CloseOpenIntervals]]
deps = ["ArrayInterface", "Static"]
git-tree-sha1 = "7b8f09d58294dc8aa13d91a8544b37c8a1dcbc06"
uuid = "fb6a15b2-703c-40df-9091-08a04967cfa9"
version = "0.1.4"
[[CommonSubexpressions]]
deps = ["MacroTools", "Test"]
git-tree-sha1 = "7b8a93dba8af7e3b42fecabf646260105ac373f7"
uuid = "bbf7d656-a473-5ed7-a52c-81e309532950"
version = "0.3.0"
[[Compat]]
deps = ["Base64", "Dates", "DelimitedFiles", "Distributed", "InteractiveUtils", "LibGit2", "Libdl", "LinearAlgebra", "Markdown", "Mmap", "Pkg", "Printf", "REPL", "Random", "SHA", "Serialization", "SharedArrays", "Sockets", "SparseArrays", "Statistics", "Test", "UUIDs", "Unicode"]
git-tree-sha1 = "dce3e3fea680869eaa0b774b2e8343e9ff442313"
uuid = "34da2185-b29b-5c13-b0c7-acf172513d20"
version = "3.40.0"
[[CompilerSupportLibraries_jll]]
deps = ["Artifacts", "Libdl"]
uuid = "e66e0078-7015-5450-92f7-15fbd957f2ae"
[[CompositionsBase]]
git-tree-sha1 = "455419f7e328a1a2493cabc6428d79e951349769"
uuid = "a33af91c-f02d-484b-be07-31d278c5ca2b"
version = "0.1.1"
[[ConstructionBase]]
deps = ["LinearAlgebra"]
git-tree-sha1 = "f74e9d5388b8620b4cee35d4c5a618dd4dc547f4"
uuid = "187b0558-2788-49d3-abe0-74a17ed4e7c9"
version = "1.3.0"
[[Crayons]]
git-tree-sha1 = "3f71217b538d7aaee0b69ab47d9b7724ca8afa0d"
uuid = "a8cc5b0e-0ffa-5ad4-8c14-923d3ee1735f"
version = "4.0.4"
[[DataAPI]]
git-tree-sha1 = "cc70b17275652eb47bc9e5f81635981f13cea5c8"
uuid = "9a962f9c-6df0-11e9-0e5d-c546b8b5ee8a"
version = "1.9.0"
[[DataFrames]]
deps = ["Compat", "DataAPI", "Future", "InvertedIndices", "IteratorInterfaceExtensions", "LinearAlgebra", "Markdown", "Missings", "PooledArrays", "PrettyTables", "Printf", "REPL", "Reexport", "SortingAlgorithms", "Statistics", "TableTraits", "Tables", "Unicode"]
git-tree-sha1 = "d785f42445b63fc86caa08bb9a9351008be9b765"
uuid = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
version = "1.2.2"
[[DataStructures]]
deps = ["Compat", "InteractiveUtils", "OrderedCollections"]
git-tree-sha1 = "7d9d316f04214f7efdbb6398d545446e246eff02"
uuid = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
version = "0.18.10"
[[DataValueInterfaces]]
git-tree-sha1 = "bfc1187b79289637fa0ef6d4436ebdfe6905cbd6"
uuid = "e2d170a0-9d28-54be-80f0-106bbe20a464"
version = "1.0.0"
[[DataValues]]
deps = ["DataValueInterfaces", "Dates"]
git-tree-sha1 = "d88a19299eba280a6d062e135a43f00323ae70bf"
uuid = "e7dc6d0d-1eca-5fa6-8ad6-5aecde8b7ea5"
version = "0.4.13"
[[Dates]]
deps = ["Printf"]
uuid = "ade2ca70-3891-5945-98fb-dc099432e06a"
[[DelimitedFiles]]
deps = ["Mmap"]
uuid = "8bb1440f-4735-579b-a4ab-409b98df4dab"
[[DiffResults]]
deps = ["StaticArrays"]
git-tree-sha1 = "c18e98cba888c6c25d1c3b048e4b3380ca956805"
uuid = "163ba53b-c6d8-5494-b064-1a9d43ac40c5"
version = "1.0.3"
[[DiffRules]]
deps = ["LogExpFunctions", "NaNMath", "Random", "SpecialFunctions"]
git-tree-sha1 = "3287dacf67c3652d3fed09f4c12c187ae4dbb89a"
uuid = "b552c78f-8df3-52c6-915a-8e097449b14b"
version = "1.4.0"
[[Distributed]]
deps = ["Random", "Serialization", "Sockets"]
uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b"
[[DocStringExtensions]]
deps = ["LibGit2"]
git-tree-sha1 = "b19534d1895d702889b219c382a6e18010797f0b"
uuid = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
version = "0.8.6"
[[Downloads]]
deps = ["ArgTools", "LibCURL", "NetworkOptions"]
uuid = "f43a241f-c20a-4ad4-852c-f6b1247861c6"
[[FileIO]]
deps = ["Pkg", "Requires", "UUIDs"]
git-tree-sha1 = "2db648b6712831ecb333eae76dbfd1c156ca13bb"
uuid = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549"
version = "1.11.2"
[[FilePaths]]
deps = ["FilePathsBase", "MacroTools", "Reexport", "Requires"]
git-tree-sha1 = "919d9412dbf53a2e6fe74af62a73ceed0bce0629"
uuid = "8fc22ac5-c921-52a6-82fd-178b2807b824"
version = "0.8.3"
[[FilePathsBase]]
deps = ["Dates", "Mmap", "Printf", "Test", "UUIDs"]
git-tree-sha1 = "d962b5a47b6d191dbcd8ae0db841bc70a05a3f5b"
uuid = "48062228-2e41-5def-b9a4-89aafe57970f"
version = "0.9.13"
[[Formatting]]
deps = ["Printf"]
git-tree-sha1 = "8339d61043228fdd3eb658d86c926cb282ae72a8"
uuid = "59287772-0a20-5a39-b81b-1366585eb4c0"
version = "0.4.2"
[[ForwardDiff]]
deps = ["CommonSubexpressions", "DiffResults", "DiffRules", "LinearAlgebra", "NaNMath", "Preferences", "Printf", "Random", "SpecialFunctions", "StaticArrays"]
git-tree-sha1 = "ef3fec65f9db26fa2cf8f4133c697c5b7ce63c1d"
uuid = "f6369f11-7733-5829-9624-2563aa707210"
version = "0.10.22"
[[Future]]
deps = ["Random"]
uuid = "9fa8497b-333b-5362-9e8d-4d0656e87820"
[[Gaius]]
deps = ["LinearAlgebra", "LoopVectorization", "Random", "StructArrays", "UnsafeArrays", "VectorizationBase"]
git-tree-sha1 = "5d8c867605ca119455772381c1c3823361cb1dbf"
repo-rev = "master"
repo-url = "https://github.com/MasonProtter/Gaius.jl.git"
uuid = "bffe22d1-cb55-4f4e-ac2c-f4dd4bf58912"
version = "0.6.7"
[[HTTP]]
deps = ["Base64", "Dates", "IniFile", "Logging", "MbedTLS", "NetworkOptions", "Sockets", "URIs"]
git-tree-sha1 = "14eece7a3308b4d8be910e265c724a6ba51a9798"
uuid = "cd3eb016-35fb-5094-929b-558a96fad6f3"
version = "0.9.16"
[[HostCPUFeatures]]
deps = ["BitTwiddlingConvenienceFunctions", "IfElse", "Libdl", "Static"]
git-tree-sha1 = "8f0dc80088981ab55702b04bba38097a44a1a3a9"
uuid = "3e5b6fbb-0976-4d2c-9146-d79de83f2fb0"
version = "0.1.5"
[[Hwloc]]
deps = ["Hwloc_jll"]
git-tree-sha1 = "92d99146066c5c6888d5a3abc871e6a214388b91"
uuid = "0e44f5e4-bd66-52a0-8798-143a42290a1d"
version = "2.0.0"
[[Hwloc_jll]]
deps = ["Artifacts", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "3395d4d4aeb3c9d31f5929d32760d8baeee88aaf"
uuid = "e33a78d0-f292-5ffc-b300-72abe9b543c8"
version = "2.5.0+0"
[[IOCapture]]
deps = ["Logging", "Random"]
git-tree-sha1 = "f7be53659ab06ddc986428d3a9dcc95f6fa6705a"
uuid = "b5f81e59-6552-4d32-b1f0-c071b021bf89"
version = "0.2.2"
[[IfElse]]
git-tree-sha1 = "debdd00ffef04665ccbb3e150747a77560e8fad1"
uuid = "615f187c-cbe4-4ef1-ba3b-2fcf58d6d173"
version = "0.1.1"
[[IniFile]]
deps = ["Test"]
git-tree-sha1 = "098e4d2c533924c921f9f9847274f2ad89e018b8"
uuid = "83e8ac13-25f8-5344-8a64-a9f2b223428f"
version = "0.5.0"
[[InteractiveUtils]]
deps = ["Markdown"]
uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
[[InverseFunctions]]
deps = ["Test"]
git-tree-sha1 = "f0c6489b12d28fb4c2103073ec7452f3423bd308"
uuid = "3587e190-3f89-42d0-90ee-14403ec27112"
version = "0.1.1"
[[InvertedIndices]]
git-tree-sha1 = "bee5f1ef5bf65df56bdd2e40447590b272a5471f"
uuid = "41ab1584-1d38-5bbf-9106-f11c6c58b48f"
version = "1.1.0"
[[IrrationalConstants]]
git-tree-sha1 = "7fd44fd4ff43fc60815f8e764c0f352b83c49151"
uuid = "92d709cd-6900-40b7-9082-c6be49f344b6"
version = "0.1.1"
[[IteratorInterfaceExtensions]]
git-tree-sha1 = "a3f24677c21f5bbe9d2a714f95dcd58337fb2856"
uuid = "82899510-4779-5014-852e-03e436cf321d"
version = "1.0.0"
[[JLLWrappers]]
deps = ["Preferences"]
git-tree-sha1 = "642a199af8b68253517b80bd3bfd17eb4e84df6e"
uuid = "692b3bcd-3c85-4b1f-b108-f13ce0eb3210"
version = "1.3.0"
[[JSON]]
deps = ["Dates", "Mmap", "Parsers", "Unicode"]
git-tree-sha1 = "8076680b162ada2a031f707ac7b4953e30667a37"
uuid = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
version = "0.21.2"
[[JSON3]]
deps = ["Dates", "Mmap", "Parsers", "StructTypes", "UUIDs"]
git-tree-sha1 = "7d58534ffb62cd947950b3aa9b993e63307a6125"
uuid = "0f8b85d8-7281-11e9-16c2-39a750bddbf1"
version = "1.9.2"
[[JSONSchema]]
deps = ["HTTP", "JSON", "URIs"]
git-tree-sha1 = "2f49f7f86762a0fbbeef84912265a1ae61c4ef80"
uuid = "7d188eb4-7ad8-530c-ae41-71a32a6d4692"
version = "0.3.4"
[[LayoutPointers]]
deps = ["ArrayInterface", "LinearAlgebra", "ManualMemory", "SIMDTypes", "Static"]
git-tree-sha1 = "83b56449c39342a47f3fcdb3bc782bd6d66e1d97"
uuid = "10f19ff3-798f-405d-979b-55457f8fc047"
version = "0.1.4"
[[LibCURL]]
deps = ["LibCURL_jll", "MozillaCACerts_jll"]
uuid = "b27032c2-a3e7-50c8-80cd-2d36dbcbfd21"
[[LibCURL_jll]]
deps = ["Artifacts", "LibSSH2_jll", "Libdl", "MbedTLS_jll", "Zlib_jll", "nghttp2_jll"]
uuid = "deac9b47-8bc7-5906-a0fe-35ac56dc84c0"
[[LibGit2]]
deps = ["Base64", "NetworkOptions", "Printf", "SHA"]
uuid = "76f85450-5226-5b5a-8eaa-529ad045b433"
[[LibSSH2_jll]]
deps = ["Artifacts", "Libdl", "MbedTLS_jll"]
uuid = "29816b5a-b9ab-546f-933c-edad1886dfa8"
[[Libdl]]
uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
[[LinearAlgebra]]
deps = ["Libdl"]
uuid = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
[[Literate]]
deps = ["Base64", "IOCapture", "JSON", "REPL"]
git-tree-sha1 = "d3493acfb9e6aa0cff46b09773fc2342327b0feb"
uuid = "98b081ad-f1c9-55d3-8b20-4c87d4299306"
version = "2.9.4"
[[LogExpFunctions]]
deps = ["ChainRulesCore", "DocStringExtensions", "InverseFunctions", "IrrationalConstants", "LinearAlgebra"]
git-tree-sha1 = "6193c3815f13ba1b78a51ce391db8be016ae9214"
uuid = "2ab3a3ac-af41-5b50-aa03-7779005ae688"
version = "0.3.4"
[[Logging]]
uuid = "56ddb016-857b-54e1-b83d-db4d58db5568"
[[LoopVectorization]]
deps = ["ArrayInterface", "CPUSummary", "CloseOpenIntervals", "DocStringExtensions", "HostCPUFeatures", "IfElse", "LayoutPointers", "LinearAlgebra", "OffsetArrays", "PolyesterWeave", "Requires", "SIMDDualNumbers", "SLEEFPirates", "Static", "ThreadingUtilities", "UnPack", "VectorizationBase"]
git-tree-sha1 = "d89d3337358863250cc1baf88d3eaa81260322d9"
uuid = "bdcacae8-1622-11e9-2a5c-532679323890"
version = "0.12.94"
[[MacroTools]]
deps = ["Markdown", "Random"]
git-tree-sha1 = "3d3e902b31198a27340d0bf00d6ac452866021cf"
uuid = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09"
version = "0.5.9"
[[ManualMemory]]
git-tree-sha1 = "9cb207b18148b2199db259adfa923b45593fe08e"
uuid = "d125e4d3-2237-4719-b19c-fa641b8a4667"
version = "0.1.6"
[[Markdown]]
deps = ["Base64"]
uuid = "d6f4376e-aef5-505a-96c1-9c027394607a"
[[MbedTLS]]
deps = ["Dates", "MbedTLS_jll", "Random", "Sockets"]
git-tree-sha1 = "1c38e51c3d08ef2278062ebceade0e46cefc96fe"
uuid = "739be429-bea8-5141-9913-cc70e7f3736d"
version = "1.0.3"
[[MbedTLS_jll]]
deps = ["Artifacts", "Libdl"]
uuid = "c8ffd9c3-330d-5841-b78e-0817d7145fa1"
[[Missings]]
deps = ["DataAPI"]
git-tree-sha1 = "bf210ce90b6c9eed32d25dbcae1ebc565df2687f"
uuid = "e1d29d7a-bbdc-5cf2-9ac0-f12de2c33e28"
version = "1.0.2"
[[Mmap]]
uuid = "a63ad114-7e13-5084-954f-fe012c677804"
[[MozillaCACerts_jll]]
uuid = "14a3606d-f60d-562e-9121-12d972cd8159"
[[NaNMath]]
git-tree-sha1 = "bfe47e760d60b82b66b61d2d44128b62e3a369fb"
uuid = "77ba4419-2d1f-58cd-9bb1-8ffee604a2e3"
version = "0.3.5"
[[NetworkOptions]]
uuid = "ca575930-c2e3-43a9-ace4-1e988b2c1908"
[[NodeJS]]
deps = ["Pkg"]
git-tree-sha1 = "905224bbdd4b555c69bb964514cfa387616f0d3a"
uuid = "2bd173c7-0d6d-553b-b6af-13a54713934c"
version = "1.3.0"
[[OffsetArrays]]
deps = ["Adapt"]
git-tree-sha1 = "043017e0bdeff61cfbb7afeb558ab29536bbb5ed"
uuid = "6fe1bfb0-de20-5000-8ca7-80f57d26f881"
version = "1.10.8"
[[OpenLibm_jll]]
deps = ["Artifacts", "Libdl"]
uuid = "05823500-19ac-5b8b-9628-191a04bc5112"
[[OpenSpecFun_jll]]
deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl", "Pkg"]
git-tree-sha1 = "13652491f6856acfd2db29360e1bbcd4565d04f1"
uuid = "efe28fd5-8261-553b-a9e1-b2916fc3738e"
version = "0.5.5+0"
[[OrderedCollections]]
git-tree-sha1 = "85f8e6578bf1f9ee0d11e7bb1b1456435479d47c"
uuid = "bac558e1-5e72-5ebc-8fee-abe8a469f55d"
version = "1.4.1"
[[Parsers]]
deps = ["Dates"]
git-tree-sha1 = "ae4bbcadb2906ccc085cf52ac286dc1377dceccc"
uuid = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0"
version = "2.1.2"
[[Pkg]]
deps = ["Artifacts", "Dates", "Downloads", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "Serialization", "TOML", "Tar", "UUIDs", "p7zip_jll"]
uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
[[PolyesterWeave]]
deps = ["BitTwiddlingConvenienceFunctions", "CPUSummary", "IfElse", "Static", "ThreadingUtilities"]
git-tree-sha1 = "a3ff99bf561183ee20386aec98ab8f4a12dc724a"
uuid = "1d0040c9-8b98-4ee7-8388-3f51789ca0ad"
version = "0.1.2"
[[PooledArrays]]
deps = ["DataAPI", "Future"]
git-tree-sha1 = "a193d6ad9c45ada72c14b731a318bedd3c2f00cf"
uuid = "2dfb63ee-cc39-5dd5-95bd-886bf059d720"
version = "1.3.0"
[[Preferences]]
deps = ["TOML"]
git-tree-sha1 = "00cfd92944ca9c760982747e9a1d0d5d86ab1e5a"
uuid = "21216c6a-2e73-6563-6e65-726566657250"
version = "1.2.2"
[[PrettyTables]]
deps = ["Crayons", "Formatting", "Markdown", "Reexport", "Tables"]
git-tree-sha1 = "d940010be611ee9d67064fe559edbb305f8cc0eb"
uuid = "08abe8d2-0d0c-5749-adfa-8a2ac140af0d"
version = "1.2.3"
[[Printf]]
deps = ["Unicode"]
uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7"
[[Profile]]
deps = ["Printf"]
uuid = "9abbd945-dff8-562f-b5e8-e1ebf5ef1b79"
[[REPL]]
deps = ["InteractiveUtils", "Markdown", "Sockets", "Unicode"]
uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb"
[[Random]]
deps = ["Serialization"]
uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
[[Reexport]]
git-tree-sha1 = "45e428421666073eab6f2da5c9d310d99bb12f9b"
uuid = "189a3867-3050-52da-a836-e630ba90ab69"
version = "1.2.2"
[[Requires]]
deps = ["UUIDs"]
git-tree-sha1 = "4036a3bd08ac7e968e27c203d45f5fff15020621"
uuid = "ae029012-a4dd-5104-9daa-d747884805df"
version = "1.1.3"
[[SHA]]
uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce"
[[SIMDDualNumbers]]
deps = ["ForwardDiff", "IfElse", "SLEEFPirates", "VectorizationBase"]
git-tree-sha1 = "62c2da6eb66de8bb88081d20528647140d4daa0e"
uuid = "3cdde19b-5bb0-4aaf-8931-af3e248e098b"
version = "0.1.0"
[[SIMDTypes]]
git-tree-sha1 = "330289636fb8107c5f32088d2741e9fd7a061a5c"
uuid = "94e857df-77ce-4151-89e5-788b33177be4"
version = "0.1.0"
[[SLEEFPirates]]
deps = ["IfElse", "Static", "VectorizationBase"]
git-tree-sha1 = "1410aad1c6b35862573c01b96cd1f6dbe3979994"
uuid = "476501e8-09a2-5ece-8869-fb82de89a1fa"
version = "0.6.28"
[[Serialization]]
uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b"
[[Setfield]]
deps = ["ConstructionBase", "Future", "MacroTools", "Requires"]
git-tree-sha1 = "fca29e68c5062722b5b4435594c3d1ba557072a3"
uuid = "efcf1570-3423-57d1-acb7-fd33fddbac46"
version = "0.7.1"
[[SharedArrays]]
deps = ["Distributed", "Mmap", "Random", "Serialization"]
uuid = "1a1011a3-84de-559e-8e89-a11a2f7dc383"
[[Sockets]]
uuid = "6462fe0b-24de-5631-8697-dd941f90decc"
[[SortingAlgorithms]]
deps = ["DataStructures"]
git-tree-sha1 = "b3363d7460f7d098ca0912c69b082f75625d7508"
uuid = "a2af1166-a08f-5f64-846c-94a0d3cef48c"
version = "1.0.1"
[[SparseArrays]]
deps = ["LinearAlgebra", "Random"]
uuid = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
[[SpecialFunctions]]
deps = ["ChainRulesCore", "IrrationalConstants", "LogExpFunctions", "OpenLibm_jll", "OpenSpecFun_jll"]
git-tree-sha1 = "f0bccf98e16759818ffc5d97ac3ebf87eb950150"
uuid = "276daf66-3868-5448-9aa4-cd146d93841b"
version = "1.8.1"
[[Static]]
deps = ["IfElse"]
git-tree-sha1 = "e7bc80dc93f50857a5d1e3c8121495852f407e6a"
uuid = "aedffcd0-7271-4cad-89d0-dc628f76c6d3"
version = "0.4.0"
[[StaticArrays]]
deps = ["LinearAlgebra", "Random", "Statistics"]
git-tree-sha1 = "3c76dde64d03699e074ac02eb2e8ba8254d428da"
uuid = "90137ffa-7385-5640-81b9-e52037218182"
version = "1.2.13"
[[Statistics]]
deps = ["LinearAlgebra", "SparseArrays"]
uuid = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
[[StructArrays]]
deps = ["Adapt", "DataAPI", "StaticArrays", "Tables"]
git-tree-sha1 = "2ce41e0d042c60ecd131e9fb7154a3bfadbf50d3"
uuid = "09ab397b-f2b6-538f-b94a-2f83cf4a842a"
version = "0.6.3"
[[StructTypes]]
deps = ["Dates", "UUIDs"]
git-tree-sha1 = "d24a825a95a6d98c385001212dc9020d609f2d4f"
uuid = "856f2bd8-1eba-4b0a-8007-ebc267875bd4"
version = "1.8.1"
[[TOML]]
deps = ["Dates"]
uuid = "fa267f1f-6049-4f14-aa54-33bafae1ed76"
[[TableTraits]]
deps = ["IteratorInterfaceExtensions"]
git-tree-sha1 = "c06b2f539df1c6efa794486abfb6ed2022561a39"
uuid = "3783bdb8-4a98-5b6b-af9a-565f29a5fe9c"
version = "1.0.1"
[[TableTraitsUtils]]
deps = ["DataValues", "IteratorInterfaceExtensions", "Missings", "TableTraits"]
git-tree-sha1 = "78fecfe140d7abb480b53a44f3f85b6aa373c293"
uuid = "382cd787-c1b6-5bf2-a167-d5b971a19bda"
version = "1.0.2"
[[Tables]]
deps = ["DataAPI", "DataValueInterfaces", "IteratorInterfaceExtensions", "LinearAlgebra", "TableTraits", "Test"]
git-tree-sha1 = "fed34d0e71b91734bf0a7e10eb1bb05296ddbcd0"
uuid = "bd369af6-aec1-5ad0-b16a-f7cc5008161c"
version = "1.6.0"
[[Tar]]
deps = ["ArgTools", "SHA"]
uuid = "a4e569a6-e804-4fa4-b0f3-eef7a1d5b13e"
[[Test]]
deps = ["InteractiveUtils", "Logging", "Random", "Serialization"]
uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
[[ThreadingUtilities]]
deps = ["ManualMemory"]
git-tree-sha1 = "03013c6ae7f1824131b2ae2fc1d49793b51e8394"
uuid = "8290d209-cae3-49c0-8002-c8c24d57dab5"
version = "0.4.6"
[[URIParser]]
deps = ["Unicode"]
git-tree-sha1 = "53a9f49546b8d2dd2e688d216421d050c9a31d0d"
uuid = "30578b45-9adc-5946-b283-645ec420af67"
version = "0.4.1"
[[URIs]]
git-tree-sha1 = "97bbe755a53fe859669cd907f2d96aee8d2c1355"
uuid = "5c2747f8-b7ea-4ff2-ba2e-563bfd36b1d4"
version = "1.3.0"
[[UUIDs]]
deps = ["Random", "SHA"]
uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"
[[UnPack]]
git-tree-sha1 = "387c1f73762231e86e0c9c5443ce3b4a0a9a0c2b"
uuid = "3a884ed6-31ef-47d7-9d2a-63182c4928ed"
version = "1.0.2"
[[Unicode]]
uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5"
[[UnsafeArrays]]
git-tree-sha1 = "038cd6ae292c857e6f91be52b81236607627aacd"
uuid = "c4a57d5a-5b31-53a6-b365-19f8c011fbd6"
version = "1.0.3"
[[VectorizationBase]]
deps = ["ArrayInterface", "CPUSummary", "HostCPUFeatures", "Hwloc", "IfElse", "LayoutPointers", "Libdl", "LinearAlgebra", "SIMDTypes", "Static"]
git-tree-sha1 = "5239606cf3552aff43d79ecc75b1af1ce4625109"
uuid = "3d5dd08c-fd9d-11e8-17fa-ed2836048c2f"
version = "0.21.21"
[[Vega]]
deps = ["DataStructures", "DataValues", "Dates", "FileIO", "FilePaths", "IteratorInterfaceExtensions", "JSON", "JSONSchema", "MacroTools", "NodeJS", "Pkg", "REPL", "Random", "Setfield", "TableTraits", "TableTraitsUtils", "URIParser"]
git-tree-sha1 = "43f83d3119a868874d18da6bca0f4b5b6aae53f7"
uuid = "239c3e63-733f-47ad-beb7-a12fde22c578"
version = "2.3.0"
[[VegaLite]]
deps = ["Base64", "DataStructures", "DataValues", "Dates", "FileIO", "FilePaths", "IteratorInterfaceExtensions", "JSON", "MacroTools", "NodeJS", "Pkg", "REPL", "Random", "TableTraits", "TableTraitsUtils", "URIParser", "Vega"]
git-tree-sha1 = "3e23f28af36da21bfb4acef08b144f92ad205660"
uuid = "112f6efa-9a02-5b7d-90c0-432ed331239a"
version = "2.6.0"
[[Zlib_jll]]
deps = ["Libdl"]
uuid = "83775a58-1f1d-513f-b197-d71354ab007a"
[[nghttp2_jll]]
deps = ["Artifacts", "Libdl"]
uuid = "8e850ede-7688-5339-a07c-302acd2aaf8d"
[[p7zip_jll]]
deps = ["Artifacts", "Libdl"]
uuid = "3f19e933-33d8-53b3-aaab-bd5110c3b7a0"
Text(read(joinpath(@__DIR__, "manifest.patch"), String))
#-
Text(read(joinpath(@__DIR__, "build/info/git-rev-sha1"), String))
#-
Text(read(joinpath(@__DIR__, "build/info/git-tree-sha1"), String))
#-
using BenchmarkConfigSweeps
using DataFrames
using DisplayAs
using VegaLite
resultdir = joinpath(@__DIR__, "result")
mkpath(resultdir)
saveresult(; plots...) = saveresult(:png, :svg; plots...)
function saveresult(exts::Symbol...; plots...)
for (k, v) in plots
for e in exts
save(joinpath(resultdir, "mat_mat_mul-$k.$e"), v)
end
end
end;
#-
datadir = joinpath(@__DIR__, "build/bench_mat_mat_mul")
df_raw = DataFrame(BenchmarkConfigSweeps.load(datadir))
begin
df = select(df_raw, Not(:trial))
df = select(df, Not(r"JULIA_.*"))
df[!, :time_ns] = map(t -> minimum(t).time, df_raw.trial)
df[!, :version] = Symbol.(basename.(df_raw.JULIA_PROJECT))
df
end
#-
begin
df_wrt_baseline = unstack(df, :version, :time_ns)
df_wrt_baseline[!, :speedup] = df_wrt_baseline.baseline ./ df_wrt_baseline.target
df_wrt_baseline
end
#-
plt_wrt_baseline = @vlplot(
layer = [
{
mark = {type = :line, point = true},
encoding = {
x = {field = :nthreads},
y = {field = :speedup, title = "Seedup (target vs baseline)"},
color = {field = :n, type = :ordinal, title = "size(A, 1)"},
},
},
{mark = {type = :rule}, encoding = {y = {datum = 1}}},
],
data = df_wrt_baseline,
)
saveresult(; plt_wrt_baseline)
plt_wrt_baseline
plt_wrt_baseline |> DisplayAs.PNG
#-
df_wrt_nthreads1 = let
df1 = select(df, [:n, :version, :nthreads, :time_ns])
df2 = combine(groupby(df1, [:n])) do g
t1 = only(g[(g.nthreads.==1).&(g.version.==:baseline), :]).time_ns
(; g.nthreads, g.version, speedup = t1 ./ g.time_ns)
end
end
plt_wrt_nthreads1 = @vlplot(
facet = {field = :n, type = :ordinal, title = "size(A, 1)"},
columns = 2,
spec = {
layer = [
{
mark = {type = :line, point = true},
x = :nthreads,
y = {:speedup, title = "Seedup (vs baseline nthreads=1)"},
color = :version,
},
{mark = {type = :rule}, encoding = {y = {datum = 1}}},
],
},
data = df_wrt_nthreads1,
)
saveresult(; plt_wrt_nthreads1)
plt_wrt_nthreads1
plt_wrt_nthreads1 |> DisplayAs.PNG
#-
plt_wrt_baseline #src
Text(read(joinpath(@__DIR__, "manifest.patch"), String))
#-
Text(read(joinpath(@__DIR__, "build/info/git-rev-sha1"), String))
#-
Text(read(joinpath(@__DIR__, "build/info/git-tree-sha1"), String))
#-
using BenchmarkConfigSweeps
using DataFrames
using DisplayAs
using VegaLite
resultdir = joinpath(@__DIR__, "result")
mkpath(resultdir)
saveresult(; plots...) = saveresult(:png, :svg; plots...)
function saveresult(exts::Symbol...; plots...)
for (k, v) in plots
for e in exts
save(joinpath(resultdir, "mat_vec_mul-$k.$e"), v)
end
end
end;
#-
datadir = joinpath(@__DIR__, "build/bench_mat_vec_mul")
df_raw = DataFrame(BenchmarkConfigSweeps.load(datadir))
begin
df = select(df_raw, Not(:trial))
df = select(df, Not(r"JULIA_.*"))
df[!, :time_ns] = map(t -> minimum(t).time, df_raw.trial)
df[!, :version] = Symbol.(basename.(df_raw.JULIA_PROJECT))
df
end
#-
begin
df_wrt_baseline = unstack(df, :version, :time_ns)
df_wrt_baseline[!, :speedup] = df_wrt_baseline.baseline ./ df_wrt_baseline.target
df_wrt_baseline
end
#-
plt_wrt_baseline = @vlplot(
layer = [
{
mark = {type = :line, point = true},
encoding = {
x = {field = :nthreads},
y = {field = :speedup, title = "Seedup (target vs baseline)"},
color = {field = :n, type = :ordinal, title = "size(A, 1)"},
},
},
{mark = {type = :rule}, encoding = {y = {datum = 1}}},
],
data = df_wrt_baseline,
)
saveresult(; plt_wrt_baseline)
plt_wrt_baseline
plt_wrt_baseline |> DisplayAs.PNG
#-
df_wrt_nthreads1 = let
df1 = select(df, [:n, :version, :nthreads, :time_ns])
df2 = combine(groupby(df1, [:n])) do g
t1 = only(g[(g.nthreads.==1).&(g.version.==:baseline), :]).time_ns
(; g.nthreads, g.version, speedup = t1 ./ g.time_ns)
end
end
plt_wrt_nthreads1 = @vlplot(
facet = {field = :n, type = :ordinal, title = "size(A, 1)"},
columns = 2,
spec = {
layer = [
{
mark = {type = :line, point = true},
x = :nthreads,
y = {:speedup, title = "Seedup (vs baseline nthreads=1)"},
color = :version,
},
{mark = {type = :rule}, encoding = {y = {datum = 1}}},
],
},
data = df_wrt_nthreads1,
)
saveresult(; plt_wrt_nthreads1)
plt_wrt_nthreads1
plt_wrt_nthreads1 |> DisplayAs.PNG
#-
plt_wrt_baseline #src
[deps]
BenchmarkConfigSweeps = "5dead3b6-c9e4-435a-a292-80e2716ed6d9"
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
Gaius = "bffe22d1-cb55-4f4e-ac2c-f4dd4bf58912"
Literate = "98b081ad-f1c9-55d3-8b20-4c87d4299306"
VegaLite = "112f6efa-9a02-5b7d-90c0-432ed331239a"
# Usage:
#
# Add the following lines to `Makefile`
#
# clean: clean-result
# rm -f other files...
#
# COMMIT_MESSAGE = "Update @$$(hostname)" # optional
# RESULT_TARGETS = list of targets...
# include result.mk
# --- Configuration
COMMIT_MESSAGE ?= ""
# --- Internal variables
RESULT_GIT = git --no-pager -C result
.PHONY: is-result-* result commit update publish clean-result
# Build `$RESULT_TARGETS` directly.
result: $(RESULT_TARGETS)
# Commit the current state of `result/`.
commit: is-result-git
$(RESULT_GIT) add .
$(RESULT_GIT) commit --allow-empty-message --message $(COMMIT_MESSAGE)
# Build `$RESULT_TARGETS` and commit.
update: $(RESULT_TARGETS)
$(MAKE) commit
is-result-git:
@test -e result/.git
is-result-clean: is-result-git
@test -z "$$($(RESULT_GIT) status --short --untracked-files=no)"
is-result-synchronized: is-result-clean
$(RESULT_GIT) pull --ff-only
$(RESULT_GIT) push # verify push-ability
# Re-build `$RESULT_TARGETS`, commit, and push.
publish: clean
$(MAKE) is-result-synchronized
$(MAKE) update
$(RESULT_GIT) push
# Remove non-hidden files in `result/`.
clean-result:
rm -fv result/*
@if [ -e result/.git ]; then \
echo "Rollback result/* files"; \
$(RESULT_GIT) checkout -- .; \
fi
script, resultdir = ARGS
if length(ARGS) >= 3
threads = include_string(@__MODULE__, ARGS[3])
else
# threads = 1:32
threads = [1, 32, 16, 8, 24, 28, 20, 12]
union!(threads, 1:32)
# threads = [1, 8, 16, 24, 32]
end
using BenchmarkConfigSweeps
configs = Iterators.product(
# Inner loop:
BenchmarkConfigSweeps.env.(
"JULIA_PROJECT" .=> joinpath.(@__DIR__, "environments", ["target", "baseline"]),
"JULIA_EXCLUSIVE" => "1", # constant
),
# Outer loop:
BenchmarkConfigSweeps.nthreads.(threads),
)
BenchmarkConfigSweeps.run(resultdir, script, configs)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment