-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Snakemake: Add streamer matmul (#315)
* Run streamer_matmul on snakemake ci * Add streamer_matmul * Remove makefile
- Loading branch information
1 parent
18c12fc
commit 23c92ab
Showing
4 changed files
with
85 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
from util.snake.configs import get_snax_gemmx_config | ||
|
||
config = get_snax_gemmx_config() | ||
config["snaxoptflags"] = ",".join( | ||
[ | ||
"convert-linalg-to-kernel", | ||
"insert-accfg-op{accelerator=snax_gemmx}", | ||
"dispatch-kernels", | ||
"convert-linalg-to-stream", | ||
"fuse-streaming-regions", | ||
"snax-bufferize", | ||
"alloc-to-global", | ||
"set-memory-space", | ||
"set-memory-layout", | ||
"realize-memref-casts", | ||
"insert-sync-barrier", | ||
"dispatch-regions{nb_cores=2}", | ||
"convert-stream-to-snax-stream", | ||
"convert-linalg-to-accfg", | ||
"convert-accfg-to-csr", | ||
"snax-copy-to-dma", | ||
"memref-to-snax", | ||
"snax-to-func", | ||
"clear-memory-space", | ||
] | ||
) | ||
|
||
config["mlirtransformflags"] = [ | ||
"--pass-pipeline='builtin.module(transform-interpreter{debug-bind-trailing-args=linalg.quantized_matmul}, test-transform-dialect-erase-schedule)'" | ||
] | ||
|
||
|
||
module default_rules: | ||
snakefile: | ||
"../../util/snake/default_rules.smk" | ||
config: | ||
config | ||
|
||
|
||
use rule * from default_rules as default_* | ||
|
||
|
||
# Rules | ||
rule all: | ||
input: | ||
"quantized_matmul.x", | ||
"tiled_quantized_matmul.x", | ||
run: | ||
for item in input: | ||
shell("{config[vltsim]} {item}") | ||
|
||
|
||
rule generate_quantized_matmul: | ||
output: | ||
"quantized_matmul.mlir", | ||
script: | ||
"quantized_matmul.py" | ||
|
||
|
||
rule generate_tiled_quantized_matmul: | ||
output: | ||
"tiled_quantized_matmul.transform.mlir", | ||
script: | ||
"tiled_quantized_matmul.py" | ||
|
||
|
||
rule apply_transforms_mlir: | ||
input: | ||
"{file}.transform.mlir", | ||
output: | ||
"{file}.mlir", | ||
shell: | ||
"{config[mlir-opt]} {config[mlirtransformflags]} -o {output} {input}" | ||
|
||
|
||
rule link_snax_binary: | ||
input: | ||
"{file}.o", | ||
"main.o", | ||
output: | ||
"{file}.x", | ||
shell: | ||
"{config[ld]} {config[ldflags]} {input} -o {output}" |