This project has been archived by its maintainers, and is no longer receiving any updates.
syvain-training-utils
Deprecated. This is the last release. Our training moved to SexpGPU, which replaced these helpers internally. The package keeps working but gets no further updates.
Internal Syvain helpers for small, explicit ML training runs. No secret sauce here, just shared runtime, device-diagnostic, and checkpoint patterns.
Install
uv add syvain-training-utils
Runtime setup
from syvain_training_utils import (
generate_run_id,
require_torch_compile_toolchain,
select_device,
)
run_id = generate_run_id()
device = select_device()
require_torch_compile_toolchain()
Device smoke test
import json
from syvain_training_utils import run_device_smoke_test
report = run_device_smoke_test(require_cuda=True)
print(json.dumps({"smoke": report}, indent=2, sort_keys=True))
Checkpoint a training run
from syvain_training_utils import (
StorageConfig,
TrainingLoopState,
load_training_checkpoint_if_available,
save_model_checkpoint,
)
storage_config = StorageConfig(
bucket="my-training-bucket",
s3_base_url="https://t3.storage.dev",
region="auto",
access_key_id="...",
secret_access_key="...",
)
checkpoint_base_path = "models/my-model"
loop_state = TrainingLoopState(
global_step=global_step,
curriculum_stage=curriculum_stage,
curriculum_step=curriculum_step,
)
save_model_checkpoint(
storage_config=storage_config,
base_path=checkpoint_base_path,
experiment_slug=experiment_slug,
run_id=run_id,
model=model,
optimizer=optimizer,
scheduler=scheduler,
loop_state=loop_state,
checkpoint_label=f"step-{global_step:012d}",
)
resume = load_training_checkpoint_if_available(
storage_config=storage_config,
base_path=checkpoint_base_path,
model=model,
optimizer=optimizer,
scheduler=scheduler,
device=device,
)
The library owns the object-store clients. Every transient retry opens a fresh client, and expired Tigris multipart sessions restart the complete upload at the same checkpoint key. Checkpoint bodies are written through a temporary local file, uploaded with an adaptive multipart size, and downloaded with resumable range reads. Ensure the machine has temporary disk capacity for one checkpoint.
The manifest remains a pointer to the current checkpoint key within the configured bucket and also records its byte size, ETag, and SHA-256 digest. The manifest is published only after the checkpoint upload succeeds. Loading verifies the complete digest before deserializing the model, optional optimizer, scheduler, and PyTorch RNG state.
Observation-only runs can pass optimizer=None and scheduler=None to both
checkpoint functions. Model parameters and buffers, PyTorch RNG state, run
identity, and loop progress are still saved and restored. A buffer-only module
needs no dummy parameter or optimizer. Save and resume must agree on whether
the optimizer and scheduler exist; incompatible configurations fail before
restoring model state. A scheduler always requires an optimizer. To load only
model state across configurations, use load_model_checkpoint_from_key.
The storage transport uses a 10-second connect timeout, a 60-second read-inactivity timeout, and a 10-minute overall request timeout. A bounded 15-minute outer no-progress retry window owns recovery and client replacement.
Metadata
Release files for syvain-training-utils 0.0.332
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 |
|---|---|---|---|---|
| syvain_training_utils-0.0.332.tar.gz | 11.6 kB | Without provenance | Details for syvain_training_utils-0.0.332.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| syvain_training_utils-0.0.332-py3-none-any.whl | Python 3 | none | any | Details for syvain_training_utils-0.0.332-py3-none-any.whl |
Total release size: 26.2 kB
Release files / syvain_training_utils-0.0.332.tar.gz
| Download URL | syvain_training_utils-0.0.332.tar.gz |
|---|---|
| Size | 11.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c1d08d311c76d09075ce2ef404e277b1930262155b035cda5da540ef32c47aaf
|
|
BLAKE2b-256 checksum How to use checksums |
8b25d0cc14d3fe74fb878be4ccdeb15e1daf16123e1a851744f64252139f9be4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.21 {"installer":{"name":"uv","version":"0.12.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / syvain_training_utils-0.0.332-py3-none-any.whl
| Download URL | syvain_training_utils-0.0.332-py3-none-any.whl |
|---|---|
| Size | 14.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b58d5a71d4b72ce391bdce2e5d243c5d39c4321f846ac05ea567af849e59246d
|
|
BLAKE2b-256 checksum How to use checksums |
ea5afe87c772efde7b68751182af32227c9d57db92ff82d4ef6377aeec636899
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.12.21 {"installer":{"name":"uv","version":"0.12.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for syvain-training-utils 0.0.332
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.
No provenance found
None of the files in this release were 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.