Skip to content

vonavi/pyascend

Repository files navigation

PyAscend

A lightweight Python wrapper that simplifies copying data to and from the Ascend NPU and launching kernels on it. Currently tested on Ascend 910B4.

Building

The project can be built as a regular Python package, but we also provide an alternative, reproducible build method using Nix flakes. We focus here on the Nix-based workflow.

First, install the Ascend CANN toolkit and add it as a Nix flake input. For example:

$ nix flake lock --override-input ascendcDevkitPath \
      "path:${HOME}/Ascend/ascend-toolkit/8.3.RC1.alpha002/aarch64-linux"

Then, build the project:

$ nix build

Testing

Enter the development environment:

$ nix develop
$ PYTHONPATH=result/lib/python3.12/site-packages:$PYTHONPATH

Inside it, run a test for the built Ascend kernel:

$ pytest result/lib/python3.12/site-packages/pyascend/tests/test_add_custom.py

About

A lightweight Python wrapper for Ascend NPU

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published