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

[CI][Benchmark] add UMF benchmarks for fragmentation measurements #17608

Merged

Conversation

EuphoricThinking
Copy link
Contributor

@EuphoricThinking EuphoricThinking commented Mar 24, 2025

Beside the new class for fragmentation measurements, ComputeUMFBenchmark base class is directly replaced by GBench. Methods and attributes previously included in ComputeUMFBenchmark have been relevant only for Google Benchmark, therefore inheriting from ComputeUMFBenchmark would have been pointless for benchmarks using other frameworks.

Additionally, each benchmark is run separately in order to avoid any impact of benchmarks on each other. Benchmarks using glibc are excluded from fragmentation measurements.

@EuphoricThinking EuphoricThinking requested a review from a team as a code owner March 24, 2025 16:46
@pbalcer
Copy link
Contributor

pbalcer commented Mar 25, 2025

This will need to wait until #17617 is merged. After that happens, please retarget to sycl branch.

@pbalcer
Copy link
Contributor

pbalcer commented Mar 25, 2025

This is missing title tags - [CI][Benchmark].

@EuphoricThinking EuphoricThinking changed the title add UMF benchmarks for fragmentation measurements [CI][Benchmark] add UMF benchmarks for fragmentation measurements Mar 25, 2025
@EuphoricThinking EuphoricThinking force-pushed the umf_fragmentation branch 2 times, most recently from b2bd7b2 to 979038a Compare March 25, 2025 11:39
class GBench(ComputeUMFBenchmark):
def __init__(self, bench):
super().__init__(bench, "umf-benchmark")
self.num_cols_with_memory = 13
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hardcoding column ids is error prone, see example how you can use column names instead:
https://github.com/intel/llvm/blob/sycl/devops/scripts/benchmarks/benches/llamacpp.py#L139-L151

def __init__(self, bench):
super().__init__(bench)

self.is_memory_overhead_checked = True
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be a constructor argument.

@@ -40,96 +41,44 @@ def benchmarks(self) -> list[Benchmark]:
GBenchUmfProxy(self),
GBenchJemalloc(self),
GBenchTbbProxy(self),
GBenchMemoryOverhead(self),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct me if I'm wrong, but memory overhead/fragmentation is simply an additional column in existing benchmark scenarios, right?
If that's the case, I don't think you want to add another benchmark since that will run the same scenario twice, and simply extract a different value.
Instead, you probably should return two results from a single benchmark. With different unit and result value.

statistics = None
is_row_matched_to_statistics_type = False

if not self.is_memory_overhead_checked:
Copy link
Contributor

@pbalcer pbalcer Mar 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please reverse this condition. As a general rule, if possible, avoid negation in conditions. It's easier to read.

if self.is_memory_overhead_checked:

is_row_matched_to_statistics_type = True

if is_row_matched_to_statistics_type:
results.append((config, pool, statistics))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can simplify this by just appending results twice - once with mean and once with fragmentation. And then you will be able to remove the is_memory_overhead_checked variable and GBenchMemoryOverhead class.

@EuphoricThinking EuphoricThinking marked this pull request as draft March 26, 2025 10:28
@EuphoricThinking EuphoricThinking force-pushed the umf_fragmentation branch 2 times, most recently from cab6519 to 3894e26 Compare March 26, 2025 13:41
@EuphoricThinking EuphoricThinking marked this pull request as ready for review March 26, 2025 13:42
Copy link
Contributor

@pbalcer pbalcer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, just a small nit

redesign of the base class for UMF benchmarks
run each benchmark separately
benchmarks using glibc are excluded from
the fragmentation benchmark
@pbalcer
Copy link
Contributor

pbalcer commented Mar 26, 2025

@intel/llvm-gatekeepers please merge.

The CI failure is unrelated, see #17562 (comment).

@martygrant
Copy link
Contributor

martygrant commented Mar 27, 2025

@EuphoricThinking you need to tweak your Github settings as when merged this commit will say authored by 60672997+EuphoricThinking@users.noreply.github.com., you need to change this to your own email

there is a CI job that should have caught this, I'll open an issue for it

#17675

@EuphoricThinking
Copy link
Contributor Author

@EuphoricThinking you need to tweak your Github settings as when merged this commit will say authored by 60672997+EuphoricThinking@users.noreply.github.com., you need to change this to your own email

there is a CI job that should have caught this, I'll open an issue for it

#17675

I think it should be fine now?

@martygrant martygrant merged commit 88caf8d into intel:unify-benchmark-ci Mar 28, 2025
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants