Skip to content

Commit 641e1b6

Browse files
author
Release Bot
committed
refactor: fix critical bugs and improve project structure
Phase 1 - Critical Bug Fixes: - Add tests/test_cuda_utils.h for GPU test skip support (blocking issue) - Fix forward_with_timing() missing cudaStreamSynchronize() - Unify launch_fused_gemm() error handling to throw std::invalid_argument - Fix docs/releases/v1.1.0.md date from 2025 to 2024 Phase 1 - Cleanup: - Remove .omc/ directory (was in .gitignore) - Add .gitkeep to openspec/archive/ and openspec/changes/ Phase 2 - CI Optimization: - Simplify CI format check from 4 action calls to single script - Add test_autotuner.cpp, test_profiler.cpp, test_half_gemm.cu - Add CODEOWNERS, ISSUE_TEMPLATE, SECURITY.md - Update CMakeLists.txt with new test files Phase 3 - AI Tooling: - Add .clang-tidy configuration - Enhance .clangd with ClangTidy support - Enhance AGENTS.md with CUDA debugging guide and troubleshooting - Enhance CLAUDE.md with error handling and test classification - Simplify OpenSpec README files to pure index New files: 12 Modified files: 7 Total changes: +692 -253 lines
1 parent 13f3886 commit 641e1b6

19 files changed

Lines changed: 692 additions & 253 deletions

File tree

.clang-tidy

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
Checks: >
3+
bugprone-*,
4+
modernize-*,
5+
performance-*,
6+
readability-*,
7+
-modernize-use-trailing-return-type,
8+
-readability-magic-numbers,
9+
-readability-identifier-length
10+
HeaderFilterRegex: '.*'
11+
CheckOptions:
12+
- key: readability-identifier-naming.ClassCase
13+
value: CamelCase
14+
- key: readability-identifier-naming.FunctionCase
15+
value: lower_case
16+
- key: readability-identifier-naming.VariableCase
17+
value: lower_case
18+
- key: readability-identifier-naming.ConstantCase
19+
value: UPPER_CASE
20+
- key: readability-identifier-naming.ParameterCase
21+
value: lower_case
22+
- key: readability-identifier-naming.MemberCase
23+
value: lower_case
24+
- key: readability-identifier-naming.MemberSuffix
25+
value: '_'
26+
- key: performance-move-const-arg.CheckTriviallyCopyableMove
27+
value: '0'
28+
- key: bugprone-argument-comment.StrictMode
29+
value: '1'

.clangd

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@ CompileFlags:
1010
Diagnostics:
1111
UnusedIncludes: Strict
1212
MissingIncludes: Strict
13+
ClangTidy:
14+
Add:
15+
- bugprone-*
16+
- modernize-*
17+
- performance-*
18+
- readability-*
19+
Remove:
20+
- modernize-use-trailing-return-type
1321

1422
Index:
1523
Background: Build

.github/CODEOWNERS

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# Code Owners
2+
3+
This file defines the code ownership for the mini-inference-engine project.
4+
5+
## Repository Owners
6+
7+
* @shane
8+
9+
## Code Ownership by Area
10+
11+
### CUDA Kernels
12+
```
13+
src/*.cu
14+
include/kernels.cuh
15+
include/half_gemm.cuh
16+
include/vectorized_gemm.cuh
17+
```
18+
19+
### Inference Engine
20+
```
21+
src/inference_engine.cpp
22+
include/inference_engine.h
23+
include/tensor.h
24+
src/tensor.cu
25+
```
26+
27+
### Memory Management
28+
```
29+
include/memory_pool.h
30+
include/stream_manager.h
31+
```
32+
33+
### Performance & Profiling
34+
```
35+
include/autotuner.h
36+
include/profiler.h
37+
benchmarks/
38+
```
39+
40+
### Configuration & Logging
41+
```
42+
include/config.h
43+
include/logger.h
44+
```
45+
46+
### Quantization
47+
```
48+
include/quantization.h
49+
```
50+
51+
### Batch Operations
52+
```
53+
include/batch_gemm.h
54+
```
55+
56+
### Tests
57+
```
58+
tests/
59+
```
60+
61+
### Documentation
62+
```
63+
docs/
64+
README.md
65+
README.zh-CN.md
66+
CHANGELOG.md
67+
AGENTS.md
68+
CLAUDE.md
69+
```
70+
71+
### CI/CD
72+
```
73+
.github/
74+
CMakeLists.txt
75+
CMakePresets.json
76+
```
77+
78+
### OpenSpec
79+
```
80+
openspec/
81+
```
82+
83+
## Review Requirements
84+
85+
- Changes to core CUDA kernels require review by kernel owners
86+
- Breaking API changes require review from all area owners
87+
- Documentation changes can be approved by any owner
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
---
2+
name: Bug Report
3+
about: Report a bug to help us improve
4+
title: '[BUG] '
5+
labels: bug
6+
assignees: ''
7+
---
8+
9+
## Describe the Bug
10+
11+
A clear and concise description of what the bug is.
12+
13+
## Environment
14+
15+
- OS: [e.g. Ubuntu 22.04]
16+
- CUDA Version: [e.g. 12.1]
17+
- GPU: [e.g. RTX 3080]
18+
- CMake Version: [e.g. 3.25]
19+
- Compiler: [e.g. GCC 11]
20+
21+
## Steps to Reproduce
22+
23+
1. Run command '...'
24+
2. With input '...'
25+
3. See error
26+
27+
## Expected Behavior
28+
29+
A clear and concise description of what you expected to happen.
30+
31+
## Actual Behavior
32+
33+
What actually happened.
34+
35+
## Code Sample
36+
37+
```cpp
38+
// Minimal reproducible code
39+
```
40+
41+
## Error Output
42+
43+
```
44+
Paste the error message or log output here
45+
```
46+
47+
## Additional Context
48+
49+
Add any other context about the problem here.
50+
51+
## Checklist
52+
53+
- [ ] I have searched existing issues to avoid duplicates
54+
- [ ] I have provided a minimal reproducible example
55+
- [ ] I have included all relevant environment information
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
---
2+
name: Feature Request
3+
about: Suggest a new feature or enhancement
4+
title: '[FEATURE] '
5+
labels: enhancement
6+
assignees: ''
7+
---
8+
9+
## Describe the Feature
10+
11+
A clear and concise description of the feature you'd like to see.
12+
13+
## Problem Statement
14+
15+
What problem does this feature solve? Is this a new optimization technique, API improvement, or something else?
16+
17+
## Proposed Solution
18+
19+
How would you like this feature to work?
20+
21+
### API Design (if applicable)
22+
23+
```cpp
24+
// Proposed API signature
25+
void new_function(/* params */);
26+
```
27+
28+
## Alternatives Considered
29+
30+
Have you considered any alternative solutions or workarounds?
31+
32+
## Use Case
33+
34+
Describe a specific use case where this feature would be valuable.
35+
36+
## Priority
37+
38+
- [ ] Low: Nice to have
39+
- [ ] Medium: Would improve workflow
40+
- [ ] High: Blocking important use case
41+
42+
## Implementation Notes
43+
44+
Any technical considerations or constraints?
45+
46+
## Additional Context
47+
48+
Add any other context or screenshots about the feature request here.
49+
50+
## Checklist
51+
52+
- [ ] I have searched existing issues to avoid duplicates
53+
- [ ] I have provided a clear problem statement
54+
- [ ] I have considered alternative solutions

.github/workflows/ci.yml

Lines changed: 14 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -85,29 +85,21 @@ jobs:
8585
- name: Checkout
8686
uses: actions/checkout@v4
8787

88-
- name: Check formatting (src)
89-
uses: jidicula/clang-format-action@v4.18.0
90-
with:
91-
clang-format-version: '18'
92-
check-path: 'src'
93-
94-
- name: Check formatting (include)
95-
uses: jidicula/clang-format-action@v4.18.0
96-
with:
97-
clang-format-version: '18'
98-
check-path: 'include'
99-
100-
- name: Check formatting (tests)
101-
uses: jidicula/clang-format-action@v4.18.0
102-
with:
103-
clang-format-version: '18'
104-
check-path: 'tests'
88+
- name: Install clang-format
89+
run: |
90+
sudo apt-get update
91+
sudo apt-get install -y clang-format-18
10592
106-
- name: Check formatting (benchmarks)
107-
uses: jidicula/clang-format-action@v4.18.0
108-
with:
109-
clang-format-version: '18'
110-
check-path: 'benchmarks'
93+
- name: Check formatting
94+
run: |
95+
echo "Checking code formatting..."
96+
FILES=$(find src include tests benchmarks -type f \( -name '*.cpp' -o -name '*.cu' -o -name '*.h' -o -name '*.cuh' \) 2>/dev/null || true)
97+
if [ -n "$FILES" ]; then
98+
echo "$FILES" | xargs clang-format-18 --dry-run --Werror
99+
echo "✓ All files formatted correctly"
100+
else
101+
echo "No source files found to check"
102+
fi
111103
112104
docs-check:
113105
name: Documentation Check

0 commit comments

Comments
 (0)