Skip to main content

Wave Language for Machine Learning

Project description

Wave: Python Domain-Specific Language for High Performance Machine Learning

Motivation

Wave is a high-level programming language designed to accelerate the development and optimization of machine learning kernels. It aims to dramatically improve kernel author velocity in two critical dimensions:

Implementation Velocity

Wave enables rapid prototyping of new optimization ideas and algorithms through its high-level abstractions and symbolic programming model. Kernel authors can quickly express complex tensor operations and experiment with different optimization strategies without getting bogged down in low-level implementation details.

Performance Velocity

The language is designed to achieve high performance with minimal tuning effort. Through its declarative constraints and hardware-aware abstractions, Wave automatically generates optimized GPU code, allowing kernel authors to focus on algorithmic innovation rather than manual optimization.

Wave is particularly focused on the machine learning domain, with deep integration into the PyTorch ecosystem. This integration enables:

  1. Seamless transition from PyTorch models to optimized GPU kernels
  2. Easy experimentation with new ML algorithms and optimizations
  3. Rapid deployment of custom kernels in production ML pipelines
  4. Direct reuse of PyTorch’s tensor abstractions and operator semantics

The language bridges the gap between high-level ML programming and low-level GPU performance by providing a flexible and expressive programming model that maintains close control over hardware resources while enabling rapid innovation in the ML space.

Core Design Principles

Wave is built around several key design principles that guide its architecture and implementation:

  • Symbolic Programming Model
  • Heavy use of symbolic variables to represent tensor dimensions
  • Symbolic expressions for memory access patterns and layouts
  • Enables compile-time optimization and analysis
  • Provides flexibility in expressing complex tensor operations
  • Separation of Distribution and Computation
  • Clear separation between distribution strategy and computation graph
  • Distribution strategy defined through declarative constraints
  • Computation graph expressed independently of parallelization
  • Enables better optimization and code reuse
  • Dual Programming Models
  • Support for both tile-based and SIMT-based programming models
  • Tile-based model for coarse-grained parallelism
  • SIMT model for fine-grained vector operations
  • Flexible mapping to different GPU architectures
  • Hardware-Aware Abstractions
  • Direct mapping to GPU hardware concepts (workgroups, waves, etc.)
  • Explicit control over memory hierarchy
  • Hardware-specific optimizations (MMA operations, memory layouts)
  • Performance portability across different GPU architectures

For more information, visit the documentation here: https://wave-lang.readthedocs.io/en/latest/wave/wave.html

Quickstart

Wave supports both end users (who want to use Wave kernels in their ML workflows) and developers (who want to contribute to or extend Wave). Follow the relevant guide below to get started quickly.

Prequisites

Before installing Wave, ensure you have the following prerequisites:

  • Python 3.10 or later
  • PyTorch
  • ROCm (for AMD GPU support)
  • A compatible AMD GPU with ROCm support (MI250, MI300, etc.) or CPU

For Users

  1. Install ROCm PyTorch Dependencies

    Before installing Wave, ensure you have the appropriate ROCm-enabled PyTorch dependencies:

    pip install -r pytorch-rocm-requirements.txt
    
  2. Install Wave

    You can then install Wave and its dependencies using pip:

    pip install wave-lang
    
  3. Try the Example Notebook

    To get started, try the examples/jupyter/wave_gemm_example.ipynb notebook.

For Developers

  1. Clone the Repository

    git clone https://github.com/iree-org/wave.git
    cd wave
    
  2. Install Development Dependencies

    If you don't have Rust already installed on your system, install Rust using the following command:

    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
    

    Next, install the python dependencies. It is recommended to use a virtual environment.

    python -m venv .venv
    source .venv/bin/activate
    pip install --upgrade pip
    pip install -r requirements-iree-pinned.txt
    pip install -r pytorch-rocm-requirements.txt
    pip install -r requirements.txt -e .
    

    Note: If you do not have access to Instinct GPUs, you can still install Wave as above but with the CPU version of PyTorch:

    pip install -r pytorch-cpu-requirements.txt
    

    Currently, you can only run lit tests in this mode.

  3. Run Tests

    To verify your setup:

    # Python tests
    pytest -s tests/
    # To run end to end tests, add --run-e2e flag
    
    # Lit tests
    lit lit_tests/ -v
    
  4. Contributing

    Please see CONTRIBUTING.md for guidelines on contributing to Wave.

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.

wave_lang-3.9.1-cp313-cp313-win_amd64.whl (792.9 kB view details)

Uploaded CPython 3.13Windows x86-64

wave_lang-3.9.1-cp313-cp313-manylinux_2_28_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

wave_lang-3.9.1-cp312-cp312-win_amd64.whl (793.0 kB view details)

Uploaded CPython 3.12Windows x86-64

wave_lang-3.9.1-cp312-cp312-manylinux_2_28_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

wave_lang-3.9.1-cp311-cp311-win_amd64.whl (793.1 kB view details)

Uploaded CPython 3.11Windows x86-64

wave_lang-3.9.1-cp311-cp311-manylinux_2_28_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

wave_lang-3.9.1-cp310-cp310-win_amd64.whl (793.2 kB view details)

Uploaded CPython 3.10Windows x86-64

wave_lang-3.9.1-cp310-cp310-manylinux_2_28_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ x86-64

File details

Details for the file wave_lang-3.9.1-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: wave_lang-3.9.1-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 792.9 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for wave_lang-3.9.1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 68fe14f23f4f8335469a6d9128431760cf1c097f191966578af51a4187f843b9
MD5 42f43b2cf8e0765d003c8d025895665c
BLAKE2b-256 4597c801184511b2f926ff9eff94adb5c054098a99e7b819861c9440593c75e6

See more details on using hashes here.

Provenance

The following attestation bundles were made for wave_lang-3.9.1-cp313-cp313-win_amd64.whl:

Publisher: pypi-publish.yml on iree-org/wave

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

File details

Details for the file wave_lang-3.9.1-cp313-cp313-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for wave_lang-3.9.1-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 4d43ff5bc87365ddbcccba76346d8079a2cf255c6c50ad04a4048581068e925c
MD5 3a5454dc0e8877943f692bb92b8bc075
BLAKE2b-256 4f2bf31c05a0256753ccc95cb3e090ad1dc4a7a66624bec53380445e66b24a3c

See more details on using hashes here.

Provenance

The following attestation bundles were made for wave_lang-3.9.1-cp313-cp313-manylinux_2_28_x86_64.whl:

Publisher: pypi-publish.yml on iree-org/wave

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

File details

Details for the file wave_lang-3.9.1-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: wave_lang-3.9.1-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 793.0 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for wave_lang-3.9.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 c49fa59432b87c9f965bdb857ec7a8a61b4a3f6c4137fcd3e7e384188dbce5fc
MD5 12c3904447dafcebd058ee39df28e261
BLAKE2b-256 81cfefdce4290867d602df66f780ec60ea7065046e5138a6022c93203ea04bfb

See more details on using hashes here.

Provenance

The following attestation bundles were made for wave_lang-3.9.1-cp312-cp312-win_amd64.whl:

Publisher: pypi-publish.yml on iree-org/wave

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

File details

Details for the file wave_lang-3.9.1-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for wave_lang-3.9.1-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 b9901c9ac210e4db1e22133ab439790e389277724fee07d8b8e7ee27ac025704
MD5 ba6662d3e95e2d85e58d906414e1f554
BLAKE2b-256 31cf7d5022c6c3b41578f5e1d021e5dec5d44f9a42cfdeca3c69f482ec7bc2a6

See more details on using hashes here.

Provenance

The following attestation bundles were made for wave_lang-3.9.1-cp312-cp312-manylinux_2_28_x86_64.whl:

Publisher: pypi-publish.yml on iree-org/wave

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

File details

Details for the file wave_lang-3.9.1-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: wave_lang-3.9.1-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 793.1 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for wave_lang-3.9.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 a3f5184290071a0db700723a559062748efcbf598295fbb6db77d53a419eab4a
MD5 2323f25bc67247047c50c483397b5838
BLAKE2b-256 1dd7c6d5c5c366b1628c56650dbcb6da979e1690fd6fa2e755fc67c5fe0602e1

See more details on using hashes here.

Provenance

The following attestation bundles were made for wave_lang-3.9.1-cp311-cp311-win_amd64.whl:

Publisher: pypi-publish.yml on iree-org/wave

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

File details

Details for the file wave_lang-3.9.1-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for wave_lang-3.9.1-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 9da6687c95bd61c5f1b9bdc4e33b6b083e1e3d77226806f79137c7d5854f0d78
MD5 12e518ccd19a39a60dfa8a7131420a3c
BLAKE2b-256 a8b0e6d3d25eb481d273b3c6b25ecfcdb494d4a0b6f0984dec414b5152a93f6c

See more details on using hashes here.

Provenance

The following attestation bundles were made for wave_lang-3.9.1-cp311-cp311-manylinux_2_28_x86_64.whl:

Publisher: pypi-publish.yml on iree-org/wave

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

File details

Details for the file wave_lang-3.9.1-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: wave_lang-3.9.1-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 793.2 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for wave_lang-3.9.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 566d1cba9cc2c8a47281207fecd98e035a5b7dae82500ecb7d7ad23b0aa6b3c4
MD5 1801c61b02434bf8e7e3c4d9bdf73bf4
BLAKE2b-256 ac8ab12a69ec0ff352c57eb1aae7a47b31842438e16e7a8186d9426668bf9295

See more details on using hashes here.

Provenance

The following attestation bundles were made for wave_lang-3.9.1-cp310-cp310-win_amd64.whl:

Publisher: pypi-publish.yml on iree-org/wave

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

File details

Details for the file wave_lang-3.9.1-cp310-cp310-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for wave_lang-3.9.1-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 97835dc4ef320afc307f52e46d20723cfa71e6b020b2cbd67a0d1d6af2398565
MD5 5d5ee84f7c4cadf8be3c5f97367b8500
BLAKE2b-256 28876066f64c0cb1086c5f6dba0435355956206553cf4bfb4162a3f8dc0a316e

See more details on using hashes here.

Provenance

The following attestation bundles were made for wave_lang-3.9.1-cp310-cp310-manylinux_2_28_x86_64.whl:

Publisher: pypi-publish.yml on iree-org/wave

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