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

Merged
merged 18 commits into from
Jan 24, 2025
Merged

Run simulations in parallel #347

merged 18 commits into from
Jan 24, 2025

Conversation

JosseVanDelm
Copy link
Contributor

This adds --prefix-trace support and several utilities to handle the quite difficult naming scheme provided by the simulation tracer.

@jorendumoulin
Copy link
Contributor

jorendumoulin commented Jan 24, 2025

I'm sorry to be so annoying for this, but I don't like that we need to specify all of the dasm targets in every test separately, this isn't very easy to understand.
Could we maybe already complete the chain like this?

   rule: simulate    rule: trace    rule: aggregate_json 
                                                         
                                                         
     ┌───► .._0.dasm  ────►  .._0.json ───────►          
     │                                                   
     │ ┌─► .._1.dasm  ────►  .._1.json ───────► file.json
file.x │                                                 
      │    .._2.dasm ─────►  .._2.json  ──────►          
      └───►                                              

Such that all of the rules in the downstream Snakefiles simplify to:

rule all:
    input: file.json

@JosseVanDelm
Copy link
Contributor Author

@jorendumoulin that is a great idea! I'll work on it!

Comment on lines 42 to 53
module snax_rules:
snakefile:
"../../util/snake/snax.smk"
config:
config


use rule * from snax_rules as snax_*


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one small nit: can we import default_rules in snax_rules such that we don't need two imports here? I feel that would be more intuitive and less code

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a very good suggestion! It hadn't crossed my mind yet :) . I'll try to see if that works!

@JosseVanDelm JosseVanDelm force-pushed the Josse/parallel-simulation branch from 87a8183 to 576a518 Compare January 24, 2025 16:23
Copy link
Contributor

@jorendumoulin jorendumoulin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yay 😍

# use CONDA_PREFIX to access pixi env
gen_trace_path = f"{os.environ['CONDA_PREFIX']}/snax-utils/gen_trace.py"
return {
"python": "python",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this snax-specific?

@@ -6,3 +9,13 @@ def get_default_paths() -> dict[str, str]:
"mlir-translate": "mlir-translate",
"snax-opt": "snax-opt",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this not snax-specific?

"gemm.x",
shell:
"{config[vltsim]} {input[0]}"
expand("{file}_aggregated.json", file=files),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
expand("{file}_aggregated.json", file=files),
expand("{file}_traces.json", file=files),

?

@JosseVanDelm JosseVanDelm merged commit f5fb6a3 into main Jan 24, 2025
14 checks passed
@JosseVanDelm JosseVanDelm deleted the Josse/parallel-simulation branch January 24, 2025 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants