Skip to main content

Markdown

UNPU (Universal Numerical Processing Unit)

UNPU는 NVIDIA GPU(Triton/CUDA), Intel XPU(Arc/MKL), 그리고 pure CPU(NumPy C-BLAS) 환경을 동적으로 감지하여 최적의 연산 파이프라인으로 실시간 라우팅해 주는 통합 가속 및 메모리 관리 라이브러리입니다.


✨ 핵심 기능

  • 자동 하드웨어 라우팅: NVIDIA CUDA, Intel XPU, CPU(YPU 타일링 연산)를 자동 감지 및 지연 시간 최소화 실행
  • PyTorch & NumPy 교차 연산: torch.Tensor와 numpy.ndarray 입력을 구분 없이 한 번에 가속
  • 통합 메모리 스위프: Context 종료 시 VRAM 캐시 정리는 물론 fasthardware OS 가비지 수거 및 WorkingSet 회수 자동화
  • 실시간 추론 전용 KV Cache: 엣지 디바이스 LLM 및 시계열 추론을 위한 최적화 메모리 버퍼 제공

📦 설치 (Installation)

# 기본 설치
pip install unpu

# Triton 및 외부 메모리 스위퍼 옵션 포함 설치
pip install unpu[all]

🚀 빠른 사용법 (Quick Start)

  1. 기본 매트릭스 연산 (Matrix Multiplication)
import torch
import unpu

# 하드웨어 자동 디바이스 감지 및 Context 진입
with unpu.UNPUContext() as dev:
    print(f"Active Engine: {dev.backend_str}")

    a = torch.randn(512, 1024)
    b = torch.randn(1024, 2048)
    
    # NVIDIA Triton -> Intel XPU -> CPU YPU 순서로 자동 라우팅
    c = unpu.unpu_matmul(a, b)

Context 블록 이탈 시 VRAM 및 CPU WorkingSet 자동 Sweep 수행

  1. NumPy 배열 CPU C-BLAS 가속 (YPU Engine)
import numpy as np
import unpu

a_np = np.random.randn(512, 1024).astype(np.float32)
b_np = np.random.randn(1024, 2048).astype(np.float32)

# NumPy C-Contiguous 레이아웃 변환 및 BLAS 가속 연산
res = unpu.ypu_matmul(a_np, b_np)
  1. PyTorch 가속 레이어 적용
import torch
import torch.nn as nn
import unpu

class EdgeModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.fc = unpu.UNPULinear(1024, 512)

    def forward(self, x):
        return self.fc(x)

📜 License MIT License

Metadata

Release files for unpu 0.1.2

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

Source distribution (sdist)

Source distribution for unpu 0.1.2
File Size Uploaded Provenance Actions
unpu-0.1.2.tar.gz 23.1 kB Without provenance Details for unpu-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for unpu 0.1.2
File Interpreter ABI Platform Actions
unpu-0.1.2-py3-none-any.whl Python 3 none any Details for unpu-0.1.2-py3-none-any.whl

Total release size: 48.0 kB

Release files / unpu-0.1.2.tar.gz

Download URL unpu-0.1.2.tar.gz
Size 23.1 kB
Tags Source
SHA-256 checksum
How to use checksums
c9a65d7249e1f916fbd327eb45977c8cab61e80fce4768901bf6ac327ccc238d
BLAKE2b-256 checksum
How to use checksums
e0f177de64944e569302f83166a14ddf1561affd952904129d3a75fac96391b6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.9

Release files / unpu-0.1.2-py3-none-any.whl

Download URL unpu-0.1.2-py3-none-any.whl
Size 24.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
37371d87ff0360e0362a23a84713bcdcd897d7bdab48b759a48d4a824da3054c
BLAKE2b-256 checksum
How to use checksums
d75e2fa49a6c78c515062090d104cdb1b46f815d34cf1db988e4d5ccda1e6638
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.9

Security for unpu 0.1.2

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files No provenance

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