Skip to content

train: give each Slurm slurm job gets its own cache dir to avoid conflict - #638

Merged
RyanPCo merged 1 commit into
mainfrom
ryanco/phase4-compile-cache-per-job
Oct 19, 2026
Merged

RyanPCo merged 1 commit into
mainfrom
ryanco/phase4-compile-cache-per-job

Conversation

@RyanPCo

@RyanPCo RyanPCo commented Sep 13, 2026 •

Copy link
Copy Markdown
Contributor

/torchinductor__<SLURM_JOB_ID>, set at the top of trainHydra's
main() so every job (sbatch, salloc, each submitit array task) keys on its own
job id; a -m launcher imports the module but never runs main(). Inductor
puts the Triton cache inside it. Outside Slurm torch's default is left alone
so local re-runs keep a warm cache. A value from the user's shell wins; one
inherited from a process that set it for another job is replaced.
Replaces the hand-copied sbatch lines on other branches.

Co-Authored-By: Claude Fable 5.1 [email protected]
Claude-Session: https://claude.ai/code/session_01MWtR1x5tjREwoxQZAnUGrh
Co-Authored-By: Claude Opus 5 (1M context) [email protected]
Claude-Session: https://claude.ai/code/session_01BbQNNaMAbTNMypegmJkv4s

🤖 Generated with Claude Code

https://claude.ai/code/session_01MWtR1x5tjREwoxQZAnUGrh
https://claude.ai/code/session_01BbQNNaMAbTNMypegmJkv4s

RyanPCo commented Sep 13, 2026 •

Copy link
Copy Markdown
Contributor Author

@RyanPCo
RyanPCo force-pushed the ryanco/phase4-compile-cache-per-job branch 2 times, most recently from 9b673bb to c6480e0 Compare September 15, 2026 13:31
@RyanPCo
RyanPCo force-pushed the ryanco/phase4-git-provenance branch from 6eda7a6 to 7a242b3 Compare September 15, 2026 13:31
@RyanPCo RyanPCo changed the title train: per-job TORCHINDUCTOR_CACHE_DIR / TRITON_CACHE_DIR set in code train: per-job TORCHINDUCTOR_CACHE_DIR under Slurm, set in main() Sep 15, 2026
@RyanPCo
RyanPCo force-pushed the ryanco/phase4-compile-cache-per-job branch from c6480e0 to ffceb86 Compare September 15, 2026 15:04
@RyanPCo
RyanPCo force-pushed the ryanco/phase4-git-provenance branch from 7a242b3 to fd3fecb Compare September 15, 2026 15:04
@RyanPCo
RyanPCo changed the base branch from ryanco/phase4-git-provenance to graphite-base/638 September 15, 2026 15:13
@RyanPCo RyanPCo changed the title train: per-job TORCHINDUCTOR_CACHE_DIR under Slurm, set in main() train: give each Slurm slurm job gets its own cache dir to avoid conflict Sep 15, 2026
@RyanPCo
RyanPCo marked this pull request as ready for review September 15, 2026 15:16
@RyanPCo
RyanPCo force-pushed the ryanco/phase4-compile-cache-per-job branch from ffceb86 to 85c63c2 Compare September 15, 2026 17:15
@RyanPCo
RyanPCo changed the base branch from graphite-base/638 to ryanco/phase4-git-provenance September 15, 2026 17:15
@RyanPCo

RyanPCo commented Sep 29, 2026

Copy link
Copy Markdown
Contributor Author

@greptileai

@greptile-apps

greptile-apps Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 5/5

[Medium risk] Training job cache isolation for parallel Slurm jobs.

The PR appears safe to merge; no actionable failure was established.

Summary

The PR sets TORCHINDUCTOR_CACHE_DIR when a Slurm training job enters trainHydra.main, using its job ID while preserving an explicit cache setting and the non-Slurm default.

  • Adds a marker to distinguish a directory set by this helper from an explicit override inherited by a later job.
  • Adds unit tests for job IDs, overrides, subprocess inheritance, and call placement.

Reviews (1) · Last reviewed commit: "train: per-job TORCHINDUCTOR_CACHE_DIR u..."

RyanPCo commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor Author

Merge activity

  • Oct 19, 7:23 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Oct 19, 7:29 PM UTC: Graphite rebased this pull request as part of a merge.
  • Oct 19, 7:29 PM UTC: @RyanPCo merged this pull request with Graphite.

@RyanPCo
RyanPCo changed the base branch from ryanco/phase4-git-provenance to graphite-base/638 October 19, 2026 19:26
@RyanPCo
RyanPCo changed the base branch from graphite-base/638 to main October 19, 2026 19:27
<tempdir>/torchinductor_<user>_<SLURM_JOB_ID>, set at the top of trainHydra's
main() so every job (sbatch, salloc, each submitit array task) keys on its own
job id; a `-m` launcher imports the module but never runs main(). Inductor
puts the Triton cache inside it. Outside Slurm torch's default is left alone
so local re-runs keep a warm cache. A value from the user's shell wins; one
inherited from a process that set it for another job is replaced.
Replaces the hand-copied sbatch lines on other branches.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MWtR1x5tjREwoxQZAnUGrh
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01BbQNNaMAbTNMypegmJkv4s
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