Skip to content
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
BasedOnStyle: LLVM
UseTab: Never
IndentWidth: 2
ColumnLimit: 80

Language: Cpp
Standard: c++17
5 changes: 4 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ insert_final_newline = true
indent_size = 4

[*.{cpp,hpp,cxx,cc,c,h,cu,cuh}]
indent_size = 4
indent_size = 2

[{*.cmake,CMakeLists.txt}]
indent_size = 2

[*.{yaml,yml}]
indent_size = 2
Expand Down
9 changes: 9 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1,10 @@
* text eol=lf
*.bat eol=crlf

*.svg binary
*.jpg binary
*.jpeg binary
*.png binary
*.gif binary

*.h linguist-language=C++
59 changes: 59 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
ci:
autofix_prs: true
autofix_commit_msg: "[Lint]: [pre-commit.ci] auto fixes [...]"
autoupdate_commit_msg: "[CI] [pre-commit.ci] autoupdate"
autoupdate_schedule: monthly
default_stages: [pre-commit, pre-push, manual]
exclude: '^(build|3rdparty)/.*$' # exclude build and 3rdparty directories
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v6.0.0
hooks:
- id: check-symlinks
- id: destroyed-symlinks
# FIXME: enable these hooks
# - id: trailing-whitespace
# - id: end-of-file-fixer
- id: check-added-large-files
- id: check-merge-conflict
fail_fast: true
# FIXME: enable these hooks
# - id: check-executables-have-shebangs
# - id: check-shebang-scripts-are-executable
- id: detect-private-key
- id: check-yaml
- id: check-toml
- id: check-ast
fail_fast: true
- id: debug-statements
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v15.0.7 # sync with requirements-lint.txt
hooks:
- id: clang-format
exclude: |
(?ix)(
^.+\.json$
)
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.14.0 # sync with requirements-lint.txt
hooks:
- id: ruff-check
args: [--fix, --exit-non-zero-on-fix]
- repo: https://github.com/google/yapf
rev: v0.43.0 # sync with requirements-lint.txt
hooks:
- id: yapf
args: [--recursive, --in-place]
- repo: https://github.com/codespell-project/codespell
rev: v2.4.1 # sync with requirements-lint.txt
hooks:
- id: codespell
additional_dependencies: [".[toml]"]
exclude: |
(?x)(
^.+\.(cpp|hpp|cxx|cc|c|h|cu|cuh)$|
^.+\.svg$|
^.*\brequirements\b.*\.txt$
)
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ else()

# Set default build type to RelWithDebInfo if not provided
if(NOT CMAKE_BUILD_TYPE)
# Set default build type to Release if not provided
# Set default build type to Release if not provided
set(CMAKE_BUILD_TYPE Release CACHE STRING "Build type" FORCE)
message(STATUS "Setting default build type to ${CMAKE_BUILD_TYPE}")
endif()
Expand Down Expand Up @@ -199,7 +199,7 @@ if(USE_CUDA)
set(CUDA_MAJOR_VERSION ${CUDAToolkit_VERSION_MAJOR})
message(STATUS "Setting CUDA_MAJOR_VERSION=${CUDA_MAJOR_VERSION}")
add_compile_definitions(CUDA_MAJOR_VERSION=${CUDA_MAJOR_VERSION})

list(APPEND TILE_LANG_INCLUDES ${CUDAToolkit_INCLUDE_DIRS})
endif(USE_CUDA)

Expand Down
4 changes: 2 additions & 2 deletions docs/deeplearning_operators/matmul.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
:class: myclass1 myclass2
:name: a-tip-reference

This document is still **experimental** and may be incomplete.
This document is still **experimental** and may be incomplete.
Suggestions and improvements are highly encouraged—please submit a PR!
:::

Expand Down Expand Up @@ -256,4 +256,4 @@ For more advanced usage—including partial lowering, explicitly controlling thr
* [BitBLAS](https://github.com/tile-ai/bitblas)
* [Triton](https://github.com/openai/triton)
* [Cutlass](https://github.com/NVIDIA/cutlass)
* [PyCUDA](https://documen.tician.de/pycuda/)
* [PyCUDA](https://documen.tician.de/pycuda/) <!-- codespell:ignore -->
2 changes: 2 additions & 0 deletions examples/deepseek_v32/fp8_lighting_indexer.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ def ref_fp8_mqa_logits(q: torch.Tensor, kv: torch.Tensor, weights: torch.Tensor,
cost = mask.sum()
return logits, cost


def test_fp8_lighting_indexer(S=4096, SKV=8192, H=32, HKV=1, D=64, kv_stride=1):
q = torch.randn(S, H, D, device="cuda", dtype=torch.bfloat16).to(torch.bfloat16)
kv = torch.randn(SKV, D, device="cuda", dtype=torch.bfloat16).to(torch.bfloat16)
Expand Down Expand Up @@ -302,5 +303,6 @@ def logits_fn():
print(f"logits_tflops: {logits_tflops}, logits_ms: {logits_ms}")
print(f"cost_ref: {cost_ref}")


if __name__ == "__main__":
test_fp8_lighting_indexer()
Loading