Skip to main content

PTO kernels

Project description

pto-kernels

A collection of high-performance custom kernels for Ascend NPUs, built on top of pto-isa — the Parallel Tile Operation virtual instruction set architecture designed by Ascend CANN.

PTO focuses on tile-level operations, enabling efficient, composable kernel development targeting Huawei's Ascend AI processors.


Prerequisites

  • A configured torch-npu environment
  • Ascend toolkit installed at /usr/local/Ascend/ascend-toolkit

Run the one-time setup before building:

make setup_once

Install repository using pip

The repository is "pip installable", i.e.,

export CMAKE_GENERATOR="Unix Makefiles" && pip install -v git+https://github.com/huawei-csl/pto-kernels.git

Build

source /usr/local/Ascend/ascend-toolkit/set_env.sh
pip3 install -r requirements.txt
make wheel

This produces an installable Python wheel:

pto_kernels-X.Y.Z-*.whl

Installation

pip install --force-reinstall pto_kernels-*.whl

Testing

make test

Repository Structure

pto-kernels/
├── csrc/                  # C++ kernel source files
├── python/pto_kernels/    # Python bindings and utilities
├── examples/jit_cpp/      # JIT compilation examples
├── tests/                 # Test suite
├── scripts/               # Helper scripts
├── doxygen/               # API documentation config
└── CMakeLists.txt         # CMake build configuration

Contributing

Contributions are welcome! Please read CONTRIBUTING.md before opening a pull request.


License

BSD-3-Clause-Clear — see LICENSE for details.

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.

pto_kernels-0.1.5-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_27_aarch64.whl (3.1 MB view details)

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

pto_kernels-0.1.5-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_27_x86_64.whl (4.6 MB view details)

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

pto_kernels-0.1.5-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_27_aarch64.whl (4.6 MB view details)

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

pto_kernels-0.1.5-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_27_x86_64.whl (4.6 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64manylinux: glibc 2.27+ x86-64

pto_kernels-0.1.5-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_27_aarch64.whl (4.6 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ ARM64manylinux: glibc 2.27+ ARM64

File details

Details for the file pto_kernels-0.1.5-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_27_aarch64.whl.

File metadata

File hashes

Hashes for pto_kernels-0.1.5-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_27_aarch64.whl
Algorithm Hash digest
SHA256 dfcfe7b34ef0a5e216260186f4fa40c52fc8dd7aa726bbddb285f7af12bb2047
MD5 742fecc7c6d460361b6a0269fb2e9e50
BLAKE2b-256 a34b93a3822be1932060cde980adb9dfc13bff78f70a37f45198071267a3a6af

See more details on using hashes here.

File details

Details for the file pto_kernels-0.1.5-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_27_x86_64.whl.

File metadata

File hashes

Hashes for pto_kernels-0.1.5-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_27_x86_64.whl
Algorithm Hash digest
SHA256 7344ca5c69c904b41a179b6bc97dd15c45cac3f853bb21b6b6dbab324cfe64fe
MD5 d7f6c9ae310ff093bf6b421ea9aae273
BLAKE2b-256 9c1b1b3d7e18424b8c807d4c28e5bd871e7d86923b0d372cbd5b6d2b213abbb1

See more details on using hashes here.

File details

Details for the file pto_kernels-0.1.5-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_27_aarch64.whl.

File metadata

File hashes

Hashes for pto_kernels-0.1.5-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_27_aarch64.whl
Algorithm Hash digest
SHA256 3dcfbc57aca4c3e182268f94614b5644295d0b133c26cdc50f8d483da94a8a04
MD5 c6b47401fa9bd8e40753ab23cd9eedd0
BLAKE2b-256 5a92a3cf20a80375210131214794cd0c5230ce06e5b4289c7fbf69b84d0e2d7a

See more details on using hashes here.

File details

Details for the file pto_kernels-0.1.5-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_27_x86_64.whl.

File metadata

File hashes

Hashes for pto_kernels-0.1.5-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_27_x86_64.whl
Algorithm Hash digest
SHA256 686e440969eecca6830d167262d9c00e96b5cb7ce975f6a79261a9fb75451663
MD5 6909f898a1537eefeeed65a3eb38c917
BLAKE2b-256 13a75633da07937950386d74a8343c630caf51a278b0c87bd557085a27ebbed5

See more details on using hashes here.

File details

Details for the file pto_kernels-0.1.5-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_27_aarch64.whl.

File metadata

File hashes

Hashes for pto_kernels-0.1.5-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_27_aarch64.whl
Algorithm Hash digest
SHA256 40ed418fafb61df818207a131fa61b5331f809e0f399b3e872322486ca2c5f73
MD5 3f5758ad699d7bac80b122d22133bc40
BLAKE2b-256 415e8960abdb3e2ac0bd22211700bdee7c4b6e369bfbd8f6da001b9fdf7b93f8

See more details on using hashes here.

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