Skip to main content

Generate fused and vectorizable kernels for sparse tensor programs on CPUs and GPUs

Project description

VCSparse: Generate fused and vectorizable kernels for sparse tensor programs on CPUs and GPUs. An web tool is available to try VCSparse online: https://tongzhou80.github.io/vcsparse-web/index.html.

Installation

pip install vcsparse

Quick introduction

To compile a function with vcsparse, all you need to do is to add index notation to the function arguments, and decorate the function with @vcsparse.compile. Here's an example:

@vcsparse.compile(full_opt=True)
def mul_then_rowwise_sum(A: Tensor('i,j', 'csr'), B: Tensor('i,j', 'csr')):
    return (A * B).sum(1)

The option full_opt=True will enable all optimization passes.

Project details


Download files

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

Source Distribution

vcsparse-0.1.0.tar.gz (17.4 kB view details)

Uploaded Source

Built Distribution

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

vcsparse-0.1.0-py3-none-any.whl (44.9 kB view details)

Uploaded Python 3

File details

Details for the file vcsparse-0.1.0.tar.gz.

File metadata

  • Download URL: vcsparse-0.1.0.tar.gz
  • Upload date:
  • Size: 17.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for vcsparse-0.1.0.tar.gz
Algorithm Hash digest
SHA256 caca812beebff89fb173fc872d84c48690c9205036396919e1377f7e96235ce0
MD5 34b89702618b8923c85f19a3a71e70e7
BLAKE2b-256 6be475adef455ee1f4f7e52d5a7b2621495869a189d11a9d8855a1306878dfb0

See more details on using hashes here.

File details

Details for the file vcsparse-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: vcsparse-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 44.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for vcsparse-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3f1d0a03a75f1680bd5b3b69a2f41b397a8631a14bf640ae5cb7cfc5f3c951b7
MD5 2510aa83fe5635855657a08878aa0867
BLAKE2b-256 2953862f13e44e0567109684f1fa068b5baf2175e907811aab06c26d492fb6b8

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