Dpnp Quickstartのロゴ

Dpnp Quickstart

組織
intel
dpnp-quickstart

Getting started with new dpnp code on Intel CPUs and GPUs: installing dpnp, listing dpctl devices and choosing a device or queue, pinning work to the CPU or a GPU, timing dpnp against NumPy, and profiling a dpnp loop. Use when the user is setting up dpnp for the first time, wants to see which devices are visible, or wants a benchmark of dpnp against NumPy. Not for porting an existing codebase (dpnp-migration) or for errors that appear after the port (dpnp-troubleshooting).

概要

公開者intel
リポジトリskills
スキル名dpnp-quickstart
スター
31
フォーク
14
同梱ファイル
2
ライセンスApache-2.0
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

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

  • 2個の同梱ファイル

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

  • オープンソース

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

インストール

AIスキルDpnp Quickstartを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-quickstart
  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-quickstart .claude/skills/dpnp-quickstart
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

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

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

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

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

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

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

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

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

dpnp quickstart

Purpose

Runs NumPy-style array operations on Intel CPUs and GPUs through dpnp, which mirrors the NumPy API over SYCL device memory. Covers installation, SYCL device selection with dpctl, migrating existing NumPy code, falling back to NumPy for unimplemented APIs, and measuring whether the move actually paid off.

Prefer this over plain NumPy when the arrays are large and the work is math-heavy on Intel hardware. Prefer plain NumPy when the arrays are small — dpnp has dispatch overhead that a small array cannot amortize.

When to Use This Skill

Use this skill when:

  • The user is trying dpnp for the first time on Intel CPU or GPU execution.
  • The user asks whether a NumPy hot path can run on an Intel GPU.
  • The user needs to check a dpnp install, or which SYCL device will be used.
  • The user wants to compare dpnp against NumPy.

Porting an existing NumPy or CuPy codebase is dpnp-migration; an error that appears after the port, such as a NumPy API dpnp does not implement, is dpnp-troubleshooting.

Use dpnp for:

  • Large arrays (>10,000 elements)
  • Math-heavy operations (linear algebra, FFT, reductions)
  • Intel CPU/GPU acceleration

Do not use this skill — stick with NumPy — for:

  • Small arrays (<1,000 elements)
  • I/O operations
  • APIs not yet implemented in dpnp

Quick Start

Run this first to confirm the environment before changing any user code.

bash
# Conda (officially recommended)
conda install -c https://software.repos.intel.com/python/conda -c conda-forge --override-channels dpnp

# Alternative: pip (may have native dependency issues)
pip install dpnp

# verify installation
python -c "import dpnp; print(dpnp.__version__)"

Then confirm which device the arrays will actually land on:

python
import dpctl
import dpnp as np

print(dpctl.select_default_device())

x = np.arange(100_000)
print(x.sycl_device)

Report what this prints. Do not claim GPU execution if the output shows a CPU device — the default SYCL device is the GPU only when one is visible.

Implementation Guide

  1. Confirm the environment — install and print the device, as in Quick Start.

  2. Swap the import. dpnp is a drop-in NumPy replacement for the covered API:

    python
    # Drop-in NumPy replacement
    import dpnp as np
    
    # Create arrays
    x = np.array([1, 2, 3, 4])
    y = np.arange(1000000)
    
    # Operations work like NumPy
    result = np.sum(y)
    dot_product = np.dot(x, x)
  3. Port the hot path. Array creation, reductions, and linear algebra keep their NumPy spelling:

    python
    import dpnp as np
    
    # Array creation
    a = np.zeros((100, 100))
    b = np.ones(1000)
    c = np.linspace(0, 10, 100)
    
    # Math operations
    sum_val = np.sum(a)
    mean_val = np.mean(b)
    std_val = np.std(c)
    
    # Linear algebra
    mat = np.random.randn(100, 100)
    result = np.dot(mat, mat.T)
  4. Add fallbacks for uncovered APIs. dpnp implements a subset of NumPy, and coverage is per-parameter, not just per-function. Check with dir(dpnp) or the documentation, and guard the call:

    python
    import dpnp
    import numpy as np
    
    def safe_unique(x):
        try:
            return dpnp.unique(x)
        except (NotImplementedError, TypeError):
            host_x = dpnp.asnumpy(x) if isinstance(x, dpnp.ndarray) else x
            return np.unique(host_x)
  5. Convert at API boundaries, not inside loops. Use dpnp.asnumpy() when a downstream library needs a NumPy array. Pandas, scikit-learn, and many NumPy-based libraries usually expect NumPy arrays: use dpnp for the numeric hot path, then convert once with asnumpy() before calling host-oriented libraries. Repeated device-to-host copies inside tight loops can erase acceleration gains.

  6. Constrain the device when the code must be portable. There is no ambient current-device setting and no context manager to enter — placement is an argument at construction. Inspect what is visible with dpctl, then pin allocation with device= or by reusing an existing array's queue, when the same code runs across workstations, containers, and cloud VMs with different SYCL devices:

    python
    import dpctl
    import dpnp
    
    print([d.filter_string for d in dpctl.get_devices()])   # what is actually there
    
    x = dpnp.arange(100_000, device="cpu")                  # pin this array
    print(x.sycl_device)
    
    y = dpnp.zeros(x.size, sycl_queue=x.sycl_queue)         # keep the next one beside it
  7. Validate, then measure. Compare against NumPy with numpy.testing.assert_allclose() for critical math before making any performance claim.

Performance

No verified benchmark numbers ship with this skill yet. Do not state a speedup that measurement in the user's own environment does not support.

To measure:

  • Warm up once before timing, to avoid measuring first-run compilation.
  • Compare against NumPy with the same inputs and dtype.
  • Profile end-to-end pipelines, including conversions and host-library calls.

Gotchas & Limitations

  • First run is slow: JIT compilation happens on first execution. Time the second run.
  • Not all NumPy APIs available: Check compatibility with dir(dpnp) or documentation.
  • Data transfer cost: Converting between dpnp and NumPy arrays has overhead. Avoid in tight loops.
  • Small arrays slower: dpnp has dispatch overhead. Use NumPy for small arrays (<1,000 elements).
  • Parameter-level gaps: a function existing in dpnp does not mean every NumPy keyword argument is accepted — TypeError on an unexpected keyword is the common symptom.
  • Device assumptions: the default SYCL device is whatever is visible. Code that works on a GPU workstation can land on CPU in CI without erroring.

References

FileLoad it when
references/official-sources.mdyou need to check a claim against upstream documentation — API coverage for a given release, install prerequisites, or which dpnp version implements a function

Two questions in this skill should not be answered from memory, and this is where they get answered: is this NumPy API covered (coverage is per keyword argument and changes between releases) and is this package available for the user's platform.

同梱ファイル

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

よくある質問

AIスキル「Dpnp Quickstart」では何ができますか?

Getting started with new dpnp code on Intel CPUs and GPUs: installing dpnp, listing dpctl devices and choosing a device or queue, pinning work to the CPU or a GPU, timing dpnp against NumPy, and profiling a dpnp loop. Use when the user is setting up dpnp for the first time, wants to see which devices are visible, or wants a benchmark of dpnp against NumPy. Not for porting an existing codebase (dpnp-migration) or for errors that appear after the port (dpnp-troubleshooting).

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

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

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

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

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

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

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

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

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

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

AIスキルとは何ですか?

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

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

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

すべて見る

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

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