Logo van Dpnp Interop

Dpnp Interop

Organisatie
intel
dpnp-interop

Passing dpnp arrays to and from other Python libraries on Intel CPUs and GPUs. Use when dpnp numeric work has to feed pandas, scikit-learn, PyTorch, or TensorFlow, when one of those libraries raises a type error on a dpnp array, when a pipeline mixes device math with host-only libraries, or when the user asks where in a pipeline the conversion belongs. Covers the boundary conversion pattern per library, the Intel extensions that accelerate the host side, and why a conversion inside a loop erases the benefit.

Overzicht

Uitgeverintel
Repositoryskills
Skillnaamdpnp-interop
Sterren
31
Forks
14
Meegeleverde bestanden
2
LicentieApache-2.0
Links
  • Instructies in Markdown

    Een SKILL.md-bestand dat het model laadt wanneer nodig, zodat het alleen tokens kost als een verzoek er daadwerkelijk bij past.

  • Werkt met elk LLM

    AI-skills zijn gewone Markdown, geen aanbiederspecifieke code. Daardoor werken ze met GPT, Claude, Gemini, Grok of een lokaal model.

  • 2 meegeleverde bestanden

    Scripts, sjablonen en referentiemateriaal die het model tijdens het werken kan lezen. Bestanden zijn alleen-lezen en worden nooit uitgevoerd.

  • Open source

    Gepubliceerd door intel op GitHub. Lees de broninhoud voordat je de skill installeert.

Installatie

Installeer de AI-skill Dpnp Interop in TypingMind om deze met elke LLM te gebruiken, of voeg de skill toe aan een andere agent die SKILL.md kan lezen.

1

Installeren in TypingMind

TypingMind installeert een skill rechtstreeks vanuit de GitHub-map — het leest SKILL.md, bundelt de bijbehorende bestanden en slaat het resultaat lokaal op.

  1. Open de app en ga naar Plug-ins → Skills.
  2. Kies "Installeren via GitHub".
  3. Plak de onderstaande URL van de skillmap en bevestig.
    https://github.com/intel/skills/tree/main/skills/dpnp-interop
  4. Schakel de skill in elke chat in waarin je deze beschikbaar wilt hebben.
Plug-ins → Skills → Nieuwe skill → Via GitHub-URL. Plak vervolgens de map-URL en druk op Doorgaan.
2

Installeren in een andere agent

Elke agent die het Agent Skills-formaat kan lezen, kan deze skill gebruiken — kopieer de map naar de skillmap van die agent.

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-interop .claude/skills/dpnp-interop
Start Claude Code na het kopiëren opnieuw op, zodat de nieuwe skill wordt herkend.

Gebruik deze skill in TypingMind

Schakel Dpnp Interop in een willekeurige chat in TypingMind in en het model doet de rest. De naam en beschrijving staan in de systeemprompt. Zodra een verzoek erbij past, laadt het model zelf de volledige instructies — je hoeft de skill nooit handmatig aan te roepen en deze kost pas tokens wanneer je de skill daadwerkelijk gebruikt.

Het model laadt Dpnp Interop automatisch zodra een verzoek erbij past.

Werkt met elk AI-model

AI-skills zijn gewone Markdown-instructies in plaats van aanbiederspecifieke code. Daardoor is Dpnp Interop niet gebonden aan het model waarvoor de skill is geschreven. Installeer de skill één keer in TypingMind en gebruik deze met GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama of een lokaal model dat je zelf draait — allemaal met je eigen API-sleutels.

  • Alleen geladen wanneer nodig

    De systeemprompt bevat alleen de naam en beschrijving. De instructies worden bij het eerste bijpassende verzoek opgehaald, dus een ongebruikte skill kost niets.

  • Wissel van model tijdens een chat

    Omdat de skill uit instructies bestaat en niet uit code, blijft deze werken als je van model wisselt — het volgende model leest hetzelfde SKILL.md-bestand.

Skillinstructies

Dit is de inhoud van SKILL.md die het model laadt. Lees deze vóór de installatie — een skill bestaat uit instructies die je model zal volgen.

dpnp interoperability

Purpose

Connects dpnp to the libraries around it. None of pandas, scikit-learn, PyTorch, or TensorFlow accepts a dpnp array: they check for a NumPy array, so every handoff is a dpnp.asnumpy() on the way out and a dpnp.array() on the way back. This skill is where that conversion goes, per library, and what it costs.

Prefer it when dpnp is one stage of a longer pipeline. The failure it prevents is not a crash — it is a pipeline that converts on every iteration and ends up slower than the NumPy version it replaced.

When to Use This Skill

Use this skill when:

  • A dpnp result has to reach pandas, scikit-learn, PyTorch, or TensorFlow.
  • One of those libraries raises a type error on a dpnp array.
  • A pipeline alternates between device math and host-only libraries.
  • The user asks where the conversion belongs.

Do not use this skill for file formats (dpnp-io), for device placement (dpnp-memory), or to decide whether the numeric stage belongs on a device at all (dpnp-quickstart).

Quick Start

python
import dpnp

x = dpnp.random.randn(10000, 100)      # device
gram = dpnp.dot(x, x.T)                # device
host_gram = dpnp.asnumpy(gram)         # one conversion, at the boundary

Do the arithmetic first, convert once, then call the host library. The rule is the whole skill; the sections below are the per-library spelling of it.

Implementation Guide

  1. pandas. Frames hold NumPy arrays, so convert both ways explicitly:

    python
    import pandas
    
    frame = pandas.DataFrame(dpnp.asnumpy(x), columns=list("abcde"))
    values = dpnp.array(frame.values)
    column = dpnp.array(frame["a"].values)
  2. scikit-learn. fit and predict take host arrays; convert the features and the target once before training:

    python
    from sklearn.linear_model import LinearRegression
    
    features = dpnp.asnumpy(x)
    target = dpnp.asnumpy(y)
    model = LinearRegression().fit(features, target)
    predictions = dpnp.array(model.predict(features))

    The host side of this has its own Intel acceleration — the scikit-learn extension patches estimators in place:

    python
    from sklearnex import patch_sklearn
    
    patch_sklearn()
  3. PyTorch. Go through NumPy in both directions, and bring a device tensor to the host first:

    python
    import torch
    
    tensor = torch.from_numpy(dpnp.asnumpy(x))
    back = dpnp.array(tensor.cpu().numpy())

    PyTorch has its own Intel GPU path: with a recent build, or with Intel Extension for PyTorch on older ones, tensors move with .to("xpu") and stay in the framework rather than passing through dpnp at all. When the whole pipeline is a model, that is the better route — this skill is for the case where array math and a model each own part of it.

  4. TensorFlow. Same shape, through tf.constant and .numpy():

    python
    import tensorflow as tf
    
    x_tf = tf.constant(dpnp.asnumpy(x))
    back = dpnp.array(x_tf.numpy())
  5. Put the conversions at the ends of a mixed pipeline, not between stages:

    python
    frame = pandas.read_csv("data.csv")                     # host
    features = dpnp.array(frame[["f1", "f2", "f3"]].values) # -> device
    normalized = (features - dpnp.mean(features, axis=0)) / dpnp.std(features, axis=0)
    inputs = torch.from_numpy(dpnp.asnumpy(normalized))     # -> host, once
  6. Check the boundary when a library refuses the array. The symptom is a type error naming ndarray, and it means the library ran an isinstance check. dpnp.asnumpy() at that call site is the fix; a wrapper that converts on every call is not.

Performance

No measured numbers ship with this skill. What to measure when a handoff is on the hot path:

  • Count conversions per unit of work. One at each boundary is the target; one per loop iteration is the anti-pattern, and it is usually the reason a converted pipeline is no faster.
  • Time the whole pipeline, not the numeric stage. A faster dpnp stage surrounded by more transfers can be a net loss.
  • Compare against the all-NumPy original. If the host library dominates the runtime, the numeric stage is not where the time is.
  • The Intel extensions for scikit-learn and PyTorch accelerate the host and framework side respectively; they do not remove the conversion.

Gotchas & Limitations

  • No library here takes a dpnp array directly. Treat the compatibility question as settled: convert, do not probe for support.
  • A conversion in a loop is the common failure. It is correct code, and it can be slower than never having used a device.
  • A CUDA tensor needs .cpu() first. torch.Tensor.numpy() on a device tensor raises; the host copy is not optional.
  • asnumpy copies. It is not a view, and peak memory holds both copies during the call.
  • The Intel extensions are separate packages with their own release cadence; whether patch_sklearn or an explicit extension import is needed depends on the installed versions, so check rather than assume.
  • Not covered: zero-copy exchange protocols such as DLPack or the array API interchange, and any library not named above.

References

FileLoad it when
references/official-sources.mdyou need the current interoperability surface of dpnp, whether a library has gained direct support, or the install and activation steps for the Intel extensions for scikit-learn and PyTorch

Two questions here must not be answered from memory: whether a library has gained direct support for device arrays (the interchange protocols are moving, and a claim that it has not can go stale) and how the Intel extensions are activated in the installed version, which has changed more than once.

Meegeleverde bestanden

Het model leest deze bestanden wanneer nodig terwijl de skill geladen is. Ze worden beschikbaar gesteld als leesbare bestanden en worden nooit uitgevoerd.

Veelgestelde vragen

Wat doet de AI-skill Dpnp Interop?

Passing dpnp arrays to and from other Python libraries on Intel CPUs and GPUs. Use when dpnp numeric work has to feed pandas, scikit-learn, PyTorch, or TensorFlow, when one of those libraries raises a type error on a dpnp array, when a pipeline mixes device math with host-only libraries, or when the user asks where in a pipeline the conversion belongs. Covers the boundary conversion pattern per library, the Intel extensions that accelerate the host side, and why a conversion inside a loop erases the benefit.

Waarom Dpnp Interop gebruiken in TypingMind?

Omdat je deze skill één keer installeert en met elk model kunt gebruiken. Dpnp Interop bestaat uit gewone Markdown in plaats van aanbiederspecifieke code. Dezelfde skill werkt dus met GPT-5, Claude, Gemini, Grok of een lokaal model, en je kunt midden in een chat van model wisselen zonder dat de skill niet meer werkt. TypingMind werkt met je eigen API-sleutels, dus je betaalt aanbieders rechtstreeks in plaats van een abonnement per gebruikersplek. Je skills en chats blijven in je eigen opslag.

Hoe installeer ik Dpnp Interop in TypingMind?

Open Plug-ins → Skills → Installeren vanaf GitHub in TypingMind en plak https://github.com/intel/skills/tree/main/skills/dpnp-interop. TypingMind leest het bestand SKILL.md, bundelt de bijbehorende bestanden en installeert het geheel als een skill die je per chat kunt inschakelen.

Welke AI-modellen kunnen Dpnp Interop gebruiken?

Elk model dat je in TypingMind koppelt. AI-skills bestaan uit gewone Markdown-instructies in plaats van aanbiederspecifieke code. GPT, Claude, Gemini, Grok en lokale modellen kunnen deze skill dus allemaal laden wanneer een verzoek erbij past.

Hoeveel AI-modellen kan ik met Dpnp Interop gebruiken?

Zoveel als je wilt. Zolang een model skills ondersteunt, kun je Dpnp Interop ermee gebruiken: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama en meer. Allemaal in TypingMind met je eigen API-sleutels.

Is de AI-skill Dpnp Interop gratis?

Ja. Deze skill is door intel op GitHub gepubliceerd onder de licentie Apache-2.0. Je betaalt alleen je eigen AI-aanbieder voor de tokens die je gebruikt.

Wat zijn AI-skills?

Een AI-skill is een herbruikbare bundel instructies die een AI-model leert hoe het één specifieke taak moet uitvoeren. Deze volgt het open Agent Skills-formaat: een bestand met de naam SKILL.md met een naam en beschrijving, plus eventuele scripts, sjablonen of referentiebestanden die het model nodig heeft. Het model leest de instructies alleen als je verzoek bij de skill past. Een geïnstalleerde skill kost dus niets zolang deze niet wordt gebruikt.

Waarin verschillen AI-skills van plug-ins of MCP-servers?

Een plug-in of MCP-server geeft een model nieuwe tools om aan te roepen: code die ergens wordt uitgevoerd en een resultaat teruggeeft. Een AI-skill geeft het model juist kennis en een werkwijze: hoe het een taak moet aanpakken, welke stappen het moet volgen en hoe goede uitvoer eruitziet. Skills bestaan uit gewone Markdown en hebben dus geen server, API-sleutel of runtime nodig. Ze werken met elk model.

Toon alles

Maak nu je eigen AI-werkruimte

Schrijf je in voor onze nieuwsbrief en blijf op de hoogte van nieuwe functies en toekomstige weggeefacties 👇