Skip to content

Conversation

@dssgabriel
Copy link

This PR adds support for computational work (FLOP) and computational performance (FLOP per second) units.

This lets us do, e.g., the following calculations:

$ cpc '10 zflop / 100 pflop per second'
1.15740740740740740740740740740740740741 days

$ cpc '7 * 1024 * 2048 * 128 flop/s * 3 s in megaflop'
5637.144576 megaFLOP

$ cpc '3 teraflops * 5 min'
900 teraFLOP

$ cpc '1.7 exaflops / 14 petaflops'
121.428571428571428571428571428571428571

FLOP⁠—Floating-point Operation⁠—(computational work) is always singular, and FLOPs⁠—Floating-point Operations per second⁠—(computational performance) is always plural. Since "FLOPs" is often used as an abbreviation for "FLOP/s", I allowed the syntax for convenience (similarly to how we can write "bps" for data rates).


I found myself often wanting to compute stuff with FLOP/s to calculate scientific kernel performance or speedups between benchmark versions, so I figured I would contribute my changes. 🙂

Add support for computational work (FLOP) and computational performance
(FLOP per second) units.
@probablykasper
Copy link
Owner

Awesome!

I think the UnitType should just be Flops. Otherwise we would have trouble adding something like integer OPS, since that's also a unit of computational work, but not compatible with Flops

@dssgabriel
Copy link
Author

I think the UnitType should just be Flops.

Do you mean simply renaming the FLOP computational work unit to Flops (and maybe describing it as floating-point computational work)?

@probablykasper
Copy link
Owner

Yeah, unless you have a better term

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