Skip to content

Let learned resource estimates replace dynamic sampling in anchorMC - #2439

Open
sawenzel wants to merge 1 commit into
AliceO2Group:masterfrom
sawenzel:anchormc-learned-resources
Open

Let learned resource estimates replace dynamic sampling in anchorMC#2439
sawenzel wants to merge 1 commit into
AliceO2Group:masterfrom
sawenzel:anchormc-learned-resources

Conversation

@sawenzel

Copy link
Copy Markdown
Contributor

anchorMC.sh passes --dynamic-resources unconditionally, so resource estimates learned by a pilot job could only ever be added on top of runtime sampling, never used instead of it. This adds an ALIEN_O2DPG_RESOURCES hook, mirroring the existing ALIEN_O2DPG_FILEGRAPH one.

When the variable names a file, --update-resources <file> is passed and --dynamic-resources is not. Without it the invocation is byte-for-byte what it was.

The file is the json-stat output of MC/utils/o2dpg_sim_metrics.py:

o2dpg_sim_metrics.py json-stat -p pipeline_metric_<pid>.log -o learned.json -w workflow.json
export ALIEN_O2DPG_RESOURCES=${PWD}/learned.json

Tested on the GRID

Nine anchored jobs (2024 pp apass1, run 553185, 2 TF) pinned to ALICE::CERN::CERN-SIRIUS, in three arms of three: legacy runner with dynamic sampling, new runner with dynamic sampling, and new runner with learned estimates plus early file removal. All nine returned ANCHORMC_RC=0.

With the hook set, the runner logs the injection actually taking effect — 74 MEM, 74 CPU and 46 walltime overrides, replacing the workflow's placeholder defaults:

INFO Applying learned resource estimates from: /workdir/learned.json
INFO   MEM  geomprefetch    500.0 MB -> 1203.3 MB
INFO   CPU  geomprefetch    0.000 cores -> 0.892 cores

Walltime could not distinguish the arms: the within-arm spread (617–1887 s in one arm at fixed SPLITID on one CE) is far larger than any difference between arm means (1041 / 1106 / 916 s). That is a statement about GRID variance, not about this change.

🤖 Generated with Claude Code

This adds an ALIEN_O2DPG_RESOURCES hook to anchorMC.sh so a production can run
with the resource estimates a pilot job measured.

- anchorMC.sh passed --dynamic-resources unconditionally, so learned estimates
  could only be added on top of runtime sampling, never instead of it.
- When ALIEN_O2DPG_RESOURCES names a file, --update-resources is passed and
  --dynamic-resources is not; without it the invocation is unchanged.
- The file is the json-stat output of MC/utils/o2dpg_sim_metrics.py.
- ALIEN_O2DPG_FILEGRAPH is added to the usage text, which did not mention it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@sawenzel
sawenzel requested a review from jackal1-66 as a code owner August 22, 2026 16:37
@github-actions

Copy link
Copy Markdown

REQUEST FOR PRODUCTION RELEASES:
To request your PR to be included in production software, please add the corresponding labels called "async-" to your PR. Add the labels directly (if you have the permissions) or add a comment of the form (note that labels are separated by a ",")

+async-label <label1>, <label2>, !<label3> ...

This will add <label1> and <label2> and removes <label3>.

The following labels are available
async-2023-pbpb-apass4
async-2023-pp-apass4
async-2024-pp-apass1
async-2022-pp-apass7
async-2024-pp-cpass0
async-2024-PbPb-apass1
async-2024-ppRef-apass1
async-2024-PbPb-apass2
async-2023-PbPb-apass5

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.

1 participant