Repository navigation
fix(mesh): sample power_of_two load per instance and drop failures - #3566
MengqingCao wants to merge 3 commits into
Conversation
b15bc6f to
f3f52de
Compare
88cf528 to
a60a68a
Compare
f3f52de to
662f705
Compare
valar-cop
left a comment
There was a problem hiding this comment.
some changes needed..
any real ATOM /metrics body showing atom:dp_inflight_requests non-zero, single-engine or DP?
ci green.
a60a68a to
b71b05c
Compare
662f705 to
1b09176
Compare
|
No captured body yet. From the code, |
b71b05c to
16f000a
Compare
1b09176 to
31e6d11
Compare
valar-cop
left a comment
There was a problem hiding this comment.
LGTM
ci run_atomesh_test_harness (Atomesh Mocker Benchmark) failed — not sure yet (low): The captured log is 0 bytes, so the failing step cannot be identified. The same job passes on main 8/8 recent runs and 5/6 on other runs, so it is either flaky, a runner/infra fault, or a step inside this job (cargo test --lib --features atom-engine, token-parity download, ext-proc proto check, mocker harness) failing for a reason the PR diff alone does not reveal.
log .valar/ci/job_137594251164.log is 0 bytes (0 lines)
same job on main: 8x success through 2026-11-23T06:27; on other recent runs: {'failure': 1, 'skipped': 3, 'success': 2}
next: Re-run the job and, if it fails again, attach the failing step's log; the new worker_manager::tests (parse_dp_inflight, parse_queued_requests, cacheable_loads, the two-listener async test) are the only PR content in that lib build, so confirm which step is red. https://github.com/ROCm/ATOM/actions/runs/45145603432/job/137594251164
ci ATOMesh non-GPU unit tests (Atomesh Mocker Benchmark) failed — not sure yet (high): This is a derived gate, not an independent failure: on origin/main the unit-test-gate job is named 'ATOMesh non-GPU unit tests' and declares needs: [unit-test-scope, run_atomesh_test_harness], evaluating that job's result. It fails because run_atomesh_test_harness failed. The job name is absent from the PR head's workflow file, which confirms CI merged a newer base/main than the PR's merge base.
origin/main workflow:
unit-test-gate: name: ATOMesh non-GPU unit tests...needs: [unit-test-scope, run_atomesh_test_harness]
head .github/workflows/atomesh-mocker-benchmark.yaml exposes only run_atomesh_test_harness and run_atomesh_mocker_benchmark
next: Follow the run_atomesh_test_harness entry; no separate action for this gate. https://github.com/ROCm/ATOM/actions/runs/45145603432/job/137601470512
16f000a to
9e25615
Compare
31e6d11 to
22b54ea
Compare
valar-cop
left a comment
There was a problem hiding this comment.
some changes needed..
ci run_atomesh_test_harness (Atomesh Mocker Benchmark) failed — looks like the pr itself (medium): Log is 0 bytes, but this job builds the atomesh-mocker crate, whose app_helpers.rs still calls the 4-arg LoadMonitor::new after the PR added a backend parameter; the crate cannot compile. Same job passes on main 8/8 and the one recent other-PR run succeeded.
atom/mesh/mocker/app_helpers.rs:83: let load_monitor = Some(Arc::new(LoadMonitor::new(
atom/mesh/mocker/app_helpers.rs:87: config.worker_startup_check_interval_secs,
atom/mesh/src/core/worker_manager.rs:358-364: pub fn new(..., client: reqwest::Client, backend: BackendType, interval_secs: u64) -> Self
next: Update the mocker call site to pass the backend (e.g. config.backend), then re-run; if it still fails, attach the failing step's log. https://github.com/ROCm/ATOM/actions/runs/45185830360/job/137731320910
ci ATOMesh non-GPU unit tests (Atomesh Mocker Benchmark) failed — looks like the pr itself (high): Derived gate: unit-test-gate needs [unit-test-scope, run_atomesh_test_harness] and fails because run_atomesh_test_harness failed. It is not an independent failure.
.github/workflows/atomesh-mocker-benchmark.yaml:239-260: unit-test-gate ... required-results: run_atomesh_test_harness=${{ needs.run_atomesh_test_harness.result }}
next: Follow the run_atomesh_test_harness entry; no separate action for this gate. https://github.com/ROCm/ATOM/actions/runs/45185830360/job/137741316262
9e25615 to
13f963a
Compare
9d09b38 to
380d2d3
Compare
13f963a to
0c36669
Compare
|
ci triage for 0c36669:
|
0c36669 to
db79296
Compare
0f13c0d to
69b2768
Compare
A DP worker URL cannot be queried as its own endpoint, and a cached -1 makes power_of_two always pick the first of two workers. One fetch per instance, ATOM metrics by rank, and failed samples stay out of the cache. Co-authored-by: Cursor <cursoragent@cursor.com>
…ty loads - A worker without a DP rank reads atom:requests_running + requests_waiting: the engine charges dp_inflight only when it routes among its own DP ranks, so on a single-engine replica it stays 0. - A tick where every fetch fails publishes the empty map, so power_of_two drops the stale loads and falls back to its local request count. - LoadMonitor::new takes the backend instead of an opt-in with_backend. - Test: one instance's two DP ranks, a single engine and an unreachable worker through get_all_worker_loads. Co-authored-by: Cursor <cursoragent@cursor.com>
LoadMonitor::new takes the backend since the previous commit; the mocker, its own cargo root, still called the four-argument form and failed to build. Co-authored-by: Cursor <cursoragent@cursor.com> (cherry picked from commit 446622170f0da99f357a3486424f58a744d54af7)
db79296 to
796f8f5
Compare
valarLip
left a comment
There was a problem hiding this comment.
⚠️ Action required before merge (5)
The structure is right: one fetch per instance, failed samples stay out of the cache, the empty map is published, and the interval comes from the policy. All valar-cop asks are addressed. The load signal itself is still wrong for one engine mode:
- Read ATOM's per-rank scheduler gauge, not
dp_inflight.atom:dp_inflight_requestsis CoreManager's own load-balancing bookkeeping, and it is charged only whentrack_loadis set (engine_core_mgr.py:1342-1355). With--dp-load-balance round_robin, every rank exports 0. Mesh caches the 0s, so power_of_two compares 0 vs 0 forever and never falls back to its local counts. This also leaves valar-cop's "real /metrics body with dp_inflight non-zero?" unanswered. ATOM already exportsatom:scheduler_requests{dp_rank,engine_role,state}per rank (exporter.py:491-517). Read running + waiting perdp_rank, and the sum over ranks for a worker without a rank. That one gauge replaces bothparse_dp_inflightandparse_queued_requests. Also fix the comment at worker_manager.rs:228-236: explicit rank hints are charged too. Add a test wheredp_inflightis 0 and the scheduler gauge is not. - Reuse the crate's Prometheus parser.
openmetrics-parseris already a dependency (Cargo.toml:87, used in observability/metrics/engine_metrics.rs:128-140). The hand-rolledsamples/label_value(worker_manager.rs:288-334) duplicates it.label_valuealso matchesrank="insidedp_rank=", which turns into a real bug once item 1 readsdp_rank. - Fix the
load_sample_interval_secsdocstring and test it. config/types.rs:574-577 says the monitor does not fetch without the policy. A model-scoped power_of_two from a worker's policy hint (registry.rs:280-287) still makes it fetch, at the startup interval. Nothing tests the function; returning the startup interval unconditionally passes. Cover regularpower_of_two(5)-> 5, PD 30/10 -> 10, and none -> startup. The mocker (app_helpers.rs:88) and the test contexts should passconfig.load_sample_interval_secs()too, as production does. - Nit:
policies/power_of_two.rs:71-87says "high-fidelity token loads" / "Compare Tokens". An ATOM sample is now a request count, so say "sampled loads". - Nit: fix the squash text. The body says ATOM reads only
dp_inflightand the test plan says "2 passed" (there are 4 tests). Mention the empty-map publish, and drop the "(cherry picked from ...)" line.
CI: no workflow ran on 796f8f5. The same three patches were green on the Atomesh lanes at 0c36669 and db79296. Re-run CI on the head.
Root cause vs patch: right direction, with a patch-like signal choice. Mesh needs one per-rank load signal that does not depend on how the engine balances internally. The PR mixes the engine's LB bookkeeping with the instance totals. The per-rank scheduler gauge is the cheap, mesh-only root fix.
Reviewed at 796f8f5 (round 1, Standard, 2 independent passes).
Motivation
The load monitor that feeds
power_of_twohad three problems:url@rankis not a request target, so those samples failed.-1, and comparing against-1madepower_of_twoalways pick the first of its two random workers.load_check_interval_secs.Summary
url@rankaddress is not a request target. ATOM readsatom:dp_inflight_requests{rank}from/metrics; other backends still use/get_load, and only for workers that are not DP ranks.power_of_twocache, so a cached-1can no longer make the policy pick the first of two random workers.GET /get_loadsstill reports-1.power_of_two.load_check_interval_secsinstead of the worker startup interval.Split out of #3509. This does not add
least_load.Test plan
cargo check --offline --locked --libon this branchcargo test --offline --locked --lib -- worker_manager::tests(2 passed)Made with Cursor