diff --git a/.agents/skills b/.agents/skills new file mode 120000 index 00000000000..42c5394a18a --- /dev/null +++ b/.agents/skills @@ -0,0 +1 @@ +../skills \ No newline at end of file diff --git a/.claude/skills b/.claude/skills index 2b7a412b8fa..42c5394a18a 120000 --- a/.claude/skills +++ b/.claude/skills @@ -1 +1 @@ -../.agents/skills \ No newline at end of file +../skills \ No newline at end of file diff --git a/skills/dali-dynamic-mode/BENCHMARK.md b/skills/dali-dynamic-mode/BENCHMARK.md new file mode 100644 index 00000000000..e7b4dab6f97 --- /dev/null +++ b/skills/dali-dynamic-mode/BENCHMARK.md @@ -0,0 +1,64 @@ +# Evaluation Report + +Evaluation of the `dali-dynamic-mode` skill before publication through NVSkills-Eval. + +This benchmark summarizes 3-Tier Evaluation from NVSkills-Eval results for the skill. The goal is to document whether the skill is safe, discoverable, effective, and useful for agents before it is published for broader workflow use. + +## Evaluation Summary + +- Skill: `dali-dynamic-mode` +- Evaluation date: 2026-05-28 +- NVSkills-Eval profile: `external` +- Overall verdict: PASS +- Tier 3 live agent evaluation: not available in this report + +## Agents Used + +- Tier 3 agent details were not available in this report. + +## Metrics Used + +Reported benchmark dimensions: + +- Security: checks whether skill-assisted execution avoids unsafe behavior such as secret leakage, destructive commands, or unauthorized access. +- Correctness: checks whether the agent follows the expected workflow and produces the correct final output. +- Discoverability: checks whether the agent loads the skill when relevant and avoids using it when irrelevant. +- Effectiveness: checks whether the agent performs measurably better with the skill than without it. +- Efficiency: checks whether the agent uses fewer tokens and avoids redundant work. + +Underlying evaluation signals used in this run: + +- No Tier 3 evaluation signal details were available in this report. + +## Test Tasks + +Tier 3 evaluation task details were not available in this report. + +## Results + +Tier 3 dimension rollup was not available in this report. + +## Tier 1: Static Validation Summary + +Tier 1 validation passed. NVSkills-Eval ran 9 checks and found 0 total findings. + +Notable observations: + +- SECURITY: No security vulnerabilities detected (secrets, API keys, credentials) +- SCHEMA: Found skill manifest: SKILL.md +- VERSION: No semantic version label present; resource will use commit-hash history (opting back out of an existing label is allowed) +- PII: Scanning 1 files for PII +- LICENSE: no findings reported. + +## Tier 2: Deduplication Summary + +Tier 2 validation passed. NVSkills-Eval ran 2 checks and found 0 total findings. + +Notable observations: + +- Context Deduplication: Collected 1 file(s) +- Inter-Skill Deduplication: Parsed skill 'dali-dynamic-mode': 150 char description + +## Publication Recommendation + +The skill is suitable to proceed toward NVSkills-Eval publication based on this benchmark. Skill owners should keep this file with the skill and refresh it when the evaluation dataset, skill behavior, or target agents materially change. diff --git a/.agents/skills/dali-dynamic-mode/SKILL.md b/skills/dali-dynamic-mode/SKILL.md similarity index 84% rename from .agents/skills/dali-dynamic-mode/SKILL.md rename to skills/dali-dynamic-mode/SKILL.md index 4a23da05938..9098932d760 100644 --- a/.agents/skills/dali-dynamic-mode/SKILL.md +++ b/skills/dali-dynamic-mode/SKILL.md @@ -1,15 +1,44 @@ --- name: dali-dynamic-mode -description: "Use when writing DALI data loading or preprocessing code with `nvidia.dali.experimental.dynamic` (ndd), or when converting DALI pipeline-mode code to dynamic mode, or when the user asks about DALI dynamic mode, imperative DALI, or ndd. Use this skill any time someone mentions 'ndd', 'dynamic mode', or wants to load/augment data with DALI outside of a pipeline definition." +description: "DALI imperative dynamic mode (`nvidia.dali.experimental.dynamic`, ndd): use when working on ndd code or migrating pipelines; skip pipeline-only tasks." +license: Apache-2.0 +metadata: + author: "DALI Team " + tags: + - dali + - dynamic-mode + - ndd + - data-loading + - data-processing + - gpu-processing + languages: + - python + team: dali + domain: deep-learning --- # DALI Dynamic Mode -Dynamic mode is DALI's imperative Python API. Call DALI operators as regular Python functions with standard control flow -- no pipeline graph, no `pipe.build()`, no `pipe.run()`. +## Purpose -```python -import nvidia.dali.experimental.dynamic as ndd -``` +Guide AI agents in writing, reviewing, and migrating code that uses DALI's imperative dynamic-mode API, `nvidia.dali.experimental.dynamic` (`ndd`). + +## Instructions + +- Import dynamic mode as `nvidia.dali.experimental.dynamic as ndd` and write code as direct `ndd` calls in ordinary Python; do not use pipeline-mode APIs such as `Pipeline`, `@pipeline_def`, `pipe.build()`, or `pipe.run()`. +- Treat readers as stateful: create them once, reuse them across epochs, and pass `batch_size` to `next_epoch(...)`. +- Pass explicit `batch_size` to random ops; there is no pipeline-level batch size to inherit. +- Use dynamic-mode API conventions: `device="gpu"` instead of pipeline-mode `"mixed"`, `Batch.tensors[...]` for sample selection, and `Batch.slice[...]` for per-sample slicing. + +## Prerequisites + +- To run or validate code, NVIDIA DALI must be installed with dynamic mode importable as `nvidia.dali.experimental.dynamic`. +- GPU decode or GPU operators require a CUDA-capable DALI build and an available NVIDIA GPU/driver. +- Framework conversion examples require the target framework installed, such as PyTorch for `.torch()`. + +## Introduction + +Dynamic mode is DALI's imperative Python API. It lets code call DALI operators directly from normal Python control flow instead of building and running a pipeline graph. ## Core Data Types @@ -186,12 +215,13 @@ Key rules: Manual `get_state` / `set_state` is also available directly on each `Reader` and `RNG` -- the `Checkpoint` aggregator is built on top of it. Use the manual API only when integrating with an external checkpoint system. -## Example: Image Classification Pipeline +## Examples + +### Image Classification Pipeline ```python import nvidia.dali.experimental.dynamic as ndd -ndd.set_num_threads(4) reader = ndd.readers.File(file_root="/data/imagenet/train", random_shuffle=True) for epoch in range(num_epochs): @@ -237,3 +267,12 @@ for epoch in range(num_epochs): | `output.as_cpu()` | `batch.cpu()` | | `pipe.run()` returns tuple of `TensorList` | `reader.next_epoch(batch_size=N)` yields tuples of `Batch` | | `Pipeline(..., enable_checkpointing=True)` + `pipe.checkpoint()` / `pipeline(checkpoint=...)` | `ndd.checkpoint.Checkpoint` + per-object `register` / `collect` / `save` / `load`; readers opt in with `enable_checkpointing=True` | + +## Limitations + +Dynamic mode is more flexible than pipeline mode, but can have slightly worse performance. For maximum throughput, prefer pipeline mode. + +## Troubleshooting + +- If errors surface later than the failing call, rerun the block under `with ndd.EvalMode.sync_full:`. +- If a reader behaves unexpectedly across epochs, check that it is created once and each `next_epoch()` iterator is fully consumed. diff --git a/.agents/skills/dali-dynamic-mode/evals/evals.json b/skills/dali-dynamic-mode/evals/evals.json similarity index 100% rename from .agents/skills/dali-dynamic-mode/evals/evals.json rename to skills/dali-dynamic-mode/evals/evals.json diff --git a/.agents/skills/dali-dynamic-mode/evals/files/pipeline_to_convert.py b/skills/dali-dynamic-mode/evals/files/pipeline_to_convert.py similarity index 100% rename from .agents/skills/dali-dynamic-mode/evals/files/pipeline_to_convert.py rename to skills/dali-dynamic-mode/evals/files/pipeline_to_convert.py diff --git a/skills/dali-dynamic-mode/skill-card.md b/skills/dali-dynamic-mode/skill-card.md new file mode 100644 index 00000000000..82d435afb13 --- /dev/null +++ b/skills/dali-dynamic-mode/skill-card.md @@ -0,0 +1,47 @@ +## Description:
+DALI imperative dynamic mode (`nvidia.dali.experimental.dynamic`, ndd): use when working on ndd code or migrating pipelines; skip pipeline-only tasks.
+ +This skill is ready for commercial/non-commercial use.
+ +## Owner +NVIDIA
+ +### License/Terms of Use:
+Apache-2.0
+## Use Case:
+Developers and engineers writing, reviewing, or migrating code that uses NVIDIA DALI's imperative dynamic-mode API for GPU-accelerated data loading and preprocessing.
+ +### Deployment Geography for Use:
+Global
+ +## Known Risks and Mitigations:
+Risk: Review before execution as proposals could introduce incorrect or misleading guidance into skills.
+Mitigation: Review and scan skill before deployment.
+ +## Reference(s):
+ + +## Skill Output:
+**Output Type(s):** [Code, Configuration instructions]
+**Output Format:** [Markdown with inline Python code blocks]
+**Output Parameters:** [1D]
+**Other Properties Related to Output:** [None]
+ +## Evaluation Metrics Used:
+Reported benchmark dimensions:
+- Security: Checks whether skill-assisted execution avoids unsafe behavior such as secret leakage, destructive commands, or unauthorized access.
+- Correctness: Checks whether the agent follows the expected workflow and produces the correct final output.
+- Discoverability: Checks whether the agent loads the skill when relevant and avoids using it when irrelevant.
+- Effectiveness: Checks whether the agent performs measurably better with the skill than without it.
+- Efficiency: Checks whether the agent uses fewer tokens and avoids redundant work.
+ + + +## Skill Version(s):
+4d4cfdd1 (source: git SHA, committed 2026-05-28)
+ +## Ethical Considerations:
+NVIDIA believes Trustworthy AI is a shared responsibility and we have established policies and practices to enable development for a wide array of AI applications. When downloaded or used in accordance with our terms of service, developers should work with their internal team to ensure this skill meets requirements for the relevant industry and use case and addresses unforeseen product misuse.
+ +(For Release on NVIDIA Platforms Only)
+Please report quality, risk, security vulnerabilities or NVIDIA AI Concerns [here](https://app.intigriti.com/programs/nvidia/nvidiavdp/detail).
diff --git a/skills/dali-dynamic-mode/skill.oms.sig b/skills/dali-dynamic-mode/skill.oms.sig new file mode 100644 index 00000000000..de47b27e048 --- /dev/null +++ b/skills/dali-dynamic-mode/skill.oms.sig @@ -0,0 +1 @@ +{"mediaType":"application/vnd.dev.sigstore.bundle.v0.3+json","verificationMaterial":{"x509CertificateChain":{"certificates":[{"rawBytes":"MIICgzCCAgmgAwIBAgIUKIyS7SxNteQIiWzK1dWj85E6520wCgYIKoZIzj0EAwMwVTELMAkGA1UEBhMCVVMxGzAZBgNVBAoMEk5WSURJQSBDb3Jwb3JhdGlvbjEpMCcGA1UEAwwgTlZJRElBIEFnZW50IENhcGFiaWxpdGllcyBJQ0EgMDEwHhcNMjYwNDAxMDAwMDAwWhcNMjgwNDIyMTUzMzA5WjBUMQswCQYDVQQGEwJVUzEbMBkGA1UECgwSTlZJRElBIENvcnBvcmF0aW9uMSgwJgYDVQQDDB9OVklESUEgQWdlbnQgU2tpbGxzIFNpZ25pbmcgMDAxMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEYoRM9bQl/dGlwSRNi6bTpIJUXH8Nv9GciP6LSflJYYMLCc296kpyuTSsk5ddbAWiDcFX3C/ydX3jwc+qCLYP6uHy9XphyLjOQ27Yb2J6rBLVtRBS1mgGco/Gr7fL6ODco4GaMIGXMB0GA1UdDgQWBBRQ/5ZW3nJ6lmo9SVk7I15o7UGmpTAfBgNVHSMEGDAWgBRPGpILxMBBleJSsBGjrMKsby1CgjAMBgNVHRMBAf8EAjAAMA4GA1UdDwEB/wQEAwIHgDA3BggrBgEFBQcBAQQrMCkwJwYI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KICAgICAgICAiYWxnb3JpdGhtIjogInNoYTI1NiIsCiAgICAgICAgImRpZ2VzdCI6ICI0NTdiNTVkMmEzODBiNGNkYjc3OGQ0NzVlNTM1YTYxZjQ5NjAwMDU0NGVhMmM5YzZjNzE2MDA5M2M3NWRjODk1IiwKICAgICAgICAibmFtZSI6ICJza2lsbC1jYXJkLm1kIgogICAgICB9CiAgICBdLAogICAgInNlcmlhbGl6YXRpb24iOiB7CiAgICAgICJhbGxvd19zeW1saW5rcyI6IGZhbHNlLAogICAgICAiaGFzaF90eXBlIjogInNoYTI1NiIsCiAgICAgICJtZXRob2QiOiAiZmlsZXMiLAogICAgICAiaWdub3JlX3BhdGhzIjogWwogICAgICAgICIuZ2l0IiwKICAgICAgICAiLmdpdGF0dHJpYnV0ZXMiLAogICAgICAgICIuZ2l0aWdub3JlIiwKICAgICAgICAiLmdpdGh1YiIKICAgICAgXQogICAgfQogIH0KfQ==","payloadType":"application/vnd.in-toto+json","signatures":[{"sig":"MGQCMGjyHHekJe2La3AijAWHTM4XlcMvr6f9IC9l4fo4S8cQ7QyU/NfrCaqPBd1or3H0dwIwTpBAfW0wiD/0biOMOByqW/LFpao99XnU60DWJcK/DdeDi1xr2ZGX9VHGbmoOz4+p","keyid":""}]}} \ No newline at end of file