Skip to main content

npynuma

NUMA node allocation for NumPy arrays on Linux

Install System Requirements

# Ubuntu/Debian
sudo apt install libnuma-dev

# Fedora/CentOS
sudo dnf install numactl-devel

# Python package
git clone https://github.com/xsgeng/npynuma
cd npynuma
pip install .

pip install npynuma # not yet

Quick Start

import numpy as np
from npynuma import NumaPolicy

with NumaPolicy(node=1):  # Allocate on NUMA node 1
    large_array = np.empty(10_000_000)  # 80MB array on node 1

# Works with existing numpy functions
with NumaPolicy(node=0):
    random_data = np.random.normal(size=1_000_000)

Notes

  • Requires Linux NUMA system (numactl installed)
  • Node numbers must exist on your system

Thread Safety

⚠️ Not thread-safe - The NUMA policy context is global to the process. Avoid using NumaPolicy contexts concurrently in:

  • Multithreaded applications
  • Async frameworks
  • Any parallel code sharing NumPy allocations

Metadata

Release files for npynuma 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for npynuma 0.1.0
File Size Uploaded
npynuma-0.1.0.tar.gz 5.0 kB Details

Release files / npynuma-0.1.0.tar.gz

Download URL npynuma-0.1.0.tar.gz
Size 5.0 kB
Tags Source
SHA-256 checksum
How to use checksums
10e6528fbdf6f9df4d53de0f150a8376ba5f96f95b38e255ab60d90f21dee40c
BLAKE2b-256 checksum
How to use checksums
9f1c75a80a16e2c8e12cb4d0dc6d0aafc04d6ff93388fe48238ddbdd339d7362
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 15, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page