Λογότυπο Dpnp Memory

Dpnp Memory

Οργανισμός
intel
dpnp-memory

Device memory for dpnp arrays on Intel CPUs and GPUs: USM allocation kinds, checking which device and queue an array lives on with dpctl, reusing an output buffer inside a loop, chunking an in-memory workload that is larger than the device, and tools that report device memory use. Use when a dpnp script grows in memory until it fails, when an array lands on a device other than the one expected, or when a loop allocates a new array every iteration. Not for reading or writing files (dpnp-io).

Επισκόπηση

Εκδότηςintel
Αποθετήριοskills
Όνομα δεξιότηταςdpnp-memory
Αστέρια
31
Forks
14
Συνοδευτικά αρχεία
2
Άδεια χρήσηςApache-2.0
Σύνδεσμοι
  • Οδηγίες σε Markdown

    Ένα αρχείο SKILL.md που το μοντέλο φορτώνει όταν χρειάζεται, ώστε να καταναλώνει token μόνο όταν ένα αίτημα είναι πράγματι σχετικό.

  • Λειτουργεί με οποιοδήποτε LLM

    Οι δεξιότητες AI είναι απλό Markdown, όχι κώδικας για συγκεκριμένο πάροχο, επομένως αυτή η δεξιότητα λειτουργεί με GPT, Claude, Gemini, Grok ή ένα τοπικό μοντέλο.

  • 2 συνοδευτικά αρχεία

    Σενάρια, πρότυπα και υλικό αναφοράς που μπορεί να διαβάζει το μοντέλο καθώς εργάζεται. Τα αρχεία είναι μόνο για ανάγνωση και δεν εκτελούνται ποτέ.

  • Ανοιχτού κώδικα

    Δημοσιεύτηκε από intel στο GitHub. Διαβάστε το πηγαίο περιεχόμενο πριν εγκαταστήσετε τη δεξιότητα.

Εγκατάσταση

Εγκαταστήστε τη δεξιότητα AI Dpnp Memory στο TypingMind για να τη χρησιμοποιείτε με οποιοδήποτε LLM ή προσθέστε τη σε άλλον πράκτορα AI που διαβάζει αρχεία SKILL.md.

1

Εγκατάσταση στο TypingMind

Το TypingMind εγκαθιστά μια δεξιότητα απευθείας από τον φάκελό της στο GitHub — διαβάζει το SKILL.md, συγκεντρώνει τα συνοδευτικά αρχεία σε πακέτο και αποθηκεύει το αποτέλεσμα τοπικά.

  1. Ανοίξτε την εφαρμογή και μεταβείτε στα Πρόσθετα → Δεξιότητες.
  2. Επιλέξτε «Εγκατάσταση από GitHub».
  3. Επικολλήστε το παρακάτω URL του φακέλου της δεξιότητας και επιβεβαιώστε.
    https://github.com/intel/skills/tree/main/skills/dpnp-memory
  4. Ενεργοποιήστε τη δεξιότητα σε κάθε συνομιλία όπου θέλετε να είναι διαθέσιμη.
Πρόσθετα → Δεξιότητες → Νέα δεξιότητα → Από URL του GitHub, έπειτα επικολλήστε το URL του φακέλου και πατήστε «Συνέχεια».
2

Εγκατάσταση σε άλλον πράκτορα AI

Κάθε πράκτορας AI που διαβάζει τη μορφή 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-memory .claude/skills/dpnp-memory
Επανεκκινήστε το Claude Code μετά την αντιγραφή, ώστε να εντοπίσει τη νέα δεξιότητα.

Χρησιμοποιήστε τη στο TypingMind

Ενεργοποιήστε τη δεξιότητα Dpnp Memory σε οποιαδήποτε συνομιλία στο TypingMind και το μοντέλο αναλαμβάνει τα υπόλοιπα. Το όνομα και η περιγραφή της περιλαμβάνονται στην προτροπή συστήματος και, μόλις προκύψει ένα σχετικό αίτημα, το μοντέλο φορτώνει μόνο του τις πλήρεις οδηγίες — δεν χρειάζεται ποτέ να την καλείτε χειροκίνητα και δεν καταναλώνει token μέχρι να χρησιμοποιηθεί πραγματικά.

Το μοντέλο φορτώνει αυτόματα τη δεξιότητα Dpnp Memory μόλις λάβει ένα σχετικό αίτημα.

Λειτουργεί με οποιοδήποτε μοντέλο AI

Οι δεξιότητες AI είναι απλές οδηγίες Markdown και όχι κώδικας για συγκεκριμένο πάροχο, οπότε η δεξιότητα Dpnp Memory δεν περιορίζεται στο μοντέλο για το οποίο γράφτηκε. Εγκαταστήστε τη μία φορά στο TypingMind και χρησιμοποιήστε τη με GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama ή ένα τοπικό μοντέλο που εκτελείτε εσείς — πάντα με τα δικά σας κλειδιά API.

  • Φόρτωση μόνο όταν χρειάζεται

    Η προτροπή συστήματος περιλαμβάνει μόνο το όνομα και την περιγραφή. Οι οδηγίες ανακτώνται με το πρώτο σχετικό αίτημα, οπότε μια δεξιότητα που δεν χρησιμοποιείται δεν έχει κόστος.

  • Αλλάξτε μοντέλα κατά τη συνομιλία

    Επειδή η δεξιότητα αποτελείται από οδηγίες και όχι από κώδικα, η αλλαγή μοντέλου δεν επηρεάζει τη λειτουργία της — το επόμενο μοντέλο διαβάζει το ίδιο αρχείο SKILL.md.

Οδηγίες δεξιότητας

Αυτό είναι το περιεχόμενο του αρχείου SKILL.md που φορτώνει το μοντέλο. Διαβάστε το πριν από την εγκατάσταση — μια δεξιότητα αποτελείται από οδηγίες που θα ακολουθήσει το μοντέλο σας.

dpnp memory and device placement

Purpose

Answers where a dpnp array lives, how much room the device has, and how to keep a long-running script from filling it. dpnp arrays are allocated in SYCL unified shared memory on a device, not on the CPU heap the way NumPy arrays are, so the questions that matter are different: which device, whose queue, and when the allocation is released.

Prefer this skill over guessing from symptoms — a script that slows down over hours, an out-of-memory error, or a GPU that turns out to have been a CPU all along are all answered by reading state the runtime already exposes.

When to Use This Skill

Use this skill when:

  • Memory use climbs over the life of a script or a notebook session.
  • A dataset is larger than the device and has to be processed in pieces.
  • The user needs to confirm which device or queue an array is on.
  • A tight loop allocates a new array per iteration.
  • The user asks how to see device memory use from outside Python.

Do not use this skill for host-side NumPy memory questions, for file I/O (that is dpnp-io), or to decide whether dpnp is worth using at all.

Quick Start

python
import dpnp

arr = dpnp.arange(1000)
print(arr.sycl_device)                                  # e.g. level_zero:gpu:0
print(arr.sycl_device.name)                             # human-readable name
print(arr.sycl_device.global_mem_size / 1e9, "GB")      # capacity, not free space

global_mem_size is the total the device reports. There is no dpnp API for free memory — that comes from the tools in Gotchas.

Implementation Guide

  1. Read the placement before changing anything. Every array carries sycl_device and sycl_queue; dpctl.get_devices() lists what is visible. Filter strings are backend:device_type:index, so level_zero:gpu:0 and opencl:cpu:0 name specific devices. Level Zero is the lower-overhead backend for Intel GPUs.

    python
    import dpctl
    
    for device in dpctl.get_devices():
        print(device.filter_string, device.name)
  2. Target a device explicitly when the default is wrong. dpnp picks a default device at import time using the SYCL default selector, which scores the visible devices — it is not "the first GPU". Pass device= or sycl_queue= rather than relying on it:

    python
    gpu = dpctl.SyclDevice("level_zero:gpu:0")
    arr = dpnp.arange(1000, device=gpu)
    
    queue = dpctl.SyclQueue(gpu)
    shared = dpnp.arange(1000, sycl_queue=queue)
  3. Reuse the output buffer in loops. Universal functions take out=, which writes into an existing allocation instead of making one:

    python
    a = dpnp.arange(10000, dtype=dpnp.float64)
    b = dpnp.arange(10000, dtype=dpnp.float64)
    result = dpnp.empty(10000, dtype=dpnp.float64)   # allocate once
    
    for _ in range(1000):
        dpnp.add(a, b, out=result)                   # no new allocation

    Use dpnp.empty() rather than dpnp.zeros() when the initial values are overwritten anyway, and pre-allocate the output of dpnp.matmul(A, B, out=C) the same way.

  4. Keep conversions out of the loop body. dpnp.asnumpy() copies device to host and dpnp.array() copies host to device. Calling a NumPy function on a dpnp array, or mixing the two in one expression, does the same thing implicitly. Hoist the conversion above the loop.

  5. Chunk a workload that does not fit. Size each chunk so the input and the intermediates together stay under the device capacity — roughly half to two thirds of it is a workable starting point — then release the arrays before the next iteration:

    python
    import gc
    import numpy
    import dpnp
    
    chunk = 10_000_000
    for start in range(0, 100_000_000, chunk):
        host = numpy.load(f"data_chunk_{start}.npy")
        device_array = dpnp.array(host)
        total = dpnp.sum(device_array ** 2)
        numpy.save(f"result_{start}.npy", dpnp.asnumpy(total))
        del device_array, total, host
        gc.collect()
  6. Watch the device while it runs rather than reasoning about it afterwards: xpu-smi dump -m 1 on data center GPUs, intel_gpu_top on client GPUs, clinfo for OpenCL limits, ze_info for Level Zero. Steadily climbing memory is the signature of a leak.

Performance

No measured numbers ship with this skill. Whether pre-allocation or chunking is worth it depends on array size, device, and driver, so measure the specific case:

  • Pre-allocation matters most for small arrays in loops with many iterations, where allocation is a large share of the work. For large arrays the allocation cost is amortized over the compute.
  • Chunking trades memory for repeated allocation and transfer. If disk I/O dominates, that trade is invisible; if compute dominates, it is not.
  • Warm up before timing anything: the first call on a new shape includes compilation.

Gotchas & Limitations

  • del does not free device memory immediately. It drops a reference. The allocation goes back when the object is collected, and in a notebook an output cell can hold the last reference. gc.collect() encourages collection; it does not guarantee the allocator returns the memory at that instant.
  • There is no memory_summary(). No device memory accounting API is exposed at the time of writing — global_mem_size is capacity, and free memory comes from xpu-smi or intel_gpu_top. SYCL_UR_TRACE=1 traces allocations (verbose; it replaced SYCL_PI_TRACE).
  • Integrated and discrete devices are not comparable. An integrated GPU shares host RAM; a discrete one has its own. The same chunk size can fit on one and not the other.
  • A leak looks like a slowdown first. Device memory fills, then the run either falls back or fails. If a script degrades over hours, check memory before profiling compute.
  • Not covered: multi-process or multi-device sharing of one allocation, and USM allocation kinds (device, host, shared) beyond the default.

References

FileLoad it when
references/official-sources.mdyou need the current dpctl device or queue API, the USM allocation kinds, or which release added a property — memory APIs move between releases and must not be answered from memory

Two things here should never be answered from memory: which dpctl properties exist in the installed version, and how much memory the device actually has free. The first is in the documentation, the second only in the running system.

Συνοδευτικά αρχεία

Το μοντέλο τα διαβάζει όποτε χρειάζεται, όσο η δεξιότητα είναι φορτωμένη. Διατίθενται ως αρχεία για ανάγνωση και δεν εκτελούνται ποτέ.

Συχνές ερωτήσεις

Τι κάνει η δεξιότητα AI Dpnp Memory;

Device memory for dpnp arrays on Intel CPUs and GPUs: USM allocation kinds, checking which device and queue an array lives on with dpctl, reusing an output buffer inside a loop, chunking an in-memory workload that is larger than the device, and tools that report device memory use. Use when a dpnp script grows in memory until it fails, when an array lands on a device other than the one expected, or when a loop allocates a new array every iteration. Not for reading or writing files (dpnp-io).

Γιατί να χρησιμοποιήσετε τη δεξιότητα Dpnp Memory στο TypingMind;

Επειδή την εγκαθιστάτε μία φορά και τη χρησιμοποιείτε με οποιοδήποτε μοντέλο. Η Dpnp Memory είναι απλό Markdown και όχι κώδικας ειδικά για κάποιον πάροχο, επομένως η ίδια δεξιότητα λειτουργεί με GPT-5, Claude, Gemini, Grok ή ένα τοπικό μοντέλο — και μπορείτε να αλλάξετε μοντέλο κατά τη διάρκεια της συνομιλίας χωρίς να διακοπεί η λειτουργία της. Το TypingMind λειτουργεί με τα δικά σας κλειδιά API, οπότε πληρώνετε απευθείας τους παρόχους αντί για συνδρομή ανά θέση χρήστη, ενώ οι δεξιότητες και οι συνομιλίες σας παραμένουν στον δικό σας χώρο αποθήκευσης.

Πώς εγκαθιστώ τη Dpnp Memory στο TypingMind;

Στο TypingMind, ανοίξτε Πρόσθετα → Δεξιότητες → Εγκατάσταση από το GitHub και επικολλήστε το https://github.com/intel/skills/tree/main/skills/dpnp-memory. Το TypingMind διαβάζει το αρχείο SKILL.md, συγκεντρώνει τα συνοδευτικά αρχεία και εγκαθιστά τη δεξιότητα, την οποία μπορείτε να ενεργοποιείτε ανά συνομιλία.

Ποια μοντέλα AI μπορούν να χρησιμοποιήσουν τη δεξιότητα Dpnp Memory;

Οποιοδήποτε μοντέλο συνδέετε στο TypingMind. Οι δεξιότητες AI είναι απλές οδηγίες Markdown και όχι κώδικας ειδικά για κάποιον πάροχο, επομένως τα GPT, Claude, Gemini, Grok και τα τοπικά μοντέλα μπορούν όλα να φορτώσουν αυτή τη δεξιότητα όταν ένα αίτημα αντιστοιχεί σε αυτή.

Με πόσα μοντέλα AI μπορώ να χρησιμοποιήσω τη Dpnp Memory;

Με όσα θέλετε. Εφόσον ένα μοντέλο υποστηρίζει δεξιότητες, μπορείτε να χρησιμοποιήσετε τη Dpnp Memory με αυτό — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama και άλλα — όλα στο TypingMind με τα δικά σας κλειδιά API.

Είναι δωρεάν η δεξιότητα AI Dpnp Memory;

Ναι. Δημοσιεύεται στο GitHub από τον χρήστη intel με την άδεια χρήσης Apache-2.0. Πληρώνετε μόνο τον δικό σας πάροχο AI για τα token που χρησιμοποιείτε.

Τι είναι οι δεξιότητες AI;

Μια δεξιότητα AI είναι ένα επαναχρησιμοποιήσιμο πακέτο οδηγιών που διδάσκει σε ένα μοντέλο AI πώς να εκτελεί μια συγκεκριμένη εργασία. Ακολουθεί την ανοιχτή μορφή Agent Skills: ένα αρχείο SKILL.md με όνομα και περιγραφή, μαζί με τυχόν σενάρια κώδικα, πρότυπα ή αρχεία αναφοράς που μπορεί να χρειαστεί το μοντέλο. Το μοντέλο διαβάζει τις οδηγίες μόνο όταν το αίτημά σας αντιστοιχεί στη δεξιότητα, οπότε μια εγκατεστημένη δεξιότητα δεν κοστίζει τίποτα μέχρι να χρησιμοποιηθεί.

Σε τι διαφέρουν οι δεξιότητες AI από τα πρόσθετα ή τους συνδέσμους MCP;

Ένα πρόσθετο ή ένας σύνδεσμος MCP παρέχει στο μοντέλο νέα εργαλεία που μπορεί να καλέσει — κώδικα που εκτελείται κάπου και επιστρέφει ένα αποτέλεσμα. Μια δεξιότητα AI παρέχει αντί γι’ αυτό γνώσεις και διαδικασίες στο μοντέλο: πώς να προσεγγίσει μια εργασία, ποια βήματα να ακολουθήσει και ποια χαρακτηριστικά έχει ένα καλό αποτέλεσμα. Οι δεξιότητες είναι απλό Markdown, επομένως δεν χρειάζονται διακομιστή, κλειδί API ή περιβάλλον εκτέλεσης και λειτουργούν με οποιοδήποτε μοντέλο.

Προβολή όλων

Στήστε δικό σας χώρο εργασίας AI τώρα

Εγγραφείτε στο ενημερωτικό μας δελτίο για να ενημερώνεστε για νέες λειτουργίες και μελλοντικές κληρώσεις δώρων 👇