-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[agent] Detect available GPU devices with WLM #33952
base: main
Are you sure you want to change the base?
Conversation
Static quality checks ✅Please find below the results from static quality gates Info
|
Regression DetectorRegression Detector ResultsMetrics dashboard Baseline: c83bdcf Optimization Goals: ✅ No significant changes detected
|
perf | experiment | goal | Δ mean % | Δ mean % CI | trials | links |
---|---|---|---|---|---|---|
➖ | quality_gate_logs | % cpu utilization | +2.03 | [-1.08, +5.14] | 1 | Logs |
➖ | tcp_syslog_to_blackhole | ingress throughput | +1.85 | [+1.79, +1.92] | 1 | Logs |
➖ | uds_dogstatsd_to_api_cpu | % cpu utilization | +0.85 | [-0.04, +1.74] | 1 | Logs |
➖ | quality_gate_idle | memory utilization | +0.82 | [+0.79, +0.85] | 1 | Logs bounds checks dashboard |
➖ | file_to_blackhole_1000ms_latency | egress throughput | +0.37 | [-0.42, +1.17] | 1 | Logs |
➖ | file_to_blackhole_500ms_latency | egress throughput | +0.04 | [-0.74, +0.83] | 1 | Logs |
➖ | file_tree | memory utilization | +0.04 | [-0.03, +0.11] | 1 | Logs |
➖ | file_to_blackhole_0ms_latency | egress throughput | +0.04 | [-0.84, +0.91] | 1 | Logs |
➖ | file_to_blackhole_0ms_latency_http1 | egress throughput | +0.03 | [-0.87, +0.93] | 1 | Logs |
➖ | file_to_blackhole_300ms_latency | egress throughput | +0.02 | [-0.62, +0.65] | 1 | Logs |
➖ | file_to_blackhole_0ms_latency_http2 | egress throughput | +0.01 | [-0.82, +0.84] | 1 | Logs |
➖ | tcp_dd_logs_filter_exclude | ingress throughput | -0.00 | [-0.03, +0.02] | 1 | Logs |
➖ | file_to_blackhole_100ms_latency | egress throughput | -0.02 | [-0.74, +0.71] | 1 | Logs |
➖ | uds_dogstatsd_to_api | ingress throughput | -0.02 | [-0.31, +0.26] | 1 | Logs |
➖ | file_to_blackhole_1000ms_latency_linear_load | egress throughput | -0.16 | [-0.63, +0.31] | 1 | Logs |
➖ | quality_gate_idle_all_features | memory utilization | -0.20 | [-0.28, -0.13] | 1 | Logs bounds checks dashboard |
Bounds Checks: ✅ Passed
perf | experiment | bounds_check_name | replicates_passed | links |
---|---|---|---|---|
✅ | file_to_blackhole_0ms_latency | lost_bytes | 10/10 | |
✅ | file_to_blackhole_0ms_latency | memory_usage | 10/10 | |
✅ | file_to_blackhole_0ms_latency_http1 | lost_bytes | 10/10 | |
✅ | file_to_blackhole_0ms_latency_http1 | memory_usage | 10/10 | |
✅ | file_to_blackhole_0ms_latency_http2 | lost_bytes | 10/10 | |
✅ | file_to_blackhole_0ms_latency_http2 | memory_usage | 10/10 | |
✅ | file_to_blackhole_1000ms_latency | memory_usage | 10/10 | |
✅ | file_to_blackhole_1000ms_latency_linear_load | memory_usage | 10/10 | |
✅ | file_to_blackhole_100ms_latency | lost_bytes | 10/10 | |
✅ | file_to_blackhole_100ms_latency | memory_usage | 10/10 | |
✅ | file_to_blackhole_300ms_latency | lost_bytes | 10/10 | |
✅ | file_to_blackhole_300ms_latency | memory_usage | 10/10 | |
✅ | file_to_blackhole_500ms_latency | lost_bytes | 10/10 | |
✅ | file_to_blackhole_500ms_latency | memory_usage | 10/10 | |
✅ | quality_gate_idle | intake_connections | 10/10 | bounds checks dashboard |
✅ | quality_gate_idle | memory_usage | 10/10 | bounds checks dashboard |
✅ | quality_gate_idle_all_features | intake_connections | 10/10 | bounds checks dashboard |
✅ | quality_gate_idle_all_features | memory_usage | 10/10 | bounds checks dashboard |
✅ | quality_gate_logs | intake_connections | 10/10 | |
✅ | quality_gate_logs | lost_bytes | 10/10 | |
✅ | quality_gate_logs | memory_usage | 10/10 |
Explanation
Confidence level: 90.00%
Effect size tolerance: |Δ mean %| ≥ 5.00%
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
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:
-
Its estimated |Δ mean %| ≥ 5.00%, indicating the change is big enough to merit a closer look.
-
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.
-
Its configuration does not mark it "erratic".
CI Pass/Fail Decision
✅ Passed. All Quality Gates passed.
- quality_gate_idle, bounds check memory_usage: 10/10 replicas passed. Gate passed.
- quality_gate_idle, bounds check intake_connections: 10/10 replicas passed. Gate passed.
- quality_gate_logs, bounds check memory_usage: 10/10 replicas passed. Gate passed.
- quality_gate_logs, bounds check lost_bytes: 10/10 replicas passed. Gate passed.
- quality_gate_logs, bounds check intake_connections: 10/10 replicas passed. Gate passed.
- quality_gate_idle_all_features, bounds check memory_usage: 10/10 replicas passed. Gate passed.
- quality_gate_idle_all_features, bounds check intake_connections: 10/10 replicas passed. Gate passed.
pkg/process/procutil/gpu_detector.go
Outdated
|
||
func (g *GPUDetector) Run() { | ||
// TODO: ensure this is correct | ||
filter := workloadmeta.NewFilterBuilder(). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ensured the filter was configured correct by matching config for events sent by the collector to WLM store: https://github.com/DataDog/datadog-agent/pull/32109/files#diff-739a3320df37987b0114fdf0c00e0776dc531aff6cf2160a5c00685218e943b6R105
pkg/process/procutil/gpu_detector.go
Outdated
} | ||
g.mu.Lock() | ||
// TODO: change into a map storing GPU info | ||
g.DetectedGPU = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of using a mutex, you can simply use an atomic. You also need to guard the reads maybe through a getter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to transition from the boolean to a map (to hold pid : gpu_tags), and check if the map was empty to signify whether a GPU was detected. That way I don't have to get each GPU's information separately later on which is duplicate logic (each event here includes gpu metadata).
For the map, instead of an atomic
, I'll shard the map (synchronize based on map key / using sync.Map etc.) to best guard the read/writes (golang doesn't provide atomic operations for maps).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can just query WMS directly from the process checks. We don't need to store yet another map as this data should be available from WMS.
pkg/process/procutil/gpu_detector.go
Outdated
// This product includes software developed at Datadog (https://www.datadoghq.com/). | ||
// Copyright 2016-present Datadog, Inc. | ||
|
||
package procutil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we may want to put this in a different package or a new pkg.
pkg/process/checks/process.go
Outdated
@@ -285,7 +295,13 @@ func (p *ProcessCheck) run(groupID int32, collectRealTime bool) (RunResult, erro | |||
collectorProcHints := p.generateHints() | |||
p.checkCount++ | |||
|
|||
procsByCtr := fmtProcesses(p.scrubber, p.disallowList, procs, p.lastProcs, pidToCid, cpuTimes[0], p.lastCPUTime, p.lastRun, p.lookupIdProbe, p.ignoreZombieProcesses, p.serviceExtractor) | |||
detectedGPU := false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can just rely on the default value to be false.
var detectedGPU bool
pkg/process/checks/process.go
Outdated
@@ -137,6 +139,10 @@ func (p *ProcessCheck) Init(syscfg *SysProbeConfig, info *HostInfo, oneShot bool | |||
} | |||
p.containerProvider = sharedContainerProvider | |||
|
|||
log.Info("Initializing gpu detector from process check") | |||
p.gpuDetector = procutil.NewGPUDetector(p.wmeta) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for now this is ok, but we'll want to use components and FX to inject this in instead of initializing this directly.
5f527e0
to
9938b37
Compare
What does this PR do?
Motivation
Describe how you validated your changes
Locally, logs show no GPU detected:
![image](https://private-user-images.githubusercontent.com/72533858/412173887-c74d4e3f-831b-4d3b-8026-bd5add03279b.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk0NDk0NjEsIm5iZiI6MTczOTQ0OTE2MSwicGF0aCI6Ii83MjUzMzg1OC80MTIxNzM4ODctYzc0ZDRlM2YtODMxYi00ZDNiLTgwMjYtYmQ1YWRkMDMyNzliLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEzVDEyMTkyMVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTg1ZThmOGZmN2Y3OTk3OGYzMjMyNTA0N2IwZWNmZjYwMTU4NGM0MTJjMDMwZTcyOWE4OGY2MmMwYzIwNDM4N2MmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.SuEjBo23LZx2pU3vwgovnZsUyRmlZfPJcOsoFp8skzA)
On pulumi instance with nvidia driver, logs show GPU was detected:
![image](https://private-user-images.githubusercontent.com/72533858/412174061-10427e1a-fbb7-44d8-860b-170c490a68e9.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk0NDk0NjEsIm5iZiI6MTczOTQ0OTE2MSwicGF0aCI6Ii83MjUzMzg1OC80MTIxNzQwNjEtMTA0MjdlMWEtZmJiNy00NGQ4LTg2MGItMTcwYzQ5MGE2OGU5LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEzVDEyMTkyMVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTk0ZTJjNThmNzNhZWY4M2Q3Njc1NjYwOWQ3OWJhYWJjMjg5MTMwNWRkMDliYmZmNmY1NzQ4MjQ2NThhNGIwNzMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.C-idQNqYq1zN6V3mmDm2PQwgnMUk9ER4ObXob8a_s1A)
Possible Drawbacks / Trade-offs
Additional Notes