Skip to content

Apply the capped memory overhead to a job that requests exactly the cap - #1007

Open
calvinp0 wants to merge 1 commit into
mainfrom
fix_memory_cap_boundary
Open

Apply the capped memory overhead to a job that requests exactly the cap#1007
calvinp0 wants to merge 1 commit into
mainfrom
fix_memory_cap_boundary

Conversation

@calvinp0

Copy link
Copy Markdown
Member

A job requesting exactly the node memory cap was not given the capped-overhead treatment.

- if max_mem is not None and self.job_memory_gb >  max_mem * job_max_server_node_memory_allocation:
+ if max_mem is not None and self.job_memory_gb >= max_mem * job_max_server_node_memory_allocation:

The guard read "strictly greater than the cap", so a request landing precisely on the boundary fell through and was submitted without the overhead adjustment. The log wording moves from exceeds to reaches to match.

Provenance

Split out of #960, which is being closed. That PR's other commit reclassified Gaussian galloc failures as MemoryOverallocation and halved the memory reservation — superseded by main's 5b5b11b9, which classifies the same failure as GaussianMemoryAllocation and steps the %mem fraction down while holding the reservation, and whose message explicitly rebuts halving as "equally wrong, and strictly worse". Its arc/testing/trsh/gaussian/galloc.out fixture is already byte-identical on main.

This commit is independent of that: it touches arc/job/adapter.py and arc/job/adapter_test.py, the superseded one touched arc/job/trsh.py. It cherry-picks onto main cleanly.

Verification

16 passed in arc/job/adapter_test.py, including the boundary case added here. One commit, two files — no file touched by more than one commit.

🤖 Generated with Claude Code

Copilot AI lite review requested due to automatic review settings August 22, 2026 07:48

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@codecov

codecov Bot commented Aug 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 64.61%. Comparing base (45d73a0) to head (faa0a6e).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1007      +/-   ##
==========================================
+ Coverage   64.60%   64.61%   +0.01%     
==========================================
  Files         119      119              
  Lines       39785    39785              
  Branches    10307    10307              
==========================================
+ Hits        25703    25709       +6     
+ Misses      11105    11098       -7     
- Partials     2977     2978       +1     
Flag Coverage Δ
functionaltests 64.61% <ø> (+0.01%) ⬆️
unittests 64.61% <ø> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@calvinp0
calvinp0 force-pushed the fix_memory_cap_boundary branch from 16d8a36 to 4ac5b4e Compare August 23, 2026 08:56
set_cpu_and_mem clamps an over-large request to max_mem *
job_max_server_node_memory_allocation and then, because that value is exactly the
threshold it was just compared against with a strict `>`, falls through to the
uncapped branch on every subsequent call. The clamped job is therefore given
DEFAULT_JOB_MEMORY_OVERHEAD (1.10) instead of CAPPED_JOB_MEMORY_OVERHEAD (1.05),
so the submit script asks the scheduler for 0.95 * 1.10 = 104.5% of the memory
the server is configured to have, and the 'max_total_job_memory' keyword is never
appended - making that keyword unreachable for any job that arrived at the cap
through the troubleshooting loop, which is the only way a job gets there.

trsh_ess_job clamps Gaussian memory to exactly this value, so the boundary is hit
by ordinary troubleshooting rather than by an unusual input.

On the 256 GB server2 fixture the request drops from 273941 MiB (267.5 GiB, more
than the node has) to 261489 MiB (255.4 GiB). Only the Orca branch of
trsh_ess_job reads 'max_total_job_memory'; the Gaussian branch carries it without
acting on it, so newly emitting it changes no troubleshooting decision.
@calvinp0
calvinp0 force-pushed the fix_memory_cap_boundary branch from 4ac5b4e to faa0a6e Compare August 23, 2026 12:14
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.

2 participants