MFlowCode / MFC

Exascale simulation of multiphase/physics fluid dynamics
https://mflowcode.github.io
MIT License
132 stars 56 forks source link

Fix for issue #395 #414

Closed okBrian closed 1 month ago

okBrian commented 1 month ago

Description

Fixed the clarity issue for the CI benchmark comparison message when comparing a PR and master.

Example:

Fixes #395

Type of change

Scope

How Has This Been Tested?

Not sure how to run the diff benchmark comparison without the github runner

Test Configuration:

Compiled on a

Ubuntu 22.04.4 using Docker Intel i7-1165G7

Checklist

If your code changes any code source files (anything in src/simulation)

To make sure the code is performing as expected on GPU devices, I have:

sbryngelson commented 1 month ago

@henryleberre can confirm but I think this might be backwards. lhs -> master and rhs -> PR.

If the variable speedup below is > 1 then master is slower than then PR.

If the variable speedup below is < 1 then PR is slower than master.

At least that's my read of the code...

Code:

https://github.com/MFlowCode/MFC/blob/f23fceb103412864a9846fd75fdc13261699e147/toolchain/mfc/args.py#L135-L138

https://github.com/MFlowCode/MFC/blob/f23fceb103412864a9846fd75fdc13261699e147/.github/workflows/bench.yml#L38

https://github.com/MFlowCode/MFC/blob/64d9677e58f26a157e207afbdcc705e5cab90c7f/toolchain/mfc/bench.py#L108-L122

and your code says:

cons.print(f"[bold]\t1.5x indicates [magenta]{os.path.relpath(ARG('rhs'))}[/magenta] is 1.5-times as fast as [magenta]{os.path.relpath(ARG('lhs'))}[/magenta] (so [magenta]{os.path.relpath(ARG('rhs'))}[/magenta] is faster than [magenta]{os.path.relpath(ARG('lhs'))}[/magenta]).[/bold]")

henryleberre commented 1 month ago

Let's consider an example:

$ ./mfc.sh bench_diff lhs rhs

where lhs and rhs are YAML files. By the way, "lhs" and "rhs" just stand for "left-hand side" and "right-hand side". We could maybe opt for better names.

Say that for a given example case, you have:

     simulation
lhs:    1.0s
rhs:    0.5s 

So, $\frac{\text{lhs}}{\text{rhs}}=\frac{1.0}{0.5}=2$. So $\frac{\text{lhs}}{\text{rhs}}$ is the speedup going from lhs to rhs. In other words, lhs is what you are comparing rhs to. This implies that the text I had written and the text @okBrian wrote are both correct, although mine was worded in a way that might be confusing. It was like "LHS is X times SLOWER than RHS" rather than "RHS is X times FASTER than LHS" (@okBrian's version).

As a sidenote, there are a lot of cons.write calls that follow each other. These can be joined to be more readable like:


cons.write(f"""\
Line 1
Line 2
""")
sbryngelson commented 1 month ago

There should just be a line of text above the results that says "numbers < 1 indicate the PR is faster than master, > 1 indicate PR is slower" (if that is actually the case)

sbryngelson commented 1 month ago

PR merges are on hold until benchmark CI is working (issue #419)

henryleberre commented 1 month ago

@okBrian Why did you revert with 1e30c18 ?

okBrian commented 1 month ago

The past few tests have either failed or have the wrong output so I'm just making sure that's not the issue.

sbryngelson commented 1 month ago

@okBrian please sync your branch with master, which I just merged to (that's why your current CI tests are failing)

sbryngelson commented 1 month ago

CI benchmarking is failing and it seems related to this PR

sbryngelson commented 1 month ago

This might need another merge with master