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.1

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.1
File Size Uploaded
denpex_sdk-0.2.1.tar.gz 31.7 kB Details

Built distribution (wheel)

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

Total release size: 54.0 kB

Release files / denpex_sdk-0.2.1.tar.gz

Download URL denpex_sdk-0.2.1.tar.gz
Size 31.7 kB
Tags Source
SHA-256 checksum
How to use checksums
7eb57ce9345b3d716b3919778f41bd71b0c431a4fc78777a67680356013ddb3f
BLAKE2b-256 checksum
How to use checksums
d01ef36ba09d4f669e0ef1db8670e28766d652e75ae2497758d7f9a57d2920a7
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.1-py3-none-any.whl

Download URL denpex_sdk-0.2.1-py3-none-any.whl
Size 22.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d25aecf0df3494cfb49117849dc8a37fd95f2ea154f8999b491840ae5b45e7d6
BLAKE2b-256 checksum
How to use checksums
8904f68762c3b6fb1eee014a11928a2587b2aa9a2664dc8c49a59a1fb63b9c78
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

This release

0.2.1 This release

2 release files

0.2.0

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