Comet Domain Specific Compiler as Python package
Project description
cometpy
Comet Domain Specific Compiler for NumPy frontends.
Latest Version : v0.1
Requirements:
- python 3 and above
- COMET Python package v0.1
- OS support - Linux and macOS
"COMET" / Domain specific COMpiler for Extreme Targets
The COMET compiler consists of a Domain Specific Language (DSL) for sparse and dense tensor algebra computations, a progressive lowering process to map high-level operations to low-level architectural resources, a series of optimizations performed in the lowering process, and various IR dialects to represent key concepts, operations, and types at each level of the multi-level IR. At each level of the IR stack, COMET performs different optimizations and code transformations. Domain-specific, hardware- agnostic optimizations that rely on high-level semantic information are applied at high-level IRs. These include reformulation of high-level operations in a form that is amenable for execution on heterogeneous devices (e.g., rewriting Tensor contraction operations as Transpose-Transpose-GEMM-Transpose) and automatic parallelization of high-level primitives (e.g., tiling for thread- and task-level parallelism).
More information about the COMET compiler can be found at:
- COMET's source code - https://github.com/pnnl/COMET
- COMET’s documentation - https://pnnl-comet.readthedocs.io/en/latest/
Installation and Testing:
-
Getting COMET pyhton package:
- Install the COMET python package using pip (or) pip3 python package managers as:
- For macOS users: python3 -m pip install cometpy
- For Linux users: python3 -m pip install cometpy-lnx
-
Using COMET compiler as a backend to lower and execute test methods:
-
Import the Comet Python package in your python script using - "import cometpy as comet"
-
To compile a test method using COMET, add the decorator "@comet.compile(flags=...)" before the method.
-
The "numpy" keyword in a target method needs to be replace with "comet" e.g. "comet.einsum" , "comet.multiply"
-
Supported "numpy" methods:
- .einsum()
- .multiply()
-
For the actual "einsum" computation, follow the convention - "comet.einsum()"
-
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.