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でも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 2個の同梱ファイル

    モデルが作業中に読み取れるスクリプト、テンプレート、参考資料です。ファイルは読み取り専用で、実行されることはありません。

  • オープンソース

    intelがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキルDpnp IoをTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/intel/skills/tree/main/skills/dpnp-io
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

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で使用

TypingMindのチャットでDpnp Ioを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあると、モデルが自動的にDpnp Ioを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Dpnp Ioは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、未使用のスキルにはコストがかかりません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じ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.

同梱ファイル

スキルが読み込まれている間、モデルは必要に応じてこれらを読み取ります。読み取り可能なファイルとして提供され、実行されることはありません。

よくある質問

AIスキル「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).

TypingMindでDpnp Ioを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Dpnp Ioはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにDpnp Ioをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/intel/skills/tree/main/skills/dpnp-ioを貼り付けてください。TypingMindがSKILL.mdを読み込み、関連ファイルをまとめて、チャットごとに有効にできるスキルとしてインストールします。

Dpnp Ioを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストが合致したときにこのスキルを読み込めます。

Dpnp Ioは何個のAIモデルで使えますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもDpnp Ioを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Dpnp Io」は無料ですか?

はい。intelがGitHubでApache-2.0ライセンスの下で公開しています。支払いが必要なのは、利用したトークンに対する、ご自身が契約するAIプロバイダーへの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇