Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run simulations in parallel #347

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
28 changes: 22 additions & 6 deletions kernels/alloc/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,30 @@ module default_rules:
config


rule all:
input:
"func.x",
shell:
"{config[vltsim]} {input[0]}"
use rule * from default_rules as default_*


use rule * from default_rules exclude compile_simple_main as default_*
module snax_rules:
snakefile:
"../../util/snake/snax.smk"
config:
config


use rule * from snax_rules as snax_*


files = ["func"]


rule all:
input:
expand(
"{file}_trace_chip_{num_chips:02d}_hart_{num_harts:05d}.dasm",
file=files,
num_chips=range(config["num_chips"]),
num_harts=range(config["num_harts"]),
),


rule compile_snax_binary:
Expand Down
22 changes: 19 additions & 3 deletions kernels/gemm/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,16 @@ module default_rules:
use rule * from default_rules as default_*


module snax_rules:
snakefile:
"../../util/snake/snax.smk"
config:
config


use rule * from snax_rules as snax_*


rule compile_main:
input:
"main.c",
Expand All @@ -49,11 +59,17 @@ rule compile_main:
"{config[cc]} {config[cflags]} -c {input[0]}"


files = ["gemm"]


rule all:
input:
"gemm.x",
shell:
"{config[vltsim]} {input[0]}"
expand(
"{file}_trace_chip_{num_chips:02d}_hart_{num_harts:05d}.dasm",
file=files,
num_chips=range(config["num_chips"]),
num_harts=range(config["num_harts"]),
),


from gendata import create_data_files
Expand Down
22 changes: 19 additions & 3 deletions kernels/rescale/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,16 @@ module default_rules:
use rule * from default_rules as default_*


module snax_rules:
snakefile:
"../../util/snake/snax.smk"
config:
config


use rule * from snax_rules as snax_*


rule link_snax_binary:
input:
"rescale.o",
Expand All @@ -44,11 +54,17 @@ rule link_snax_binary:
"{config[ld]} {config[ldflags]} {input} -o {output}"


files = ["rescale"]


rule all:
input:
"rescale.x",
shell:
"{config[vltsim]} {input[0]}"
expand(
"{file}_trace_chip_{num_chips:02d}_hart_{num_harts:05d}.dasm",
file=files,
num_chips=range(config["num_chips"]),
num_harts=range(config["num_harts"]),
),


from gendata import create_data_files
Expand Down
22 changes: 19 additions & 3 deletions kernels/simple_copy/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,28 @@ module default_rules:
use rule * from default_rules as default_*


module snax_rules:
snakefile:
"../../util/snake/snax.smk"
config:
config


use rule * from snax_rules as snax_*


files = ["simple_copy"]


# Rules
rule all:
input:
"simple_copy.x",
shell:
"{config[vltsim]} {input[0]}"
expand(
"{file}_trace_chip_{num_chips:02d}_hart_{num_harts:05d}.dasm",
file=files,
num_chips=range(config["num_chips"]),
num_harts=range(config["num_harts"]),
),


rule compile_main:
Expand Down
25 changes: 19 additions & 6 deletions kernels/streamer_alu/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,27 @@ module default_rules:
use rule * from default_rules as default_*


# Rules
module snax_rules:
snakefile:
"../../util/snake/snax.smk"
config:
config


use rule * from snax_rules as snax_*


files = ["streamer_add", "streamer_add_stream"]


rule all:
input:
"streamer_add.x",
"streamer_add_stream.x",
run:
for item in input:
shell("{config[vltsim]} {item}")
expand(
"{file}_trace_chip_{num_chips:02d}_hart_{num_harts:05d}.dasm",
file=files,
num_chips=range(config["num_chips"]),
num_harts=range(config["num_harts"]),
),


from gendata import create_data_files
Expand Down
24 changes: 19 additions & 5 deletions kernels/streamer_matmul/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,31 @@ module default_rules:
config


module snax_rules:
snakefile:
"../../util/snake/snax.smk"
config:
config


use rule * from default_rules as default_*


use rule * from snax_rules as snax_*


files = ["quantized_matmul", "tiled_quantized_matmul"]


# Rules
rule all:
input:
"quantized_matmul.x",
"tiled_quantized_matmul.x",
run:
for item in input:
shell("{config[vltsim]} {item}")
expand(
"{file}_trace_chip_{num_chips:02d}_hart_{num_harts:05d}.dasm",
file=files,
num_chips=range(config["num_chips"]),
num_harts=range(config["num_harts"]),
),


rule generate_quantized_matmul:
Expand Down
17 changes: 13 additions & 4 deletions kernels/tiled_add/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,16 @@ module default_rules:
use rule * from default_rules as default_*


module snax_rules:
snakefile:
"../../util/snake/snax.smk"
config:
config


use rule * from snax_rules as snax_*


rule size_mlir:
input:
"{file}.mlir",
Expand Down Expand Up @@ -123,15 +133,14 @@ COMPILER_OPTS = ["accfgboth", "noaccfgopt"]
rule all:
input:
expand(
"{file}_{array_size}_{tile_size}_{compiler_opt}.x",
"{file}_{array_size}_{tile_size}_{compiler_opt}_trace_chip_{num_chips:02d}_hart_{num_harts:05d}.dasm",
file=FILES,
array_size=ARRAY_SIZES,
tile_size=TILE_SIZES,
compiler_opt=COMPILER_OPTS,
num_chips=range(config["num_chips"]),
num_harts=range(config["num_harts"]),
),
run:
for item in input:
shell("{config[vltsim]} {item}")


from gendata import generate_data
Expand Down
25 changes: 18 additions & 7 deletions kernels/transform_copy/Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,30 @@ module default_rules:
use rule * from default_rules as default_*


module snax_rules:
snakefile:
"../../util/snake/snax.smk"
config:
config


use rule * from snax_rules as snax_*


from gendata import create_files

files = ["transform_copy", "transform_from_none", "transform_from_strided"]


# Rules
rule all:
input:
"transform_copy.x",
"transform_from_none.x",
"transform_from_strided.x",
run:
shell("{config[vltsim]} {input[0]} {input[0]}")
shell("{config[vltsim]} {input[1]} {input[1]}")
shell("{config[vltsim]} {input[2]} {input[2]}")
expand(
"{file}_trace_chip_{num_chips:02d}_hart_{num_harts:05d}.dasm",
file=files,
num_chips=range(config["num_chips"]),
num_harts=range(config["num_harts"]),
),


rule generate_data:
Expand Down
Loading
Loading