Skip to main content

runq Python SDK

In-task SDK for the runq GPU scheduler.

Install

From the repo root:

pip install -e ./sdk/python

Optional extras:

pip install -e "./sdk/python[wandb]"   # optional W&B dependency
pip install -e "./sdk/python[dev]"     # for pytest

Quick start

import runq

ctx = runq.context()
lr = ctx.params.get("lr", 1e-3)          # ablation values from the sweep

with runq.log_group("train"):
    runq.report({"loss": loss}, step=step)   # → train/loss in metrics.jsonl
runq.record({"acc": acc}, seed=ctx.seed, split="val")  # axis-keyed result row

Checkpoints go under ctx.checkpoint_dir (<task_dir>/checkpoints, stable across retries, so a resume.extra_args restart can find them). runq does not manage checkpoint lifecycle or early stopping — those belong to your training script.

Three modes

Detected automatically at runq.context():

  • daemon — running under a runq daemon (RUNQ_TASK_ID + RUNQ_SOCKET_PATH set)
  • no_daemon — running on HPC compute node (RUNQ_TASK_ID set, no socket / RUNQ_NO_DAEMON=1)
  • manual — running outside runq (no RUNQ_TASK_ID); useful for local debugging

ctx.mode exposes which mode is active.

Output and W&B directories (RC3)

ctx.output_dir defaults to <task_dir>/outputs; ctx.checkpoint_dir defaults to <task_dir>/checkpoints. ctx.wandb_like_cfg["dir"] uses WANDB_DIR, whose default is the task directory. W&B manages the wandb child itself. Explicit project/job environment overrides are resolved before submission and preserved by the SDK.

import wandb
run = wandb.init(**ctx.wandb_like_cfg)
ctx.link_wandb(run)  # global rank 0; ignores missing offline/disabled URLs

The SDK still works without W&B installed. Retries keep outputs and offline files; online resume="allow" and offline wandb sync have different semantics. See the directory contract for artifact staging/cache/download paths and explicit clean behavior.

Metadata

Release files for runq-sdk 0.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for runq-sdk 0.6.0
File Size Uploaded
runq_sdk-0.6.0.tar.gz 30.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for runq-sdk 0.6.0
File Interpreter ABI Platform
runq_sdk-0.6.0-py3-none-any.whl Python 3 none any Details

Total release size: 53.6 kB

Release files / runq_sdk-0.6.0.tar.gz

Download URL runq_sdk-0.6.0.tar.gz
Size 30.5 kB
Tags Source
SHA-256 checksum
How to use checksums
adf07625df863243b2b38ce9c253911f33d00af3556c8a2927ff8ac8edf4ea78
BLAKE2b-256 checksum
How to use checksums
d357427621a27f2ceec448564be9c11c5a86dab80cb0a0a08720b8ee78027c17
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 16, 2026.

Transparency log

Release files / runq_sdk-0.6.0-py3-none-any.whl

Download URL runq_sdk-0.6.0-py3-none-any.whl
Size 23.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bb47dc55d700ff893cc9fc3ad59619651253f0ac42decd86eec6482c9b088501
BLAKE2b-256 checksum
How to use checksums
b0878118518f51b20c7912dcef3c80351f4db0ed817a549a99f8362a5f34761b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 16, 2026.

Transparency log
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page