Quick Start Guide
Get up and running with HPC-AI-Optimization-Lab in minutes.
Overview
This quick start will show you how to:
- Build your first optimized kernel
- Run a benchmark
- Use Python bindings (optional)
5-Minute Quick Start
Step 1: Build the Project
bash
# Clone and enter the repository
git clone https://github.com/LessUp/hpc-ai-optimization-lab.git
cd hpc-ai-optimization-lab
# Create and enter build directory
mkdir build && cd build
# Configure for release build
cmake .. -DCMAKE_BUILD_TYPE=Release
# Build with 8 parallel jobs
cmake --build . -j81
2
3
4
5
6
7
8
9
10
11
12
2
3
4
5
6
7
8
9
10
11
12
Step 2: Run Tests
bash
# Run all tests
ctest --output-on-failure
# Expected output: 100% tests passed1
2
3
4
2
3
4
Step 3: Run an Example
bash
# Run the ReLU example
./bin/examples/relu_example
# Expected output:
# ReLU kernel launched successfully!
# Output verified ✓1
2
3
4
5
6
2
3
4
5
6
Building Specific Modules
If you only need certain modules:
bash
# Build only elementwise module
cmake --build . --target elementwise
# Build all tests for elementwise
cmake --build . --target test_elementwise1
2
3
4
5
2
3
4
5
Using Python Bindings
Enable Python Support
bash
# Reconfigure with Python bindings
cmake .. \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_PYTHON_BINDINGS=ON
# Rebuild
cmake --build . -j81
2
3
4
5
6
7
2
3
4
5
6
7
Use in Python
python
import hpc_ai_opt
import numpy as np
# Create input tensor
x = np.random.randn(1024).astype(np.float32)
# Apply ReLU kernel
y = hpc_ai_opt.relu(x)
print(f"Input: {x[:5]}")
print(f"Output: {y[:5]}")1
2
3
4
5
6
7
8
9
10
11
2
3
4
5
6
7
8
9
10
11
Next Steps
Now that you have the basics, explore:
| Topic | Guide |
|---|---|
| Memory Optimization | Memory Guide |
| GEMM Optimization | GEMM Guide |
| Performance Tuning | Performance Tuning |
| API Reference | API Reference |
Common Commands Cheat Sheet
bash
# Build
cmake .. -DCMAKE_BUILD_TYPE=Release && cmake --build . -j8
# Test
ctest --output-on-failure
# Benchmark
./examples/gemm/gemm_benchmark
# Clean build
rm -rf build && mkdir build && cd build
# Python install (optional)
pip install -e python/1
2
3
4
5
6
7
8
9
10
11
12
13
14
2
3
4
5
6
7
8
9
10
11
12
13
14
Getting Help
- Documentation: Browse the Guides
- Issues: Check Troubleshooting
- Community: Open a GitHub Issue