技能创建器
skill-creator
创建、改进和评估自定义技能,把专业流程转化为可重复使用的 AI 能力。
datapipes【数据与研究】Build and debug PhysicsNeMo reader-to-Dataset-to-DataLoader data pipelines for TensorDict, mesh, streaming, and Hydra-configured workflows.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Use this sub-skill when the user needs to load scientific ML data into PhysicsNeMo, build reader → dataset → transform → DataLoader workflows, validate TensorDict payloads, choose file formats, configure Hydra datapipes, or debug data-format/collation/device/streaming failures.
Use this sub-skill for requests that mention any of:
Dataset, DataLoader, TensorDict, MultiDataset, MeshDataset, or IterableDatasetBase..pmsh, or .pdmsh data into a model.Normalize, SubsamplePoints, Compose, KNearestNeighbors, MeshToTensorDict, custom readers/transforms/collators, Hydra ${dp:...} configs, or data-pipeline reproducibility.TensorDict keys/shapes, optional dependencies, CPU↔CUDA transfer, stream prefetching, or online/iterable generators.Reader, inspect len(reader), reader.field_names, and reader[0]; then wrap with Dataset, then DataLoader. Recipes are in references/datapipe-workflows.md.Normalize, SubsamplePoints, spatial/mesh transforms, or custom transforms only after raw reader output is correct. Use references/api-reference.md for exact constructor names.prefetch_factor=0 or call loader.disable_prefetch() before investigating CUDA streams or threaded I/O. See references/troubleshooting.md.NumpyReader → Dataset → DataLoader on CPU or CUDA..npz with sample axis in the first dimension: use NumpyReader(path, fields=..., index_key=...)..npz sample files: use NumpyReader(directory, file_pattern="sample_*.npz", fields=...); this mode supports reader-side coordinated subsampling.HDF5Reader; it reads root-level datasets by key and indexes the first dimension in single-file mode.ZarrReader for local Zarr groups, attributes-as-tensors, store caching, and single-group or directory mode.TensorStoreZarrReader when tensorstore is installed and you want explicit cache/concurrency controls.VTKReader only when the optional VTK/PyVista stack is installed and the sample directories contain supported mesh files.MeshReader for .pmsh single meshes and DomainMeshReader for .pdmsh domain meshes; pair with MeshDataset and mesh transforms.IterableDatasetBase and let DataLoader use the main-thread generator path.Before handing a datapipe to a training or inference loop, verify:
len(reader) is correct for map-style data, or len(loader) intentionally raises for iterable data.reader.field_names or the first sample contains the expected keys.reader[0] returns (TensorDict, metadata) for tensor readers, or (Mesh/DomainMesh, metadata) for mesh readers.Dataset(reader, device=...) moves tensors to the intended device before transforms.DataLoader(..., collate_metadata=True) returns metadata only if the training loop needs source indices, filenames, or dataset_index.seed= and loader.set_epoch(epoch) are used when stochastic readers/transforms must be reproducible.Reader._load_sample implementation.TensorDict-style payloads; order matters.DataLoader is thread/stream oriented rather than PyTorch multiprocessing oriented. Pinned reader output plus device="cuda" is what enables asynchronous host-to-device transfer.