Skip to main content

numba-cuda-mlir Python Compiler

Project description

Numba-CUDA-MLIR

Numba-CUDA-MLIR provides a programming model similar to CUDA C++ in Python. It is evolved from Numba-CUDA, and is intended to be compatible with Numba-CUDA kernels.

Numba-CUDA-MLIR aims to interoperate well with existing programming models whilst also allowing experts sufficient control over code generation.

Quick Start

Install with pip:

pip install numba-cuda-mlir[cu13]  # or [cu12] if using CUDA 12

Writing and executing a simple vector add kernel:

import numpy as np
from numba_cuda_mlir import cuda

@cuda.jit
def vector_add(a, b, out):
    i = cuda.grid(1)
    if i < out.shape[0]:
        out[i] = a[i] + b[i]

n = 1_000_000
a = np.ones(n, dtype=np.float32)
b = np.ones(n, dtype=np.float32)
out = np.zeros(n, dtype=np.float32)

threads_per_block = 256
blocks = (n + threads_per_block - 1) // threads_per_block
vector_add[blocks, threads_per_block](a, b, out)

Migration from Numba / Numba-CUDA

Change imports to use the numba_cuda_mlir.cuda package instead of numba.cuda. For example:

from numba import cuda

becomes:

from numba_cuda_mlir import cuda

For the majority of code using Numba-CUDA, this should be a sufficient change to enable the use of Numba-CUDA-MLIR. For code using the extension APIs, modifications will be required as Numba-CUDA-MLIR uses MLIR in its code generation process instead of LLVM IR. See the Migration Guidance in the documentation for further details.

Installation Requirements

  • Python >= 3.11, with:
    • The cuda.core and cuda-bindings packages
    • NumPy >= 1.22
  • CUDA Toolkit components (CUDA Runtime, NVCC, NVRTC, nvJitLink, and CCCL) installed via pip or a system package manager (Linux).
  • NVIDIA GPU with Compute Capability 7.0 or greater and a compatible driver:
    • >= r525 for CUDA 12.x
    • >= r580 for CUDA 13.x

Installation guidance

For full details of installation methods including from packages and building from source and testing, please see INSTALL.md.

Contributing to Numba-CUDA-MLIR

See the Contribution Guidelines for information on how to set up a development environment and follow the contribution process.

Benchmarks

A small suite of benchmarks can be executed from the source repository by running:

pytest tests/benchmarks/ --benchmark -s

Licensing

Numba-CUDA-MLIR is distributed under the Apache License 2.0.

It incorporates the following third-party projects, each retained under its original license:

  1. numba-cudaBSD 2-Clause License
  2. cloudpickleBSD 3-Clause License
  3. appdirsMIT License
  4. LLVM Project / EUDSLApache License 2.0 WITH LLVM-exception

See NOTICE for the full attribution map and per-component locations in this repository, and THIRD-PARTY-LICENSES for the verbatim upstream license texts.

Contributions are accepted under the terms described in CONTRIBUTING.md.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

numba_cuda_mlir-0.4.0-cp314-cp314t-win_amd64.whl (48.6 MB view details)

Uploaded CPython 3.14tWindows x86-64

numba_cuda_mlir-0.4.0-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (85.4 MB view details)

Uploaded CPython 3.14tmanylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

numba_cuda_mlir-0.4.0-cp314-cp314t-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl (82.3 MB view details)

Uploaded CPython 3.14tmanylinux: glibc 2.27+ ARM64manylinux: glibc 2.28+ ARM64

numba_cuda_mlir-0.4.0-cp314-cp314-win_amd64.whl (48.5 MB view details)

Uploaded CPython 3.14Windows x86-64

numba_cuda_mlir-0.4.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (85.4 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

numba_cuda_mlir-0.4.0-cp314-cp314-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl (82.3 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.27+ ARM64manylinux: glibc 2.28+ ARM64

numba_cuda_mlir-0.4.0-cp313-cp313-win_amd64.whl (47.1 MB view details)

Uploaded CPython 3.13Windows x86-64

numba_cuda_mlir-0.4.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (85.4 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

numba_cuda_mlir-0.4.0-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl (82.3 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.27+ ARM64manylinux: glibc 2.28+ ARM64

numba_cuda_mlir-0.4.0-cp312-cp312-win_amd64.whl (47.1 MB view details)

Uploaded CPython 3.12Windows x86-64

numba_cuda_mlir-0.4.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (85.4 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

numba_cuda_mlir-0.4.0-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl (82.3 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.27+ ARM64manylinux: glibc 2.28+ ARM64

numba_cuda_mlir-0.4.0-cp311-cp311-win_amd64.whl (47.1 MB view details)

Uploaded CPython 3.11Windows x86-64

numba_cuda_mlir-0.4.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (85.4 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

numba_cuda_mlir-0.4.0-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl (82.2 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.27+ ARM64manylinux: glibc 2.28+ ARM64

File details

Details for the file numba_cuda_mlir-0.4.0-cp314-cp314t-win_amd64.whl.

File metadata

File hashes

Hashes for numba_cuda_mlir-0.4.0-cp314-cp314t-win_amd64.whl
Algorithm Hash digest
SHA256 ce8b3e6c071e4b828baf06bf6e99af1f23027049d28586f49ba62f57565b747c
MD5 0ef9d0ac044b83d01612774619cb7901
BLAKE2b-256 84d5e1546ab016d559acfda3f171123a232b3590db13069f8b2fce49d2555c0a

See more details on using hashes here.

Provenance

The following attestation bundles were made for numba_cuda_mlir-0.4.0-cp314-cp314t-win_amd64.whl:

Publisher: publish.yaml on NVIDIA/numba-cuda-mlir

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file numba_cuda_mlir-0.4.0-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for numba_cuda_mlir-0.4.0-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 d40b3e0e1f0b1fa947e4a083e587ea2c9a52396c955ae7822750958624be5bc2
MD5 1a7209f5f1b1ee6c392bef1a52c076ee
BLAKE2b-256 eb3cbd731c0585018277ce480ebbef2bcc0f65c6f2b51eff4c8680b02de556d9

See more details on using hashes here.

Provenance

The following attestation bundles were made for numba_cuda_mlir-0.4.0-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: publish.yaml on NVIDIA/numba-cuda-mlir

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file numba_cuda_mlir-0.4.0-cp314-cp314t-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for numba_cuda_mlir-0.4.0-cp314-cp314t-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 d9c481dbe6a0bfc2f8d3bdb5b1ee6fce142667c88fffb970c26b2d7b33b6a541
MD5 c6ada134d1e2564f7a4dc9050b70f69a
BLAKE2b-256 b19016712f7566d35bb86964ca3a29858e6ca2d9e6c75d5f869e56dc6f700001

See more details on using hashes here.

Provenance

The following attestation bundles were made for numba_cuda_mlir-0.4.0-cp314-cp314t-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl:

Publisher: publish.yaml on NVIDIA/numba-cuda-mlir

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file numba_cuda_mlir-0.4.0-cp314-cp314-win_amd64.whl.

File metadata

File hashes

Hashes for numba_cuda_mlir-0.4.0-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 93baa0835761a888bdcc37a8aa989beb1811c121b8f187195b53e13c479cc77f
MD5 5a8a1913f359f1db6f0bef2b9d118434
BLAKE2b-256 fb868dd670fe3c3c1a448f6a793a19223c97385b033687f567fc6a7caa41a74b

See more details on using hashes here.

Provenance

The following attestation bundles were made for numba_cuda_mlir-0.4.0-cp314-cp314-win_amd64.whl:

Publisher: publish.yaml on NVIDIA/numba-cuda-mlir

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file numba_cuda_mlir-0.4.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for numba_cuda_mlir-0.4.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 2e67ed54324fdd9e3bd86872bc4949a1fe96c849cc5640939a7513da6f0f64b4
MD5 6b733e013cd6fe4268dd4596e147979c
BLAKE2b-256 52f6620a144d38e5496a6e8842b837d48885fb532594752194a01f81701d8b91

See more details on using hashes here.

Provenance

The following attestation bundles were made for numba_cuda_mlir-0.4.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: publish.yaml on NVIDIA/numba-cuda-mlir

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file numba_cuda_mlir-0.4.0-cp314-cp314-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for numba_cuda_mlir-0.4.0-cp314-cp314-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 29045ed298dab165c636317a4ab707b8041555be307b39acc4bdef5656774507
MD5 ee5d68cf35803b5a07a5f7d839e3f5e3
BLAKE2b-256 96bc0b74d18ac635dc45dd31b394941f368d978de2fd9503d8a5f81301cd5d46

See more details on using hashes here.

Provenance

The following attestation bundles were made for numba_cuda_mlir-0.4.0-cp314-cp314-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl:

Publisher: publish.yaml on NVIDIA/numba-cuda-mlir

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file numba_cuda_mlir-0.4.0-cp313-cp313-win_amd64.whl.

File metadata

File hashes

Hashes for numba_cuda_mlir-0.4.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 fffb584e3b7248ad3e77127d90dc563425105c271b16c11b63075c8c05efaf83
MD5 fddc46f38850ee7dd6ca1fdbc6a1460e
BLAKE2b-256 f60ab3647f00ca6006b0131b89a6287815edd700bf42d3f13477798318a80087

See more details on using hashes here.

Provenance

The following attestation bundles were made for numba_cuda_mlir-0.4.0-cp313-cp313-win_amd64.whl:

Publisher: publish.yaml on NVIDIA/numba-cuda-mlir

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file numba_cuda_mlir-0.4.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for numba_cuda_mlir-0.4.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 bbd0a93cb5dee2ea701b23508b2bb6d03fcbfa9cdc7eaef211fbeeb1fcde2cdb
MD5 6add17abc5c6e3791ec35bad146ae097
BLAKE2b-256 b04335af900a9c5611aa787ee3b9d1f31d98d8c4b58cb6b00f882c0019aed033

See more details on using hashes here.

Provenance

The following attestation bundles were made for numba_cuda_mlir-0.4.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: publish.yaml on NVIDIA/numba-cuda-mlir

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file numba_cuda_mlir-0.4.0-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for numba_cuda_mlir-0.4.0-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 be5bc6613de7422518fb462dd9ac726b38dd11774c1055867a9107a4d2749b9a
MD5 4fbc1f7e30991f18b1f03ef9b478b087
BLAKE2b-256 9fc811c8c767586980057b1b02c9368f2fd5825190ea25a2cf0ec960216b9223

See more details on using hashes here.

Provenance

The following attestation bundles were made for numba_cuda_mlir-0.4.0-cp313-cp313-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl:

Publisher: publish.yaml on NVIDIA/numba-cuda-mlir

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file numba_cuda_mlir-0.4.0-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for numba_cuda_mlir-0.4.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 6c75188b47085d430232637c96a86d7d3c99c35a8c3bb409c75809bd5503bcb9
MD5 c07564b10050e1fb938a1c1c41d6f1a4
BLAKE2b-256 e2b7e5a892dffdbe03948f7505f55da0bb4aebf77295a19dfd3c03f70e20171c

See more details on using hashes here.

Provenance

The following attestation bundles were made for numba_cuda_mlir-0.4.0-cp312-cp312-win_amd64.whl:

Publisher: publish.yaml on NVIDIA/numba-cuda-mlir

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file numba_cuda_mlir-0.4.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for numba_cuda_mlir-0.4.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 f0c6ed3b354e0af1840e18a352b94b66a885efec097530f4d9c571c89f9cb5b8
MD5 a8526426392770960ac8ed76d75a4e62
BLAKE2b-256 7f0ced333f7f21fff65b85e198b67f0c6eebfbba18028dbb29d8792aff954c39

See more details on using hashes here.

Provenance

The following attestation bundles were made for numba_cuda_mlir-0.4.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: publish.yaml on NVIDIA/numba-cuda-mlir

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file numba_cuda_mlir-0.4.0-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for numba_cuda_mlir-0.4.0-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 c07bfbbead7f4076f0d7652948bd8a63a203379e39c7f2e912cfe6152cdf5b4a
MD5 edee8b27fe86aa7422684b9a6e5b67e1
BLAKE2b-256 5998da65600357e215dfd6a0d24766259af64b16312bde707a08addc3136891d

See more details on using hashes here.

Provenance

The following attestation bundles were made for numba_cuda_mlir-0.4.0-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl:

Publisher: publish.yaml on NVIDIA/numba-cuda-mlir

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file numba_cuda_mlir-0.4.0-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for numba_cuda_mlir-0.4.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 bb54b1cfe1390734d35155a9f4fb3c03eb07371bc30ccb98ea1cf829144cc9cc
MD5 2ce883fe29b9efd2e28cd714017f14c3
BLAKE2b-256 cd1cf62ed837ae08d875a9969bf7672a6f5610661643c2742dc36c0ccc5e536f

See more details on using hashes here.

Provenance

The following attestation bundles were made for numba_cuda_mlir-0.4.0-cp311-cp311-win_amd64.whl:

Publisher: publish.yaml on NVIDIA/numba-cuda-mlir

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file numba_cuda_mlir-0.4.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for numba_cuda_mlir-0.4.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 30775c864690f5a07e3b323e4f8c96470664baca9e31bc5cad2f7f95f3c2725a
MD5 a319ac842acb7112b85e838c9624f1ab
BLAKE2b-256 6b68adb85cd0d8a1e5bcda2a7dc301994183ac8ef59f49585f8bc2b29a8b8b68

See more details on using hashes here.

Provenance

The following attestation bundles were made for numba_cuda_mlir-0.4.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: publish.yaml on NVIDIA/numba-cuda-mlir

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file numba_cuda_mlir-0.4.0-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for numba_cuda_mlir-0.4.0-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 8713dc83b57c19ee5c3af0400372598bcf9c4413f90f7eefbb9fc9f107b30503
MD5 0f1984fa1e00946366e26fbbf2cb3798
BLAKE2b-256 d17cac34a0610bb0ac5364314e951a259e3535c541dae43c0cfede5777ae83be

See more details on using hashes here.

Provenance

The following attestation bundles were made for numba_cuda_mlir-0.4.0-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl:

Publisher: publish.yaml on NVIDIA/numba-cuda-mlir

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page