Skip to main content

denpex-sdk

Zero-third-party Python helpers for SDC detection (per-layer weight/gradient norms, NaN/Inf checks, optimizer state validation) and asynchronous checkpoint validation (manifest integrity + content checksums) for S3/Lustre.

Cloud diagnosis client

from denpex_sdk import DenpexClient

client = DenpexClient(api_key="dpx_...")
result = client.diagnose(
    open("training.log").read(),
    jobName="llama3-405b-pretrain",
    telemetry={"jobId": "slurm-1842"},
)
print(result["meta"]["failureType"], result["meta"].get("confidence"))
print(result["fix"]["summary"])
print(result["fix"]["action"])
client.feedback(result["diagnosisId"], "worked")

The client reads DENPEX_API_KEY when api_key is omitted and calls the live /api/diagnose contract. Its default 320-second timeout covers the API's 290-second deep-diagnosis window. Optional arguments such as telemetry, codeContext, topologyMap, runtimeHours, and gpuRate pass through.

SDC detection

from denpex_sdk import SdcHook, install_sdc_hooks

hook = install_sdc_hooks(model, SdcHook(max_weight_norm=1e4, max_grad_norm=1e4))
weight_report = hook.inspect()
grad_report = hook.inspect_gradients()
opt_report = hook.inspect_optimizer(optimizer)

Checkpoint validation

from denpex_sdk import build_manifest, manifest_to_json, manifest_from_json, validate_checkpoint

manifest = build_manifest(["/checkpoints/step-1000/"], metadata={"job_id": "..."})
with open("/checkpoints/step-1000/manifest.json", "w") as handle:
    handle.write(manifest_to_json(manifest))

with open("/checkpoints/step-1000/manifest.json") as handle:
    expected = manifest_from_json(handle.read())

result = validate_checkpoint(["/checkpoints/step-1000/"], expected_manifest=expected)
assert result.valid

Metadata

Release files for denpex-sdk 0.2.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 denpex-sdk 0.2.0
File Size Uploaded
denpex_sdk-0.2.0.tar.gz 18.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for denpex-sdk 0.2.0
File Interpreter ABI Platform
denpex_sdk-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 38.8 kB

Release files / denpex_sdk-0.2.0.tar.gz

Download URL denpex_sdk-0.2.0.tar.gz
Size 18.1 kB
Tags Source
SHA-256 checksum
How to use checksums
ed821fa1ff046427b28571d69fb75284ab0cb5f254087104cf4ee0d561ca642c
BLAKE2b-256 checksum
How to use checksums
bd0bcd04b328d5b2d4a18fc2cbd301336eee5bdd6d7621ec6c8c98618fca99cb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.11

Release files / denpex_sdk-0.2.0-py3-none-any.whl

Download URL denpex_sdk-0.2.0-py3-none-any.whl
Size 20.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
40870894c7c6b205c4ad62a75b91f86b1e8a40f7c052639db4fde46fe0459e17
BLAKE2b-256 checksum
How to use checksums
6693c5121c85592491b3a0d69289e66d45384b3570bc2492f429b8217603f53b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.11

Release history Release notifications | RSS feed

0.2.1

2 release files

This release

0.2.0 This release

2 release files

0.1.0

2 release files

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