Commit Graph

6 Commits

Author SHA1 Message Date
Beckylu 8e3160ea8a docs: add 2026 summer camp contribution workflow 2026-07-27 14:24:21 +08:00
Ang Gao 6c7bdf9f70
[Chore][CI] Remove outdated GitHub templates (#669)
## Summary

- Remove `.github/ISSUE_TEMPLATE/bug_report.md` and
`.github/ISSUE_TEMPLATE/new_operator.md` which are no longer aligned
with the current development workflow.
- Remove `.github/pull_request_template.md` which is also outdated.
- The current process is managed by `docs/`, `perf/`, and
`docs/architecture.md`.
- `.github/ISSUE_TEMPLATE/new_operator_subtask.md` is retained as it is
still in active use.

Closes #668

## Test Plan

- [x] Verify `new_operator_subtask.md` is still present after deletion.
- [ ] Confirm GitHub issue template picker no longer shows the removed
templates.
- [ ] Confirm new PRs no longer auto-populate the removed PR template.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 19:10:41 +08:00
Cao Ying 4d65362c58
[Feat][Elementwise] Add 30 UnaryKernel template ops (#457)
## Summary

Implement 30 `UnaryKernel` subclasses and 30 corresponding `UnaryOp`
subclasses for elementwise operations, then tighten the implementation
to match issue #437 and the follow-up review findings.

**Ops**: `exp`, `log`, `sqrt`, `rsqrt`, `abs`, `neg`, `reciprocal`,
`sign`, `sin`, `cos`, `floor`, `ceil`, `round`, `trunc`, `erf`, `log1p`,
`expm1`, `gelu`, `silu`, `sigmoid`, `tanh`, `hardswish`, `hardsigmoid`,
`mish`, `selu`, `logical_not`, `bitwise_not`, `isnan`, `isinf`,
`isfinite`

Closes #437

## Dtype Support Matrix

| Op / API | Input dtypes | Output dtype | Reference baseline |
| --- | --- | --- | --- |
| Unary math ops + activations | `fp16`, `bf16`, `fp32` | same as input
| matching `torch` / `torch.nn.functional` unary semantics |
| `logical_not` | `bool`, `uint8`, `int8`, `int16`, `int32`, `int64`,
`fp16`, `bf16`, `fp32` | `bool` | `torch.logical_not` |
| `bitwise_not` | `bool`, `uint8`, `int8`, `int16`, `int32`, `int64` |
same as input | `torch.bitwise_not` |
| `isnan`, `isinf`, `isfinite` | `fp16`, `bf16`, `fp32` | `bool` |
`torch.isnan`, `torch.isinf`, `torch.isfinite` |

## Test Plan

- [x] **AC-1**: 30 kernel subclasses and 30 op subclasses exist for the
issue #437 scope.
- [x] **AC-2**: Unary elementwise dtype contracts are explicit in code
via `SUPPORTED_DTYPES` / `OUTPUT_DTYPE` where needed.
- [x] **AC-3**: `gelu` uses the standard `erf` formulation instead of
the tanh approximation.
- [x] **AC-4**: `logical_not`, `isnan`, `isinf`, and `isfinite` produce
torch-style `bool` outputs and tests validate them with exact
comparison.
- [x] **AC-5**: `bitwise_not` support is aligned to the current torch
contract (`bool/uint8/int8/int16/int32/int64`) and reject-path tests
exist for float dtypes.
- [x] **AC-6**: L4 edge-case coverage matches issue #437 for `sqrt`,
`rsqrt`, `log`, `log1p`, `exp`, `expm1`, `erf`, `reciprocal`, `sign`,
and special predicates.
- [x] **AC-7**: Repository-level templates/docs now require future new
ops to include a dtype support matrix, acceptance checklist, and
benchmark table in the PR body.
- [x] **AC-8**: A representative unary benchmark file exists in
`benchmarks/ops/bench_unary_elementwise.py` and runs on a real GPU
machine with small, medium, and large shapes.
- [x] **AC-9**: Top-level `__init__.py` re-export files remain
unchanged.
- [x] Elementwise correctness suite passes on the real machine GPUs:
`127 passed, 2 warnings in 8.04s`.
- [x] Unary benchmark suite passes on the real machine GPUs: `21 passed,
23 warnings in 56.25s`.

## Benchmark

**Configuration**: H200, Driver `575.57.08`, CUDA `12.8` (torch), torch
`2.9.1+cu128`

| N_total | dtype | Op | TileOPs (ms) | Baseline (ms) | Ratio |
| --- | --- | --- | --- | --- | --- |
| 262,144 | fp16 | `exp` | 0.00250 | 0.00607 | 2.43x faster |
| 1,048,576 | fp16 | `exp` | 0.00334 | 0.00768 | 2.30x faster |
| 4,000,000 | fp16 | `exp` | 0.00680 | 0.01032 | 1.52x faster |
| 262,144 | bf16 | `exp` | 0.00251 | 0.00628 | 2.50x faster |
| 1,048,576 | bf16 | `exp` | 0.00334 | 0.00709 | 2.12x faster |
| 4,000,000 | bf16 | `exp` | 0.00669 | 0.01091 | 1.63x faster |
| 262,144 | fp16 | `gelu` | 0.00264 | 0.00734 | 2.78x faster |
| 1,048,576 | fp16 | `gelu` | 0.00401 | 0.00839 | 2.09x faster |
| 4,000,000 | fp16 | `gelu` | 0.00980 | 0.01323 | 1.35x faster |
| 262,144 | bf16 | `gelu` | 0.00267 | 0.00656 | 2.46x faster |
| 1,048,576 | bf16 | `gelu` | 0.00409 | 0.00845 | 2.07x faster |
| 4,000,000 | bf16 | `gelu` | 0.01009 | 0.01277 | 1.27x faster |
| 262,144 | fp16 | `logical_not` | 0.00262 | 0.00679 | 2.59x faster |
| 1,048,576 | fp16 | `logical_not` | 0.00545 | 0.00691 | 1.27x faster |
| 4,000,000 | fp16 | `logical_not` | 0.01467 | 0.00941 | 0.64x |
| 262,144 | int32 | `bitwise_not` | 0.00297 | 0.00715 | 2.41x faster |
| 1,048,576 | int32 | `bitwise_not` | 0.00604 | 0.00816 | 1.35x faster |
| 4,000,000 | int32 | `bitwise_not` | 0.01657 | 0.01404 | 0.85x |
| 262,144 | fp16 | `isnan` | 0.00263 | 0.00674 | 2.56x faster |
| 1,048,576 | fp16 | `isnan` | 0.00546 | 0.00690 | 1.26x faster |
| 4,000,000 | fp16 | `isnan` | 0.01473 | 0.01016 | 0.69x |

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-12 18:55:08 +08:00
Cao Ying b8b7c07d7a
[Chore] Update README, pre-commit hooks and reformat. (#82)
This pull request enhances the project's code quality, developer
experience, and overall structural integrity. It mainly makes the
following changes:

* Introduced a new `.flake8` configuration file and updated the
`.pre-commit-config.yaml` to enable more linting and formatting hooks.
* Removed the `flash-attention` git submodule and updated `.gitignore`
and `MANIFEST.in` to streamline the project's dependencies and
packaging.
* The `pyproject.toml` file was updated to reflect the new linting
setup.
2026-01-05 18:20:15 +08:00
Lingxiao Ma 2f6e4f2137
[Doc] Refactor development docs (#81)
## Description
Refactor the DEVELOPMENT doc and the corresponding github template

* Documentation Refinement: The DEVELOPMENT.md guide has been updated to
streamline the 'Development Workflow' section.
* Enhanced Operator Development Workflow: The guide now includes more
detailed instructions for new operator development, such as task
decomposition for tracking issues, explicit docstring requirements for
each layer (Kernel, Op, Functional API, Layer), and a new dedicated step
for benchmark results.
* GitHub Template Updates: Minor adjustments were made to GitHub
templates; New issue template for new op subtask.

## Type of Change
- [ ] Bug fix
- [ ] New operator Implementation
- [ ] Performance improvement
- [x] Documentation update
- [ ] Infrastructure/CI

## Checklist
- [x] I have run `pre-commit run --all-files` and fixed all linting
issues.
- [x] I have verified that my changes pass local unit tests.
- [ ] **(For new ops)** I have added the corresponding `Benchmark` class
in `benchmarks/`.
- [ ] **(For new ops)** I have reported benchmark results in the
tracking issue.
2026-01-05 16:17:46 +08:00
Lingxiao Ma a4985db434
[Doc] Add development doc and update readme (#75)
This pull request refactors the project's `README.md` file. It mainly
makes the following changes:

1. The `README.md` has been refactored to
provide a more comprehensive and structured overview of the TileOPs
project, including detailed feature descriptions and design principles.
2. A new project logo has been added to the
`README.md` for improved branding and visual appeal.
2026-01-05 09:14:25 +08:00