Skip to content

feat: coordinate heavy local accelerator jobs - #4281

Merged
atomantic merged 3 commits into
mainfrom
claim/issue-4174
Aug 15, 2026
Merged

feat: coordinate heavy local accelerator jobs#4281
atomantic merged 3 commits into
mainfrom
claim/issue-4174

Conversation

@atomantic

Copy link
Copy Markdown
Owner

Summary

  • add a machine-wide, file-backed claim for heavy local accelerator work with stale-PID recovery and detached-child handoff
  • coordinate LoRA training, local image/video generation, and image-to-3D renders through that claim
  • share the local model memory-reclamation preflight across those workloads

Test plan

  • vitest run server/lib/heavyJobClaim.test.js server/services/loraTraining/memoryPrep.test.js server/services/imageTo3d/models.test.js server/lib/index.test.js --reporter=dot
  • vitest run server/services/videoGen/local.test.js --reporter=dot
  • node --check for changed server modules

Closes #4174

@atomantic

Copy link
Copy Markdown
Owner Author

Required Antigravity review could not complete after three attempts. The agy CLI is installed, but headless runs were denied the command permission and returned no review verdict. The implementation and focused test suites are ready for a reviewer once that permission is configured.

The test mocks fileUtils.js down to PATHS.imageTo3d alone, but models.js
also imports claimHeavyLocalJob from heavyJobClaim.js, which reads
PATHS.data at module load time. With PATHS.data undefined, the real
heavyJobClaim.js threw at import and failed the whole test file in CI.

models.test.js already mocks heavyJobClaim.js the same way; this test
file needed the same mock.
…vy-job claim

runTraining() acquired a fresh machine-wide accelerator claim before
checking reattach:true. On a server restart that re-attaches to a
detached trainer which survived the crash, that trainer's own PID
already holds the claim (handed off pre-restart), so the fresh
claimHeavyLocalJob() call saw it as a competing job and refused —
failing every restart-survived training run outright, even though it
was actively still training.

Add adoptHeavyLocalJob() to recognize and adopt an on-disk claim
already recorded for this exact kind/id/pid instead of contending for
a new one; fall back to a fresh claim only when no matching claim
survived (e.g. a run predating this feature).
@atomantic
atomantic merged commit 4b2ba67 into main Aug 15, 2026
1 check passed
@atomantic
atomantic deleted the claim/issue-4174 branch August 15, 2026 14:34
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.

[repo-study-night-street] Hold a machine-wide claim for heavy local GPU jobs instead of checking headroom once at spawn

1 participant