-
Notifications
You must be signed in to change notification settings - Fork 177
Add basic transform benchmarking infrastructure and speed up Resolve Kinds #1475
Conversation
69e4d06
to
5148c7f
Compare
5148c7f
to
15134df
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jackkoenig, I rebased this past the split of the Resolves file and made the find_port
API change part of a separate commit so only that commit and the type alias change need to be modified in cherry-pick.
I tried this out and I really like it. I'm assuming you relied on this for #1582 and the like?
I think you mean |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the silly ping-pong on the reviews, but I just wanted to make sure I had the usage instructions right before final approval. I tested it out myself but neglected to follow up and comment on this.
I think your code snippet from the top may be out of date (sbt /
vs. :
and missing -cp
flag for java). I imagine that going forward (when there will be multiple benchmarks apps), the right way to run this will be:
sbt benchmark/assembly
java -Xmx8G -cp utils/bin/firrtl-benchmark.jar firrtl.benchmark.hot.ResolveKindsBenchmark <design> 10 10
Yep, it's been very useful. I also have some JMH stuff that I want to add, although it is not great for benchmarking anything that runs very long. A good tool to have in the toolbox nonetheless.
I think you're right, my bad I'll note that this PR is not backportable because it changes the API of `ResolveKinds'. I redid it locally to make it backportable and I can either force push over this PR or push to a new branch. |
Resolution: we'll just keep it the desired way for 1.4 and beyond, and we'll modify the PR for backportability. |
…Kinds (bp #1475) (#1622) * Add benchmark for ResolveKinds with hot JIT * Use HashMap instead of LinkedHashMap in ResolveKinds * Modify to deprecate old methods for backport (cherry picked from commit 0f78e2d) Co-authored-by: Albert Magyar <albert.magyar@gmail.com> * Eliminate unnecessary traversals in ResolveKinds * Modify for backporting * Make find_port return Unit and use Foreachers in ResolveKinds * Modify for backporting Co-authored-by: Jack Koenig <koenig@sifive.com> Co-authored-by: Albert Magyar <albert.magyar@gmail.com>
* Use HashMap instead of LinkedHashMap in ResolveKinds * Backport to 1.2.x (cherry picked from commit 0f78e2d) Co-authored-by: Albert Magyar <albert.magyar@gmail.com> * Eliminate unnecessary traversals in ResolveKinds * Modify for backporting * Make find_port return Unit and use Foreachers in ResolveKinds * Modify for backporting Co-authored-by: Jack Koenig <koenig@sifive.com>
This is the first in a larger effort I'm working on to eliminate low hanging fruit performance issues. This is primarily a proof of concept and to show that even in seemingly simple passes we have pretty obvious room for performance improvement.
Resolve Kinds Benchmarking
I would appreciate someone checking my numbers, perhaps using BOOM or some large design from Chipyard.
These numbers were collected by running
sbt benchmark:assembly
then running using the fat jar.Times in milliseconds
Contributor Checklist
Type of Improvement
API Impact
Technically this changes some APIs in
ResolveKinds
. This isn't backportable so maybe I should do this by copying the code and modifying the copy then deprecating the oldResolveKinds
?Backend Code Generation Impact
None
Desired Merge Strategy
Reviewer Checklist (only modified by reviewer)
Please Merge
?