Skip to content

Commit d440da2

Browse files
committed
Manually rebuild pkgimage
This prevents it from rebuilding other stuff like libjulia-codegen which depends on libjulia-internal and so libjulia-codegen loses it's instrumentation.
1 parent 04d92ad commit d440da2

File tree

11 files changed

+3416
-7
lines changed

11 files changed

+3416
-7
lines changed

cmp_instructions.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
avg_instructions(b) = BenchmarkTools.LinuxPerf.scaledcount(b.linux_perf_stats.threads[1]["instructions"]) / b.params.evals
2+
p_i = Dict(x[1]=>avg_instructions(x[2]) for x in pr_perf["inference"]["allinference"])
3+
m_i = Dict(x[1]=>avg_instructions(x[2]) for x in master_perf["inference"]["allinference"])
4+
5+
Dict(key=>(p_i[key] - m_i[key]) / m_i[key]*100 for key in keys(p_i))
6+
7+
8+
Dict(x[1]=>avg_instructions(x[2]) for x in filter(x->x[2] isa BenchmarkTools.Trial, collect(pr_bit_hash)))

contrib/bolt/.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
profiles-bolt
2-
bolt.build
1+
profiles-bolt*
2+
bolt.build*
33
toolchain
44

55
bolt

contrib/bolt/Makefile

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,8 @@ JULIA_ROOT:=$(CURDIR)/../..
4343
LLVM_BOLT:=$(STAGE0_BINARIES)llvm-bolt
4444
LLVM_MERGEFDATA:=$(STAGE0_BINARIES)merge-fdata
4545

46-
# TODO: work out why libjulia-codegen.so doesn't produce a profile.
4746
# If you add new files to optimize, you need to add BOLT_LDFLAGS to the build of your new file.
48-
SYMLINKS_TO_OPTIMIZE := libLLVM.so libjulia-internal.so
47+
SYMLINKS_TO_OPTIMIZE := libLLVM.so libjulia-internal.so libjulia-codegen.so
4948
FILES_TO_OPTIMIZE := $(shell for file in $(SYMLINKS_TO_OPTIMIZE); do readlink $(STAGE1_BUILD)/usr/lib/$$file; done)
5049

5150
# TODO: Fixup Message
@@ -85,9 +84,8 @@ bolt_instrument: copy_originals
8584
touch $@
8685
@echo $(AFTER_INSTRUMENT_MESSAGE)
8786
88-
# TODO: Seems to be rebuilding sysimage as well unnecessarily
8987
pkgimage: stage1
90-
$(MAKE) -C $(STAGE1_BUILD) stdlibs-cache-release
88+
$(MAKE) -C $(STAGE1_BUILD) -f pkgimage.mk release
9189
9290
merge_data: bolt_instrument
9391
for file in $(FILES_TO_OPTIMIZE); do \

contrib/bolt/script-45395.jl

Lines changed: 380 additions & 0 deletions
Large diffs are not rendered by default.

contrib/pgo-lto/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ LLVM_OBJCOPY:=$(STAGE0_TOOLS)llvm-objcopy
1818
# When building a single libLLVM.so we need to increase -vp-counters-per-site
1919
# significantly
2020
COUNTERS_PER_SITE:=6
21+
# Note: profile counters are not atomic by default, https://discourse.llvm.org/t/profile-guided-optimization-pgo-related-questions-and-suggestions/75232/5
2122

2223
AFTER_STAGE1_MESSAGE:='Run `make clean-profiles` to start with a clean slate. $\
2324
Then run Julia to collect realistic profile data, for example: `$(STAGE1_BUILD)/julia -O3 -e $\

ctl_fd.fifo

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
enable
2+
disable
3+
enable
4+
enable
5+
disable
6+
enable

pr_bit_hash.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

pr_bit_hash2.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

src/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ libjulia-internal-debug libjulia-internal-release: $(PUBLIC_HEADER_TARGETS)
417417

418418
$(build_shlibdir)/libjulia-codegen.$(JL_MAJOR_MINOR_SHLIB_EXT): $(BUILDDIR)/julia.expmap $(CODEGEN_OBJS) $(BUILDDIR)/support/libsupport.a $(build_shlibdir)/libjulia-internal.$(JL_MAJOR_MINOR_SHLIB_EXT)
419419
@$(call PRINT_LINK, $(CXXLD) $(call IMPLIB_FLAGS,$@) $(JCXXFLAGS) $(JL_CXXFLAGS) $(CXXLDFLAGS) $(SHIPFLAGS) $(CODEGEN_OBJS) $(RPATH_LIB) -o $@ \
420-
$(JLDFLAGS) $(JLIBLDFLAGS) $(CG_RELEASE_LIBS) $(call SONAME_FLAGS,libjulia-codegen.$(JL_MAJOR_SHLIB_EXT)))
420+
$(JLDFLAGS) $(BOLT_LDFLAGS) $(JLIBLDFLAGS) $(CG_RELEASE_LIBS) $(call SONAME_FLAGS,libjulia-codegen.$(JL_MAJOR_SHLIB_EXT)))
421421
@$(INSTALL_NAME_CMD)libjulia-codegen.$(SHLIB_EXT) $@
422422
$(DSYMUTIL) $@
423423

test.html

Lines changed: 26 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)