hpcnav-job
The in-job part of HPC Navigator. Runs inside a researcher's job: progress, checkpoints, GPU samples and the guards, written as JSON Lines files on shared storage, so the job needs no network access and keeps working while the laptop sleeps. Standard library only, Python >= 3.9; PyTorch and Hugging Face helpers import only when used.
In a training script
import hpcnav_job
ckpt = hpcnav_job.Checkpointer("/shared/run1/ckpt", reporter=hpcnav_job.default_reporter())
state, _, step = ckpt.load_torch() # newest checkpoint that loads, or (None, None, None)
stop = hpcnav_job.graceful_stop() # on SIGTERM: finish the step, then save and exit 143
hpcnav_job.progress(step, total, unit="steps") # in the loop; at most one event per 30 s
and in the loop: if stop: ckpt.save_torch(state, step); stop.exit(). With the Hugging Face
Trainer: Trainer(..., callbacks=[hpcnav_job.hf.hpcnav_callback()]).
Around any command
hpcnav-run --log "$WORKDIR/logs/run1.log" --done-marker "$WORKDIR/run1/DONE" --expected-hours 6 -- python train.py
hpcnav-run (installed with this package; for an image without pip, copy wrappers/hpcnav-run from the repository to shared storage) forwards SIGTERM, copies
output to the log, exits 0 after logging the real code so a crash can't loop, stops after 3
failed starts in a row, and caps the run at 1.5 x the expected hours. With Python and this
package in the image it also samples the GPU each minute, can stop an idle job
(--idle-minutes 30), and records what ran. Without Python the crash-loop guard and time cap
still work, in bash.
Set HPCNAV_EVENTS_DIR (Apollo: $WORKDIR/.hpcnav/events) so events and guard files are kept;
HPCNAV_SITE, HPCNAV_PROJECT and HPCNAV_WORKLOAD are set by hpcnav submit and
are optional by hand.
Apache-2.0. Source and issues: https://github.com/Sydney-Informatics-Hub/hpc-navigator
Metadata
Release files for hpcnav-job 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| hpcnav_job-0.1.0.tar.gz | 38.8 kB | With provenance | Details for hpcnav_job-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| hpcnav_job-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for hpcnav_job-0.1.0-py3-none-any.whl |
Total release size: 78.2 kB
Security for hpcnav-job 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.