Logo von Dpnp Random

Dpnp Random

Organisation
intel
dpnp-random

Random number generation with dpnp on Intel CPUs and GPUs, backed by oneMKL. Use when NumPy random calls move to dpnp, when a seeded dpnp run does not reproduce a NumPy sequence, when a distribution turns out not to be implemented, when results have to be reproducible across machines, or when random data feeds a training or augmentation loop. Covers the supported distributions, what seeding does and does not guarantee, the host fallback, and where to generate data so it does not bounce between host and device.

Übersicht

Herausgeberintel
Repositoryskills
Skill-Namedpnp-random
Sterne
31
Forks
14
Mitgelieferte Dateien
2
LizenzApache-2.0
Links
  • Anweisungen in Markdown

    Eine SKILL.md-Datei, die das Modell bei Bedarf lädt. So werden nur dann Token verbraucht, wenn eine Anfrage tatsächlich dazu passt.

  • Funktioniert mit jedem LLM

    KI-Skills bestehen aus reinem Markdown, nicht aus anbieterspezifischem Code. Daher funktionieren sie mit GPT, Claude, Gemini, Grok oder einem lokalen Modell.

  • 2 mitgelieferte Dateien

    Skripte, Vorlagen und Referenzmaterial, die das Modell bei der Arbeit lesen kann. Die Dateien sind schreibgeschützt und werden niemals ausgeführt.

  • Open Source

    Von intel auf GitHub veröffentlicht. Prüfen Sie den Quellinhalt vor der Installation.

Installation

Installieren Sie den KI-Skill Dpnp Random in TypingMind, um ihn mit jedem LLM zu nutzen, oder fügen Sie ihn einem anderen Agenten hinzu, der SKILL.md lesen kann.

1

In TypingMind installieren

TypingMind installiert einen Skill direkt aus seinem GitHub-Ordner — liest SKILL.md, bündelt die Ressourcendateien und speichert das Ergebnis lokal.

  1. Öffnen Sie die App und gehen Sie zu Plugins → Skills.
  2. Wählen Sie „Von GitHub installieren“.
  3. Fügen Sie die unten angegebene URL des Skill-Ordners ein und bestätigen Sie.
    https://github.com/intel/skills/tree/main/skills/dpnp-random
  4. Aktivieren Sie den Skill in jedem Chat, in dem er verfügbar sein soll.
Plugins → Skills → Skill anlegen → Über GitHub-URL. Fügen Sie dann die Ordner-URL ein und klicken Sie auf „Weiter“.
2

In einem anderen Agenten installieren

Jeder Agent, der das Agent-Skills-Format lesen kann, kann diesen Skill nutzen — kopieren Sie den Ordner in das Skill-Verzeichnis des jeweiligen Agenten.

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-random .claude/skills/dpnp-random
Starten Sie Claude Code nach dem Kopieren neu, damit der neue Skill erkannt wird.

In TypingMind verwenden

Aktivieren Sie Dpnp Random in einem beliebigen Chat in TypingMind. Den Rest übernimmt das Modell. Name und Beschreibung des Skills stehen im System-Prompt. Sobald eine Anfrage passt, lädt das Modell selbstständig die vollständigen Anweisungen — Sie müssen den Skill nie manuell aufrufen, und er verbraucht erst Token, wenn er tatsächlich genutzt wird.

Das Modell lädt Dpnp Random automatisch, sobald eine passende Anfrage gestellt wird.

Funktioniert mit jedem KI-Modell

KI-Skills bestehen aus reinen Markdown-Anweisungen statt aus anbieterspezifischem Code. Daher ist Dpnp Random nicht an das Modell gebunden, für das der Skill geschrieben wurde. Installieren Sie ihn einmal in TypingMind und nutzen Sie ihn mit GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder einem selbst betriebenen lokalen Modell — alles mit Ihren eigenen API-Keys.

  • Wird nur bei Bedarf geladen

    Der System-Prompt enthält nur den Namen und die Beschreibung. Die Anweisungen werden bei der ersten passenden Anfrage geladen. Ein ungenutzter Skill verursacht daher keine Kosten.

  • Modell im laufenden Chat wechseln

    Da der Skill aus Anweisungen statt aus Code besteht, funktioniert er auch nach einem Modellwechsel — das nächste Modell liest dieselbe SKILL.md-Datei.

Skill-Anweisungen

Dies ist der Inhalt von SKILL.md, den das Modell lädt. Lesen Sie ihn vor der Installation — ein Skill besteht aus Anweisungen, denen Ihr Modell folgt.

dpnp random number generation

Purpose

Generates random data with dpnp.random, which is backed by oneMKL on Intel CPUs and GPUs and mirrors the NumPy API for the distributions it implements. Covers what is implemented, what seeding actually guarantees, how to fall back to NumPy for a missing distribution, and how to keep generation from becoming a stream of host-device copies.

The reproducibility part is the reason this skill exists: the API looks like NumPy's and the numbers are different, which is correct behaviour and reliably surprises people.

When to Use This Skill

Use this skill when:

  • NumPy random calls are being moved to dpnp.
  • A seeded dpnp run does not reproduce a seeded NumPy run.
  • A distribution raises NotImplementedError or is missing.
  • Results must be reproducible across machines or devices.
  • Random data feeds a training loop, dropout, augmentation, or an initializer.

Do not use this skill when the arrays are small — NumPy is the better answer there — and do not use it to claim a generation speedup: there are no measured numbers here.

Quick Start

python
import dpnp

dpnp.random.seed(42)
x = dpnp.random.randn(1000, 1000)             # standard normal
y = dpnp.random.uniform(0, 1, size=10000)     # uniform [0, 1)
z = dpnp.random.randint(0, 100, size=500)     # integers [0, 100)

Seeding twice with the same value on the same device reproduces the same sequence. It does not reproduce NumPy's sequence — see the Guide.

Implementation Guide

  1. Use the NumPy spelling for what is implemented. rand, randn, random, uniform, normal, randint, choice, shuffle, and the common univariate distributions — exponential, poisson, binomial, geometric, gamma, beta — keep their NumPy signatures. Confirm the specific one against the installed release rather than a remembered list.

  2. Set the seed once, at the top. Reseeding inside a loop resets generator state on every iteration and produces neither speed nor determinism:

    python
    dpnp.random.seed(42)
    noise = dpnp.random.randn(1000, 256, 256)      # one call, all iterations
    for index in range(1000):
        image = clean + noise[index]
  3. Do not expect NumPy's numbers. dpnp.random and numpy.random use different generators — oneMKL's on one side, NumPy's PCG64 on the other — so the same seed gives different sequences. This is expected, not a bug, and it means a reproducibility chain must not mix the two:

    python
    import numpy
    
    numpy.random.seed(42)
    dpnp.random.seed(42)
    # numpy.random.randn(5) and dpnp.random.randn(5) do not match, by design
  4. Fall back on the host for a missing distribution. Generate with NumPy, then move the batch across once — the cost is the transfer, so make the batch large:

    python
    host = numpy.random.beta(a=2.0, b=5.0, size=100_000)
    device_array = dpnp.array(host)
    result = dpnp.mean(device_array ** 2)

    Distributions commonly missing include the multivariate ones — dirichlet, multivariate_normal, multinomial — and several of the long tail such as chisquare, triangular, vonmises, wald, zipf. Check before promising one.

  5. Persist the draw when a result has to be reproducible elsewhere. Seeding guarantees a sequence on the same device and release; a different device type, or a different version, may produce a different one. When an experiment has to be replayed exactly, save the numbers rather than the seed — through NumPy, because dpnp has no binary writer of its own:

    python
    dpnp.random.seed(42)
    numpy.save("random_state.npy", dpnp.asnumpy(dpnp.random.randn(1_000_000)))
    later = dpnp.array(numpy.load("random_state.npy"))
  6. Generate where the data is consumed. Random values that feed device compute should be drawn on the device; values that immediately go back to the host should be drawn with NumPy. Offsets for a crop, a dropout mask, or an initializer belong on the device:

    python
    def dropout(x, p=0.5, training=True):
        if not training:
            return x
        mask = dpnp.random.rand(*x.shape) > p
        return x * mask / (1 - p)

Performance

No measured numbers ship with this skill. Generation is memory-bandwidth bound rather than compute bound, which shapes what is worth measuring:

  • There is a size below which kernel launch overhead dominates and NumPy wins. It is in the thousands of elements, not the millions; measure the real shapes.
  • The first call pays for plan creation, and later calls of the same size reuse it. Warm up before timing, and never time a reseeded loop.
  • One large draw beats many small ones, because the fixed cost is paid once.
  • A host fallback costs a transfer per batch. Batch size, not distribution, is what makes that acceptable.

Gotchas & Limitations

  • Same seed, different numbers from NumPy. Different generator, by design. A test that compares sequences across the two libraries is testing the wrong thing; compare distributions or statistics instead.
  • Reseeding in a loop is the classic mistake. It is slower and it does not make anything more deterministic.
  • Cross-device reproducibility is not guaranteed. Same seed on the same device reproduces; CPU versus GPU may not, and neither may two dpnp releases.
  • dpnp has no binary save. Persisting a draw goes through numpy.save(dpnp.asnumpy(...)); see dpnp-io.
  • Coverage claims expire. Any list of supported or unsupported distributions describes one release. Check dir(dpnp.random) and the documentation.
  • Not covered: parallel independent streams, counter-based generator state, and the Generator/default_rng object API.

References

FileLoad it when
references/official-sources.mdyou need the distributions a specific dpnp release implements, the oneMKL generator behind them, or NumPy's own generator semantics to explain a difference

Two questions here should not be answered from memory: which distributions the installed release implements and which generator oneMKL uses for a given call, which is what makes a cross-library difference explainable instead of suspicious.

Mitgelieferte Dateien

Das Modell liest diese Dateien bei Bedarf, während der Skill geladen ist. Sie werden als lesbare Dateien bereitgestellt und niemals ausgeführt.

Häufig gestellte Fragen

Was macht der KI-Skill Dpnp Random?

Random number generation with dpnp on Intel CPUs and GPUs, backed by oneMKL. Use when NumPy random calls move to dpnp, when a seeded dpnp run does not reproduce a NumPy sequence, when a distribution turns out not to be implemented, when results have to be reproducible across machines, or when random data feeds a training or augmentation loop. Covers the supported distributions, what seeding does and does not guarantee, the host fallback, and where to generate data so it does not bounce between host and device.

Warum Dpnp Random in TypingMind nutzen?

Weil Sie den Skill einmal installieren und mit jedem Modell verwenden können. Dpnp Random besteht aus reinem Markdown statt aus anbieterspezifischem Code. So funktioniert derselbe Skill mit GPT-5, Claude, Gemini, Grok oder einem lokalen Modell – und Sie können das Modell mitten im Chat wechseln, ohne dass der Skill seine Funktion verliert. TypingMind verwendet Ihre eigenen API-Schlüssel. Sie bezahlen die Anbieter daher direkt statt über ein Abonnement pro Nutzerplatz, und Ihre Skills und Chats bleiben in Ihrem eigenen Speicher.

Wie installiere ich Dpnp Random in TypingMind?

Öffnen Sie in TypingMind Plugins → Skills → Von GitHub installieren und fügen Sie https://github.com/intel/skills/tree/main/skills/dpnp-random ein. TypingMind liest die Datei SKILL.md, bündelt die zugehörigen Dateien und installiert alles als Skill, den Sie für jeden Chat einzeln aktivieren können.

Welche KI-Modelle können Dpnp Random nutzen?

Jedes Modell, das Sie in TypingMind verbinden. KI-Skills bestehen aus reinen Markdown-Anweisungen statt aus anbieterspezifischem Code. Daher können GPT, Claude, Gemini, Grok und lokale Modelle diesen Skill laden, wenn eine Anfrage dazu passt.

Wie viele KI-Modelle kann ich mit Dpnp Random verwenden?

So viele Sie möchten. Solange ein Modell Skills unterstützt, können Sie Dpnp Random damit verwenden – GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama und weitere – alles in TypingMind mit Ihren eigenen API-Schlüsseln.

Ist der KI-Skill Dpnp Random kostenlos?

Ja. Der Skill wird von intel auf GitHub unter der Lizenz Apache-2.0 veröffentlicht. Sie bezahlen nur Ihren eigenen KI-Anbieter für die verwendeten Token.

Was sind KI-Skills?

Ein KI-Skill ist ein wiederverwendbares Anweisungspaket, das einem KI-Modell vermittelt, wie es eine bestimmte Aufgabe erledigt. Es folgt dem offenen Format Agent Skills: eine Datei namens SKILL.md mit einem Namen und einer Beschreibung sowie allen Skripten, Vorlagen oder Referenzdateien, die das Modell möglicherweise benötigt. Das Modell liest die Anweisungen nur, wenn Ihre Anfrage zum Skill passt. Ein installierter Skill verursacht daher erst Kosten, wenn er verwendet wird.

Wie unterscheiden sich KI-Skills von Plugins oder MCP-Servern?

Ein Plugin oder MCP-Server stellt einem Modell neue aufrufbare Tools bereit – Code, der auf einem System ausgeführt wird und ein Ergebnis zurückgibt. Ein KI-Skill vermittelt dem Modell stattdessen Wissen und Vorgehensweisen: wie es eine Aufgabe angeht, welche Schritte es befolgt und wie eine gute Ausgabe aussieht. Skills bestehen aus reinem Markdown und benötigen daher weder Server noch API-Schlüssel oder Laufzeitumgebung. Sie funktionieren mit jedem Modell.

Alle

Jetzt eigenen KI-Arbeitsbereich einrichten

Abonnieren Sie unseren Newsletter und erfahren Sie mehr über neue Funktionen und kommende Gewinnspiele 👇