Skip to main content

numba-inspector

Visualize and Debug Numba compiled code in Jupyter

Quickstart

Installation

Install the package:

pip install numba-inspector

%%numba magic command

%load_ext numba_inspector
%%numba --bytecode

from numba import njit

@njit
def func(x,y):
    if x:
        x=x+1
        if y:
            y=y+1
        else:
            y=y-1
    else:
        x=x-1
        if y:
            y=y+1
        else:
            y=y-1
    return x+y

func(1,2)

View the bytecode of a jitted function (CPUDispatcher object)

Install the cudatoolkit:

conda install cudatoolkit
%%numba --ptx

from numba import cuda
import numpy as np

@cuda.jit(lineinfo=True)
def increment_by_one(an_array):
    # Thread id in a 1D block
    tx = cuda.threadIdx.x
    # Block id in a 1D grid
    ty = cuda.blockIdx.x
    # Block width, i.e. number of threads per block
    bw = cuda.blockDim.x
    # Compute flattened index inside the array
    pos = tx + ty * bw
    if pos < an_array.size:  # Check array boundaries
        an_array[pos] += 1
        
a = np.arange(4096,dtype=np.float32)
d_a = cuda.to_device(a)
blocks = 32
threads = 128
increment_by_one[blocks, threads](d_a)
cuda.synchronize()
d_a.copy_to_host()

View the PTX of CUDA kernel (CPUDispatcher object example)

Metadata

Release files for numba-inspector 0.0.5

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

Source distribution (sdist)

Source distribution for numba-inspector 0.0.5
File Size Uploaded Provenance Actions
numba_inspector-0.0.5.tar.gz 11.7 kB Without provenance Details for numba_inspector-0.0.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for numba-inspector 0.0.5
File Interpreter ABI Platform Actions
numba_inspector-0.0.5-py3-none-any.whl Python 3 none any Details for numba_inspector-0.0.5-py3-none-any.whl

Total release size: 19.4 kB

Release files / numba_inspector-0.0.5.tar.gz

Download URL numba_inspector-0.0.5.tar.gz
Size 11.7 kB
Tags Source
SHA-256 checksum
How to use checksums
1d0e176663d438a0505d40e1754f37466877533758948bad54b50622434d4418
BLAKE2b-256 checksum
How to use checksums
8fde64e2ef9a8fbd9da070f7b2d5dce1366d2df37210f0ab4a69eba3974a1f37
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.5.1 CPython/3.11.4 Linux/5.15.90.1-microsoft-standard-WSL2

Release files / numba_inspector-0.0.5-py3-none-any.whl

Download URL numba_inspector-0.0.5-py3-none-any.whl
Size 7.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fa9009d10d4b855e442e9fd289aef0177574139c1e30e7dd87a1210da5bf8c8e
BLAKE2b-256 checksum
How to use checksums
7dec97ff86c8687af75ba6ec21236840ccbd4be5feb355d928ccdc03a06ab48d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.5.1 CPython/3.11.4 Linux/5.15.90.1-microsoft-standard-WSL2

Security for numba-inspector 0.0.5

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.

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