Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use probability sampling over periodic sampling #213

Merged
merged 95 commits into from
May 23, 2024
Merged
Show file tree
Hide file tree
Changes from 93 commits
Commits
Show all changes
95 commits
Select commit Hold shift + click to select a range
6bfca81
kp_sampler_skip: putting in probabilistic sampling
vlkale Oct 13, 2023
fab829a
CMakeLists.txt in kokkos-sampler: fix add_library to kp_add_library
vlkale Oct 13, 2023
eeccd10
sampler's README.md: reflects sampler probability env var
vlkale Oct 13, 2023
d0a24ba
kp_sampler_skip.cpp: tool_prob_num default to -1.0 not 0.1
vlkale Oct 13, 2023
9df6748
Update kp_sampler_skip.cpp: put erase back
vlkale Oct 23, 2023
b629300
Update kp_sampler_skip.cpp: putting in seed
vlkale Oct 23, 2023
df84895
kp_sampler: set default seed to -1, tool fence verbosity
Oct 23, 2023
624a14d
kp_sampler_skip.cpp: applied clang format
vlkale Oct 23, 2023
bd237ac
Sampler: reduce text in prints; revise README
vlkale Oct 24, 2023
27ea88d
fix readme indent
vlkale Oct 24, 2023
ad08a5e
kp_sampler: fix name of seed environment varable and else condition f…
vlkale Oct 26, 2023
5c1a272
Update kp_sampler_skip.cpp: fix msg Kokkos_tools_libs
vlkale Jan 23, 2024
9dbd16b
Merge branch 'kokkos:develop' into use-probability-sampling
vlkale Jan 28, 2024
a6dd9dc
intitialized pointer
vlkale Jan 29, 2024
52e3349
kp_sampler_skip.cpp: revert fix of initialize pointer
vlkale Jan 29, 2024
dae1f2c
Update kp_sampler_skip.cpp: fix func pointer - tools
vlkale Feb 8, 2024
68c1093
kp_sampler_skip.cpp: provide_tpi parameter changed
vlkale Feb 15, 2024
8c56daf
kp_core.hpp: provide_tpi takes struct
vlkale Feb 15, 2024
a2b8577
Update kp_sampler_skip.cpp: fix paren in invoke_ktools_fence
vlkale Feb 15, 2024
43bd1a2
kp_sampler_skip.cpp: applied clang-format-8
vlkale Feb 16, 2024
8021f36
kp_core.hpp: applied clang-format-8
vlkale Feb 16, 2024
e4e2121
Merge branch 'kokkos:develop' into use-probability-sampling
vlkale Feb 29, 2024
5b66f90
Create test_randomized_sampling.cpp
vlkale Feb 29, 2024
d89291e
Create CMakeLists.txt
vlkale Feb 29, 2024
e1f7c22
Update test_randomized_sampling.cpp
vlkale Feb 29, 2024
d020036
test_randomized_sampling.cpp: fix matcher text for 4 samples
vlkale Feb 29, 2024
d2b0a69
Update CMakeLists.txt: add sampler subdirectory
vlkale Mar 7, 2024
cc9118d
Update CMakeLists.txt: fix to be kp_kokkos_sampler
vlkale Mar 7, 2024
fc3cc11
Update test_randomized_sampling.cpp: fix to test with RE2
vlkale Mar 7, 2024
7f519ef
Update test_randomized_sampling.cpp: vector include
vlkale Mar 7, 2024
0df7f5c
Update test_randomized_sampling.cpp: curly fix
vlkale Mar 7, 2024
9ee7600
Update test_randomized_sampling.cpp: RE2 quotation fix
vlkale Mar 7, 2024
4c241a2
CMakeLists.txt: put in test for kernel logger
vlkale Mar 7, 2024
e6e6545
test_randomized_sampling.cpp: sample number to be 100
vlkale Mar 7, 2024
377ffa8
test_randomized_sampling.cpp: fix comment on test
vlkale Mar 7, 2024
74f9196
test_randomized_sampling.cpp: env var default
vlkale Mar 7, 2024
e337319
Update CMakeLists.txt: fix sampler
vlkale Mar 19, 2024
d74eae7
Update CMakeLists.txt: put add'l env variables
vlkale Mar 19, 2024
6049952
test_randomized_sampling.cpp: apply clang format
vlkale Mar 20, 2024
0c9ce3f
CMakeLists.txt: put in sampler verbose
vlkale Mar 20, 2024
64c6a58
test_randomized_sampling: apply clang format
vlkale Mar 20, 2024
486ba9e
test_randomized_sampling.cpp: fixing setting environment variable in …
vlkale Mar 20, 2024
d509a6e
test_randomized_sampling.cpp: apply clang-format
vlkale Mar 20, 2024
2c84bcc
fix test randomized sampling
vlkale Mar 20, 2024
3cb33b4
CMakeLists.txt: fix enviornment var for KOKKOS_TOOLS_LIBS2
vlkale Mar 20, 2024
e4c4f6b
CMakeLists.txt: add global fences environment variable
vlkale Mar 20, 2024
fa33166
CMakeLists.txt: fix nesting of if's in ctest
vlkale Mar 20, 2024
3c1fb93
Update CMakeLists.txt: kaeat_args
vlkale Mar 20, 2024
375ebba
Update CMakeLists.txt: kp_kernel_logger fix
vlkale Mar 20, 2024
c19c018
Update CMakeLists.txt: fix target file 2
vlkale Mar 20, 2024
8317118
add cmake
vlkale Mar 20, 2024
5bb8e7d
Merge branch 'use-probability-sampling' of https://github.com/vlkale/…
vlkale Mar 20, 2024
9517af5
random sampling
vlkale Mar 20, 2024
a03955e
test_randomized_sampling.cpp: fix matcher
vlkale Mar 21, 2024
a4285d3
Update CMakeLists.txt: fix sampler skip variable
vlkale Mar 22, 2024
090245b
Update CMakeLists.txt: env var
vlkale Mar 22, 2024
371ae92
Update kp_sampler_skip.cpp: remove else kernelSampleSkip
vlkale Mar 22, 2024
27e112b
Update kp_sampler_skip.cpp: period in sampler fence printf
vlkale Mar 22, 2024
ceb1e2d
kp_sampler_skip.cpp: removed tool verbose str print
vlkale Mar 22, 2024
44f1eb7
test_randomized_sampling.cpp: take out flushes
vlkale Mar 23, 2024
19cbc2c
Convert kp_kernel_logger to std::cout
masterleinad Mar 25, 2024
c309f0e
Working
masterleinad Mar 26, 2024
8cab46a
Almost working
masterleinad Mar 26, 2024
83d17fb
Still working
masterleinad Mar 26, 2024
e683d6f
Use cout in sampler
masterleinad Mar 26, 2024
c93d11c
Revert changes to kp_kernel_logger.cpp
masterleinad Mar 26, 2024
9d98e9e
kp_sampler_skip.cpp: apply clang format
vlkale Mar 27, 2024
828597d
test_randomized_sampling.cpp: apply clang format
vlkale Mar 27, 2024
7f0cd8a
More indentation
masterleinad Mar 26, 2024
d1b2036
Merge pull request #9 from masterleinad/use-probability-sampling
vlkale Mar 28, 2024
2a376ca
kp_sampler_skip.cpp: fix reduce callee null check
vlkale Apr 2, 2024
b052594
Merge branch 'kokkos:develop' into use-probability-sampling
vlkale Apr 4, 2024
ce93309
kp_kernel_logger.cpp: scan typo fix
vlkale Apr 4, 2024
0d8e79a
Rename test_randomized_sampling.cpp to test_parfor.cpp
vlkale Apr 4, 2024
c16004a
Update CMakeLists.txt: fix sampling
vlkale Apr 4, 2024
3178c8b
Prob smplr (#16)
vlkale Apr 11, 2024
d280cbb
Merge branch 'develop' into use-probability-sampling
vlkale Apr 11, 2024
ca54d35
test_par*.cpp: apply clang format
vlkale Apr 11, 2024
75f9057
test_parreduce.cpp: change test tag; apply clang format
vlkale Apr 11, 2024
43868da
Merge branch 'kokkos:develop' into use-probability-sampling
vlkale May 2, 2024
6f9cd82
Delete matchersProb.hpp
vlkale May 2, 2024
39db70d
kp_sampler_skip.cpp: make function pointer correct
vlkale May 2, 2024
8d28cf6
kp_sampler_skip.cpp: invoke kokkos tools fence
vlkale May 2, 2024
e28dccd
kp_sampler_skip.cpp: Remove small changes not relating to this PR
vlkale May 3, 2024
367ca77
kp_sampler_skip.cpp: apply clang format
vlkale May 3, 2024
af97417
README.md: eliminate unintended changes in text to make diff more rea…
vlkale May 3, 2024
4c48eb0
CMakeLists.txt for test tools: comment in sampler prob environment va…
vlkale May 3, 2024
bb538bb
kp_sampler_skip.cpp: apply clang format
vlkale May 3, 2024
b03c2c4
kp_sampler_skip.cpp: make probability sampling the priority (as before)
vlkale May 3, 2024
d571b94
kp_sampler_skip.cpp: fix conditional as per review request
vlkale May 3, 2024
a426547
kp_sampler_skip.cpp: putting back in conditional as requested
vlkale May 3, 2024
1999883
kp_sampler_skip.cpp: apply clang-format
vlkale May 6, 2024
4cdf85d
kp_sampler_skip.cpp: take out returns from input processing
vlkale May 23, 2024
f4627df
Merge branch 'develop' into use-probability-sampling
crtrott May 23, 2024
679ba48
Fix clang-format
crtrott May 23, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions common/kokkos-sampler/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
This is a sampler utility that is intended to complement other tools in the Kokkos Tools set. This utility allows for sampling (rather than collecting) of profiling or debugging data gathered from a particular tool of the Kokkos Tools set. The Kokkos Tools user provides a sampling rate via the environment variable KOKKOS_TOOLS_SAMPLER_SKIP.
This is a sampler utility that is intended to complement other tools in the Kokkos Tools set. This utility allows for sampling (rather than collecting) of profiling or debugging data gathered from a particular tool of the Kokkos Tools set.

To use this utility, a Kokkos Tools user provides a sampling probability by setting the environment variable `KOKKOS_TOOLS_SAMPLER_PROB` to a positive real number between 0.0 and 100.0. The user can alternatively set a sampling skip rate, i.e., the number of Kokkos kernel invocations to skip before the next sample is taken. The user does so by setting the environment variable `KOKKOS_TOOLS_SAMPLER_SKIP` to a non-negative integer.

If both sampling probability and sampling skip rate are set by the user, this sampling utility only uses the sampling probability for sampling; the utility sets the sampling skip rate to 1, incorporating no pre-defined periodicity in sampling. If neither sampling probability nor the sampling skip rate are set by the user, then randomized sampling is done, with the sampler's probability being 10.0 percent. The sampler is periodic only if the sampling probability is not set by the user and the sampling skip rate is set by the user.

For randomized sampling, the user can ensure reproducibility of this tool's output across multiple runs of a Kokkos application by setting `KOKKOS_TOOLS_RANDOM_SEED` to an integer value before all of the runs. If this environment variable is not set, the seed is based on the C time function.

In order for the state of the sampled profiling and logging data in memory to be captured at the time of the utility's callback invocation, it might be important to enforce fences. However, this also means that there are more synchronization points compared with running the program without the tool.
This fencing behavior can be controlled by setting the environment variable `KOKKOS_TOOLS_GLOBALFENCES`. A non-zero value implies global fences on invocation of the tool. The default is not to introduce extra fences.
This fencing behavior can be controlled by setting the environment variable `KOKKOS_TOOLS_GLOBALFENCES`. A non-zero value implies global fences on invocation of the tool. The default is not to introduce extra fences.

Loading