Skip to content

Commit 99bbf1f

Browse files
committed
update release v0.1.3
1 parent bfcbc30 commit 99bbf1f

397 files changed

Lines changed: 1000204 additions & 320665 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.clang-format

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
BasedOnStyle: Google
2+
IndentWidth: 2
3+
ColumnLimit: 120
4+
BreakBeforeBraces: Custom
5+
AlignTrailingComments: true
6+
AllowShortFunctionsOnASingleLine: None
7+
AllowShortBlocksOnASingleLine: false
8+
AllowShortIfStatementsOnASingleLine: true
9+
AllowShortLoopsOnASingleLine: true
10+
AlignAfterOpenBracket: Align
11+
AlignConsecutiveDeclarations: true
12+
AlignConsecutiveAssignments: true
13+
BinPackArguments: false
14+
BinPackParameters: false
15+
CommentPragmas: false

.gitignore

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
2+
# csrc
3+
csrc/instantiations/*
4+
5+
# mate
6+
mate/_version.py
7+
mate/_build_meta.py
8+
mate/data
9+
10+
# vscode
11+
.vscode/
12+
13+
# claude
14+
.claude
15+
16+
# python
17+
__pycache__/
18+
19+
# Distribution / packaging
20+
build/
21+
dist/
22+
*.egg-info/
23+
24+
# temporary files
25+
mate/jit/aot-levels.json
26+
aot-lib/
27+
temp/
28+
mate/jit/aot-levels.json

.pre-commit-config.yaml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# To use:
2+
#
3+
# pre-commit run -a
4+
#
5+
# Or:
6+
#
7+
# pre-commit install # (runs every time you commit in git)
8+
#
9+
# To update this file:
10+
#
11+
# pre-commit autoupdate
12+
#
13+
# See https://github.com/pre-commit/pre-commit
14+
15+
repos:
16+
# Standard hooks
17+
- repo: https://github.com/pre-commit/pre-commit-hooks
18+
rev: v5.0.0
19+
hooks:
20+
- id: check-added-large-files
21+
args: ["--maxkb=1024"]
22+
- id: check-case-conflict
23+
- id: check-merge-conflict
24+
- id: check-symlinks
25+
- id: end-of-file-fixer
26+
- id: mixed-line-ending
27+
- id: requirements-txt-fixer
28+
- id: trailing-whitespace
29+
30+
# Changes tabs to spaces
31+
- repo: https://github.com/Lucas-C/pre-commit-hooks
32+
rev: v1.5.5
33+
hooks:
34+
- id: remove-tabs
35+
- id: remove-crlf
36+
37+
# Formatters
38+
- repo: https://github.com/pre-commit/mirrors-clang-format
39+
rev: v19.1.1
40+
hooks:
41+
- id: clang-format
42+
types_or: [c++, c, cuda]
43+
exclude: |
44+
(?x)^(3rdparty/.*)$
45+
46+
- id: clang-format
47+
types_or: [file]
48+
files: '\.(mu|muh)$'
49+
exclude: |
50+
(?x)^(3rdparty/.*)$
51+
52+
- repo: https://github.com/pre-commit/mirrors-mypy
53+
rev: 'v1.17.1' # Use the sha / tag you want to point at
54+
hooks:
55+
- id: mypy
56+
57+
- repo: https://github.com/astral-sh/ruff-pre-commit
58+
# Ruff version.
59+
rev: v0.12.8
60+
hooks:
61+
# Run the linter.
62+
- id: ruff-check
63+
# Run the formatter.
64+
- id: ruff-format
65+
types_or: [ python, pyi ]

README.md

Lines changed: 63 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,89 @@
11
# MUSA AI Tensor Engine
22

3-
MATE(**M**USA **A**I **T**ensor **E**ngine) is a centralized library for Generative AI.
3+
MATE (**M**USA **A**I **T**ensor **E**ngine) is a centralized library for Generative AI workloads on MUSA. It provides high-performance attention and GEMM operators, and compatibility wrappers for CUDA-oriented Python APIs.
44

5-
## Installation
5+
## Highlights
66

7-
### Requirements
7+
- High-performance attention and GEMM operators for MUSA
8+
- Compatibility wrappers for `flash_attn` and `deep_gemm`
9+
- CLI tools for environment checks, configuration inspection, and replay
810

9-
MUSA Toolkits: 4.3.4 or later
11+
## Quick Links
1012

11-
TorchMUSA: 2.7.1 or later
13+
- CLI documentation: [docs/mate_cli.md](docs/mate_cli.md)
14+
- FlashAttention compatibility summary: [docs/flash_attention.md](docs/flash_attention.md)
15+
- FlashAttention wrapper: [wrappers/flash-attention/README.md](wrappers/flash-attention/README.md)
16+
- DeepGEMM wrapper: [wrappers/deep_gemm/README.md](wrappers/deep_gemm/README.md)
1217

13-
Architecutre: Pinghu(MP31)
18+
## Requirements
1419

15-
### Install From Source
20+
| Component | Requirement |
21+
| --- | --- |
22+
| MUSA Toolkit | `4.3.6` or later |
23+
| TorchMUSA | `2.7` or later |
24+
| Architecture | `Pinghu (MP31)` |
25+
26+
## Build From Source
1627

1728
```bash
18-
git clone git@github.com:MooreThreads/mate.git --recursive
29+
git clone https://github.com/MooreThreads/mate.git --recursive
1930
cd mate
20-
pip install --no-build-isolation . -v
31+
bash build.sh
2132
```
2233

23-
### Build From Source
34+
## Repository Layout
35+
36+
| Path | Purpose |
37+
| --- | --- |
38+
| `mate/` | Core Python package and public APIs |
39+
| `wrappers/` | Compatibility wrapper packages for existing Python ecosystems |
40+
| `docs/` | Markdown docs and Sphinx sources |
41+
| `tests/` | Correctness and integration tests |
42+
| `benchmarks/` | Performance and benchmarking scripts |
43+
44+
## MATE CLI
45+
46+
MATE provides a command-line interface for configuration, debugging, diagnostics, and replay.
47+
48+
| Command | Purpose |
49+
| --- | --- |
50+
| `mate check` | Validate the runtime environment |
51+
| `mate show-config` | Display installation and runtime configuration |
52+
| `mate env` | Show relevant environment variables |
53+
| `mate replay --dir PATH` | Replay API calls from Level 10 dumps |
54+
| `mate list-dumps PATH` | List recorded dump directories |
55+
56+
Example:
2457

2558
```bash
26-
git clone git@github.com:MooreThreads/mate.git --recursive
27-
cd mate
28-
python -m build --wheel --no-isolation
59+
mate check
60+
mate show-config
61+
mate env
62+
mate replay --dir mate_dumps/
63+
mate list-dumps mate_dumps/
2964
```
3065

31-
## Build Docs
66+
See [docs/mate_cli.md](docs/mate_cli.md) for full CLI documentation.
67+
68+
## Wrappers
69+
70+
MATE uses the packages under `wrappers/` as a compatibility layer for CUDA-oriented software stacks on MUSA. These wrappers preserve familiar package names and high-level APIs while routing execution to MATE operators and kernels on MUSA, which helps existing integrations migrate with smaller code changes.
71+
72+
| Wrapper | Package | Import Path | Purpose | Documentation |
73+
| --- | --- | --- | --- | --- |
74+
| `wrappers/flash-attention` | `mate-flash-attention` | `flash_attn` | FlashAttention-compatible APIs on top of MATE attention operators on MUSA | [wrapper README](wrappers/flash-attention/README.md), [compatibility summary](docs/flash_attention.md) |
75+
| `wrappers/deep_gemm` | `mate-deep_gemm` | `deep_gemm` | DeepGEMM-compatible APIs on top of MATE GEMM operators on MUSA | [wrapper README](wrappers/deep_gemm/README.md) |
76+
77+
## Build Documentation
3278

33-
**After installing mate**, run the following commands:
79+
After installing `mate`, build the Sphinx docs with:
3480

3581
```bash
3682
pip install sphinx furo
37-
cd mate/docs
83+
cd docs
3884
make html
3985
```
4086

4187
## Acknowledgement
4288

43-
Mate is inspired by [FlashInfer](https://github.com/flashinfer-ai/flashinfer), [FlashAttention](https://github.com/Dao-AILab/flash-attention), [cutlass](https://github.com/NVIDIA/cutlass), [FlashMLA](https://github.com/deepseek-ai/FlashMLA) and [DeepGemm](https://github.com/deepseek-ai/DeepGEMM) projects.
89+
MATE is inspired by [FlashInfer](https://github.com/flashinfer-ai/flashinfer), [FlashAttention](https://github.com/Dao-AILab/flash-attention), [cutlass](https://github.com/NVIDIA/cutlass), [FlashMLA](https://github.com/deepseek-ai/FlashMLA), and [DeepGemm](https://github.com/deepseek-ai/DeepGEMM).

0 commit comments

Comments
 (0)