Логотип Dpnp Io

Dpnp Io

Організація
intel
dpnp-io

Reading and writing files from dpnp code on Intel CPUs and GPUs: loading .npy, .npz, HDF5, Zarr, CSV or text into dpnp arrays and saving dpnp results back to disk, incremental writes, and choosing a file format by dataset size. Use when the user needs to load a file into dpnp or save a result, or when a file is too large to read at once and must be streamed. Not for chunking an in-memory workload against device capacity (dpnp-memory).

Огляд

Видавецьintel
Репозиторійskills
Назва навичкиdpnp-io
Зірки
31
Форки
14
Файли в пакеті
2
ЛіцензіяApache-2.0
Посилання
  • Інструкції у форматі Markdown

    Файл SKILL.md, який модель завантажує за потреби, тож токени витрачаються лише тоді, коли запит справді відповідає навичці.

  • Працює з будь-якою LLM

    Навички ШІ — це звичайний Markdown, а не код для певного постачальника, тому вони працюють із GPT, Claude, Gemini, Grok або локальною моделлю.

  • Файлів у комплекті: 2

    Скрипти, шаблони й довідкові матеріали, які модель може читати під час роботи. Файли доступні лише для читання й ніколи не виконуються.

  • Відкритий вихідний код

    Опубліковано на GitHub користувачем intel. Перегляньте вихідний вміст перед установленням.

Встановлення

Установіть навичку ШІ Dpnp Io у TypingMind, щоб використовувати її з будь-якою LLM, або додайте її до іншого агента, що читає SKILL.md.

1

Встановити в TypingMind

TypingMind встановлює навичку безпосередньо з її папки GitHub — читає SKILL.md, збирає файли ресурсів у пакет і зберігає результат локально.

  1. Відкрийте застосунок і перейдіть до Плагіни → Навички.
  2. Виберіть «Встановити з GitHub».
  3. Вставте наведений нижче URL папки навички та підтвердьте встановлення.
    https://github.com/intel/skills/tree/main/skills/dpnp-io
  4. Увімкніть навичку в кожному чаті, де хочете її використовувати.
Плагіни → Навички → Нова навичка → За URL GitHub, потім вставте URL папки й натисніть «Продовжити».
2

Встановити в іншому агенті

Будь-який агент, що підтримує формат Agent Skills, може використовувати цю навичку — скопіюйте папку до каталогу навичок цього агента.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/intel/skills.git /tmp/skills
mkdir -p .claude/skills
cp -r /tmp/skills/skills/dpnp-io .claude/skills/dpnp-io
Після копіювання перезапустіть Claude Code, щоб завантажити нову навичку.

Використовуйте навичку в TypingMind

Увімкніть навичку Dpnp Io в будь-якому чаті TypingMind, і далі модель усе зробить сама. Назва й опис навички містяться в системному промпті, а щойно надходить відповідний запит, модель самостійно завантажує повні інструкції — вам не потрібно викликати навичку вручну, і до фактичного використання вона не витрачає токенів.

Модель самостійно завантажує навичку Dpnp Io, щойно надходить відповідний запит.

Працює з будь-якою моделлю ШІ

Навички ШІ — це звичайні інструкції Markdown, а не код для певного постачальника, тому навичка Dpnp Io не прив’язана до моделі, для якої її створено. Установіть її один раз у TypingMind і використовуйте з GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama або локальною моделлю, яку ви запускаєте самостійно, — усе з вашими власними ключами API.

  • Завантажується лише за потреби

    Системний промпт містить лише назву й опис. Інструкції завантажуються за першого відповідного запиту, тож невикористана навичка нічого не коштує.

  • Змінюйте моделі під час чату

    Оскільки навичка — це інструкції, а не код, зміна моделі не порушує її роботу: наступна модель читає той самий файл SKILL.md.

Інструкції навички

Це вміст файлу SKILL.md, який завантажує модель. Прочитайте його перед установленням — навичка містить інструкції, яких дотримуватиметься ваша модель.

dpnp file I/O

Purpose

Gets data in and out of dpnp arrays. dpnp has no native binary file I/O: every format goes through NumPy, with dpnp.array() on the way in and dpnp.asnumpy() on the way out. This skill is that round trip, plus the chunked variants for data larger than memory and the format choice by size.

Prefer it over reaching for a dpnp.save() that does not exist, and over loading a file whole when the device cannot hold it.

When to Use This Skill

Use this skill when:

  • An array has to be loaded into dpnp from a file, or a result written out.
  • A file is larger than host or device memory and must be streamed in pieces.
  • The user is choosing between .npy, .npz, HDF5, Zarr, and CSV.
  • The user asks why dpnp will not write their format.

Do not use this skill to decide device placement or chunk sizing against device capacity — that is dpnp-memory — and do not expect it to make an I/O-bound job faster: if reading dominates, moving the compute to a device changes nothing.

Quick Start

python
import numpy
import dpnp

arr = dpnp.array(numpy.load("data.npy"))          # host file -> device array
result = dpnp.fft.fft2(arr) + dpnp.mean(arr)      # compute on the device
numpy.save("output.npy", dpnp.asnumpy(result))    # device array -> host file

The whole skill is that shape: NumPy load → dpnp.array() → compute → dpnp.asnumpy() → NumPy save.

Implementation Guide

  1. .npy and .npz. One array or several, with the archive closed after reading:

    python
    with numpy.load("data.npz") as npz:
        x = dpnp.array(npz["x"])
        y = dpnp.array(npz["y"])
    
    numpy.savez("output.npz", x=dpnp.asnumpy(x), y=dpnp.asnumpy(y))

    Each conversion needs a full host copy of the array as well as the device copy, so a 4 GB array wants 4 GB of free RAM during the call.

  2. Chunked reads for a file larger than RAM. Memory-map the source, write each processed chunk straight into a pre-allocated output slice rather than appending to a list:

    python
    data = numpy.load("large.npy", mmap_mode="r")
    final = numpy.empty(len(data), dtype=numpy.float64)
    chunk = 25_000_000
    
    for start in range(0, len(data), chunk):
        host = data[start:start + chunk]
        processed = dpnp.sqrt(dpnp.array(host)) * 2.0
        final[start:start + len(host)] = dpnp.asnumpy(processed)
    
    numpy.save("output.npy", final)

    A chunk of roughly a tenth to a fifth of free RAM is a workable start.

  3. HDF5 through h5py. h5py only speaks NumPy, so the same conversion applies, and datasets can be written incrementally when the result is too large to hold:

    python
    import h5py
    
    with h5py.File("output.h5", "w") as handle:
        dset = handle.create_dataset("result", shape=(50_000_000,), dtype="float64")
        for start in range(0, 50_000_000, 5_000_000):
            dset[start:start + 5_000_000] = dpnp.asnumpy(compute_chunk(start))
  4. Zarr for very large or remote arrays. Chunked, compressed, and reachable on object storage through fsspec; read and write slice by slice:

    python
    import zarr
    
    store = zarr.open("output.zarr", mode="w", shape=(10_000_000,),
                      chunks=(500_000,), dtype="float32")
    for start in range(0, 10_000_000, 500_000):
        store[start:start + 500_000] = dpnp.asnumpy(compute_chunk(start))
  5. Text and CSV. dpnp.loadtxt() returns a dpnp array directly (it delegates to numpy.loadtxt internally, and does not support structured dtypes). Anything with headers, strings, or missing values goes through numpy.loadtxt/numpy.genfromtxt or pandas first:

    python
    import pandas
    
    frame = pandas.read_csv("data.csv")
    arr = dpnp.array(frame.values)
    numpy.savetxt("output.csv", dpnp.asnumpy(arr), delimiter=",")
  6. Pick the format by size. .npy/.npz below about a gigabyte, HDF5 for multi-dataset files in the gigabyte range, Zarr above that or when the data lives in cloud storage, CSV only for small human-readable exports.

Performance

No measured numbers ship with this skill. What to measure, and in which order:

  • Time the I/O and the compute separately first. If reading dominates, no device will help and the conversion cost is irrelevant either way.
  • Count conversions, not bytes. One conversion at each end of a batch of work is the pattern; one per iteration of a loop is the anti-pattern, and it is the usual reason a rewritten pipeline is no faster.
  • Chunking trades peak memory against more conversions. Compare the two on the real file rather than assuming a ratio.
  • CSV parsing is CPU-bound and dominates everything around it. Convert once to .npy or HDF5 if the same file is read repeatedly.

Gotchas & Limitations

  • There is no dpnp.save() for binary formats. dpnp.loadtxt() exists; .npy, HDF5, and Zarr all go through NumPy. Code that calls a dpnp save function fails at the call, not at review.
  • Conversion doubles peak memory. Host copy plus device copy, briefly, for every dpnp.array() and dpnp.asnumpy().
  • Accumulating chunks in a list defeats chunking. The whole point is that the full array never exists in memory; a pre-allocated output or an incremental dataset write is what preserves that.
  • mmap_mode="r" is a NumPy facility, not a device one. The mapped pages are host memory; each chunk still gets copied to the device.
  • Not covered: parallel or multi-process writes, Arrow and Parquet, and anything about which device the array lands on — see dpnp-memory for that.

References

FileLoad it when
references/official-sources.mdyou need to confirm what dpnp implements for a given release — whether a loadtxt-style entry point exists, or which NumPy I/O helpers have a dpnp counterpart — or the current h5py or Zarr chunking API

Two questions here should not be answered from memory: which I/O entry points the installed dpnp actually has (the list has grown between releases) and the current chunking API of h5py and Zarr, both of which are documented upstream and change on their own schedule.

Файли в пакеті

Модель читає ці файли за потреби, поки навичку завантажено. Вони доступні для читання й ніколи не виконуються.

Поширені запитання

Що робить навичка ШІ Dpnp Io?

Reading and writing files from dpnp code on Intel CPUs and GPUs: loading .npy, .npz, HDF5, Zarr, CSV or text into dpnp arrays and saving dpnp results back to disk, incremental writes, and choosing a file format by dataset size. Use when the user needs to load a file into dpnp or save a result, or when a file is too large to read at once and must be streamed. Not for chunking an in-memory workload against device capacity (dpnp-memory).

Навіщо використовувати Dpnp Io у TypingMind?

Тому що ви встановлюєте її один раз і використовуєте з будь-якою моделлю. Dpnp Io — це звичайний Markdown, а не код для конкретного постачальника, тому та сама навичка працює з GPT-5, Claude, Gemini, Grok або локальною моделлю. Ви можете змінити модель навіть посеред чату, і навичка продовжить працювати. TypingMind використовує ваші власні ключі API, тож ви платите безпосередньо постачальникам замість передплати за кожне місце користувача, а ваші навички й чати залишаються у вашому сховищі.

Як встановити Dpnp Io у TypingMind?

Відкрийте в TypingMind Плагіни → Навички → Встановити з GitHub і вставте https://github.com/intel/skills/tree/main/skills/dpnp-io. TypingMind прочитає файл SKILL.md, додасть супровідні файли та встановить навичку, яку можна вмикати окремо для кожного чату.

Які моделі ШІ можуть використовувати Dpnp Io?

Будь-яка модель, яку ви підключите в TypingMind. Навички ШІ — це звичайні інструкції у форматі Markdown, а не код для конкретного постачальника, тому GPT, Claude, Gemini, Grok і локальні моделі можуть завантажувати цю навичку, коли запит їй відповідає.

Зі скількома моделями ШІ можна використовувати Dpnp Io?

Зі скількома забажаєте. Якщо модель підтримує навички, ви можете використовувати з нею Dpnp Io — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama та інші — усе в TypingMind із власними ключами API.

Чи безкоштовна навичка ШІ Dpnp Io?

Так. Навичку опубліковано на GitHub: intel, за ліцензією Apache-2.0. Ви платите лише своєму постачальнику ШІ за використані токени.

Що таке навички ШІ?

Навичка ШІ — це багаторазовий набір інструкцій, який навчає модель ШІ виконувати одне конкретне завдання. Він відповідає відкритому формату Agent Skills: файл SKILL.md із назвою та описом, а також скрипти, шаблони чи довідкові файли, які можуть знадобитися моделі. Модель читає інструкції лише тоді, коли ваш запит відповідає навичці, тому встановлена навичка нічого не коштує, доки її не використано.

Чим навички ШІ відрізняються від плагінів або серверів MCP?

Плагін або сервер MCP надає моделі нові інструменти для виклику — код, який десь виконується й повертає результат. Натомість навичка ШІ надає моделі знання та порядок дій: як підійти до завдання, яких кроків дотримуватися та яким має бути якісний результат. Навички — це звичайний Markdown, тож їм не потрібні ні сервер, ні ключ API, ні середовище виконання, і вони працюють із будь-якою моделлю.

Усі

Створіть власний ШІ-простір уже зараз

Підпишіться на нашу розсилку, щоб дізнаватися про нові функції та майбутні розіграші 👇