You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit f75ba24
Browse filesBrowse the repository at this point in the historyBrowse files
- Remove `mlp_schedule` that is now superseded by the common xegpu
pipeline.
- Updates examples:
- `matmul.py`: uses xegpu pipeline.
- `mlp.py`: uses xegpu pipeline.
- `torch_matmul.py`: uses xegpu pipeline.
- `kernel_bench.py`: uses xegpu pipeline for gemm/mlp kernels. Drops now
obsolete `--use-gpu-pipeline` CLI arg.
- `nanoGPT_schedule.py`: uses `annotate_gemm` to add xegpu layout
annotations to matmuls.
- `llama3_schedule.py`: uses `annotate_gemm` to add xegpu layout
annotations to matmuls.
- Verified `tune_matmul_costmodel.py` works correctly.
- Verified `kernel_bench.py` gemm parameter tuning and parameter
disk-caching works.
- Updated the only xegpu related yaml pipeline file
`pipeline/descriptors/xegpu/matmul/bf16.yaml` to point to the xegpu
pipeline. It's not used in Lighthouse at the moment.
`tune_matmul_gridsearch.py` performs an exhaustive grid search on a matrix multiplication kernel. It takes similar arguments as the `matmul.py` benchmark:
154
+
`tune_matmul_costmodel.py` uses cost-model estimates to select promising matrix multiplication configurations for benchmarking. Results are saved to `out_costmodel.csv`.
To get information about the search space (e.g., tile parameter choices) without actually executing the kernels run with `--dry-run` flag:
169
-
170
-
```bash
171
-
python tune_matmul_gridsearch.py --dry-run
172
-
```
173
-
174
-
Example output:
175
-
176
-
```txt
177
-
Matmul problem size: [4096, 4096, 4096]
178
-
ab_type='f16'
179
-
c_type='f32'
180
-
has_bias=False
181
-
has_relu=False
182
-
accumulate_c=True
183
-
Variable set:
184
-
wg_m=[64, 128, 256]
185
-
wg_n=[64, 128, 256]
186
-
sg_m=[32, 64, 128]
187
-
sg_n=[32, 64, 128]
188
-
k_tile=[16, 32, 64, 128, 256]
189
-
load_a_m=[8, 16, 32]
190
-
load_a_k=[8, 16, 32]
191
-
load_b_k=[8, 16, 32]
192
-
load_b_n=[8, 16, 32]
193
-
prefetch_a_m=[8, 16, 32]
194
-
prefetch_a_k=[8, 16, 32]
195
-
prefetch_b_k=[8, 16, 32]
196
-
prefetch_b_n=[8, 16, 32]
197
-
prefetch_nb=[1]
198
-
Total complexity: 2657205 configurations
199
-
Number of executed configurations: 5292
200
-
```
201
-
202
-
Total complexity is the number of parameter combinations without any filtering. The number of executed configurations shows the number of valid combinations, i.e. ones that satisfy appropriate (e.g., hardware) constraints.
203
-
204
-
To dump the best found configurations as JSON files at the end of the search, use `--dump-json n` flag where `n` stands for the number of best configurations. The files are named as `matmul_params_*_00.json` with increasing integer suffix (best configuration being 00).
205
-
206
-
> [!NOTE]
207
-
> Running the grid search typically takes several hours to complete.
208
-
209
-
### Adaptive sampling with Genetic Algorithm
210
-
211
-
`tune_matmul_ga.py` employs a genetic algorithm for adaptive sampling to explore the kernel tuning search space. This approach is typically an order of magnitude faster while discovering high throughput parameter combinations.
212
-
213
-
The command-line interface is similar to `tune_matmul_gridsearch.py`:
0 commit comments