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

[EBPF] Generate complexity data in CI #26723

Merged
merged 20 commits into from
Jul 2, 2024

Conversation

gjulianm
Copy link
Contributor

@gjulianm gjulianm commented Jun 14, 2024

What does this PR do?

Enables the generation of complexity data files in KMT CI. It also fixes some errors in the verifier log parser detected during testing of this PR.

Motivation

A future PR will leverage these files to report complexity changes in PRs.

Additional Notes

Possible Drawbacks / Trade-offs

Describe how to test/QA your changes

@gjulianm gjulianm added this to the 7.56.0 milestone Jun 14, 2024
@gjulianm gjulianm self-assigned this Jun 14, 2024
@gjulianm gjulianm added changelog/no-changelog qa/no-code-change No code change in Agent code requiring validation labels Jun 14, 2024
@gjulianm gjulianm force-pushed the guillermo.julian/generate-complexity-reports branch from 3c0d510 to bf31624 Compare June 14, 2024 10:28
@pr-commenter
Copy link

pr-commenter bot commented Jun 14, 2024

Regression Detector

Regression Detector Results

Run ID: f84fba87-a0f7-4ad3-9303-af459216b0ac Metrics dashboard Target profiles

Baseline: 9551500
Comparison: b14de82

Performance changes are noted in the perf column of each table:

  • ✅ = significantly better comparison variant performance
  • ❌ = significantly worse comparison variant performance
  • ➖ = no significant change in performance

Significant changes in experiment optimization goals

Confidence level: 90.00%
Effect size tolerance: |Δ mean %| ≥ 5.00%

perf experiment goal Δ mean % Δ mean % CI links
pycheck_1000_100byte_tags % cpu utilization +5.02 [+0.27, +9.78] Logs

Fine details of change detection per experiment

perf experiment goal Δ mean % Δ mean % CI links
pycheck_1000_100byte_tags % cpu utilization +5.02 [+0.27, +9.78] Logs
uds_dogstatsd_to_api_cpu % cpu utilization +0.92 [+0.04, +1.80] Logs
otel_to_otel_logs ingress throughput +0.76 [-0.06, +1.57] Logs
tcp_syslog_to_blackhole ingress throughput +0.05 [-12.79, +12.89] Logs
tcp_dd_logs_filter_exclude ingress throughput -0.00 [-0.01, +0.01] Logs
uds_dogstatsd_to_api ingress throughput -0.00 [-0.00, +0.00] Logs
idle memory utilization -0.07 [-0.10, -0.03] Logs
file_tree memory utilization -0.45 [-0.50, -0.40] Logs
basic_py_check % cpu utilization -1.28 [-3.88, +1.31] Logs

Explanation

A regression test is an A/B test of target performance in a repeatable rig, where "performance" is measured as "comparison variant minus baseline variant" for an optimization goal (e.g., ingress throughput). Due to intrinsic variability in measuring that goal, we can only estimate its mean value for each experiment; we report uncertainty in that value as a 90.00% confidence interval denoted "Δ mean % CI".

For each experiment, we decide whether a change in performance is a "regression" -- a change worth investigating further -- if all of the following criteria are true:

  1. Its estimated |Δ mean %| ≥ 5.00%, indicating the change is big enough to merit a closer look.

  2. Its 90.00% confidence interval "Δ mean % CI" does not contain zero, indicating that if our statistical model is accurate, there is at least a 90.00% chance there is a difference in performance between baseline and comparison variants.

  3. Its configuration does not mark it "erratic".

@gjulianm gjulianm force-pushed the guillermo.julian/generate-complexity-reports branch from 72d3521 to 489bc71 Compare June 26, 2024 09:52
@gjulianm gjulianm force-pushed the guillermo.julian/generate-complexity-reports branch from 489bc71 to 3766295 Compare June 26, 2024 09:56
@gjulianm
Copy link
Contributor Author

/trigger-ci --variable RUN_ALL_BUILDS=true --variable RUN_KITCHEN_TESTS=true --variable RUN_E2E_TESTS=on --variable RUN_UNIT_TESTS=on --variable RUN_KMT_TESTS=on

@dd-devflow
Copy link

dd-devflow bot commented Jun 26, 2024

🚂 Gitlab pipeline started

Started pipeline #37571002

@gjulianm gjulianm force-pushed the guillermo.julian/generate-complexity-reports branch from 3766295 to 5880070 Compare June 26, 2024 11:38
@pr-commenter
Copy link

pr-commenter bot commented Jun 26, 2024

Test changes on VM

Use this command from test-infra-definitions to manually test this PR changes on a VM:

inv create-vm --pipeline-id=37957316 --os-family=ubuntu

Note: This applies to commit b14de82

@gjulianm gjulianm force-pushed the guillermo.julian/generate-complexity-reports branch from 9ac5f9c to facc5d5 Compare June 27, 2024 08:34
@gjulianm gjulianm marked this pull request as ready for review June 28, 2024 11:50
@gjulianm gjulianm requested a review from a team as a code owner June 28, 2024 11:50
Copy link
Contributor

@val06 val06 left a comment

Choose a reason for hiding this comment

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

reviewed

.gitlab/kernel_matrix_testing/common.yml Show resolved Hide resolved
// quite large before the garbage collector kicks in and releases memory to the OS.
// This causes out-of-memory errors in CI specially, which an environment with higher memory
// restrictions and multiple programs running in different VMs.
debug.FreeOSMemory()
Copy link
Contributor

Choose a reason for hiding this comment

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

the 1gb is accounted by the VerifierLog field of the Program struct?

in that case, maybe it is better to set explicitly the string to empty string, since the program parent struct is a held by pointer and it might cause the GC to skip freeing that memory (or delay the actual free operation)

Copy link
Member

@brycekahle brycekahle Jun 28, 2024

Choose a reason for hiding this comment

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

You may need to do both: set the string to "" and call debug.FreeOSMemory()

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tested it with both ways and setting the string to "" was not enough to make the GC collect the memory, that's why I added debug.FreeOSMemory(). Just in case I changed the code to set the verifier log to an empty string to ensure it's freed, although I think that prog being scoped to just the loop is enough for the GC to mark that memory as unused.

Copy link
Contributor

@val06 val06 Jul 1, 2024

Choose a reason for hiding this comment

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

golang GC works a bit differently when it comes to pointers and heap memory

@gjulianm
Copy link
Contributor Author

gjulianm commented Jul 2, 2024

/merge

@dd-devflow
Copy link

dd-devflow bot commented Jul 2, 2024

🚂 MergeQueue: pull request added to the queue

The median merge time in main is 26m.

Use /merge -c to cancel this operation!

@dd-mergequeue dd-mergequeue bot merged commit bb693d9 into main Jul 2, 2024
316 of 317 checks passed
@dd-mergequeue dd-mergequeue bot deleted the guillermo.julian/generate-complexity-reports branch July 2, 2024 17:46
brycekahle added a commit that referenced this pull request Jul 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants