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

Adding Spatter #1136

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open

Adding Spatter #1136

wants to merge 3 commits into from

Conversation

mahyarsamani
Copy link
Contributor

@mahyarsamani mahyarsamani commented May 15, 2024

This PR adds source code for C++ implementation of SpatterGen as well as SpatterKernel. SpatterGen uses a PyBindMethod to add kernels to the backend code. This way the process of processing json files could be offloaded to python. In addition it adds standard library components for SpatterGenCore and SpatterGen. These two components follow the same structure as AbstractCore and AbstractProcessor. In addition spatter_kernel.py adds a definition for SpatterKernel in python to make adding kernels to C++ easier. Also it adds utility functions for parsing dictionaries read from json as well as partitioning traces for multicore setups.

@mahyarsamani mahyarsamani marked this pull request as draft May 15, 2024 03:49
@mahyarsamani mahyarsamani changed the base branch from stable to develop May 15, 2024 03:50
@powerjg
Copy link
Contributor

powerjg commented May 15, 2024

I know this is a draft, but a few quick comments:

  1. You need to add copyright blocks
  2. The names should be something more descriptive than "model"
  3. The commit message and the PR description need to have details

@ivanaamit ivanaamit added this to the v24.0 milestone May 21, 2024
src/base/stats/units.hh Outdated Show resolved Hide resolved
@mahyarsamani mahyarsamani changed the title Spatter Adding Spatter May 28, 2024
@mahyarsamani mahyarsamani requested a review from powerjg May 28, 2024 07:20
@mahyarsamani mahyarsamani marked this pull request as ready for review May 28, 2024 07:20
@giactra giactra self-requested a review May 28, 2024 10:28
Copy link
Contributor

@powerjg powerjg left a comment

Choose a reason for hiding this comment

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

Overall, this looks great. I didn't check the logic carefully in spatter_gen.cc, but I trust you've tested this and compared with upstream spatter.

Most of my comments are style. The only "big" thing that I would like to see changed is moving the state information into the SpatterGen class to make it private.

One thing to keep in mind when pushing code upstream is that you should try to make things as self-contained as possible. Don't expose things publicly unless absolutely required.

Finally, there are some places where you need to add more documentation. Think about how someone would discover how to use this if they don't know anything about Spatter and they are not involved in our project.

src/cpu/testers/spatter_gen/SpatterGen.py Outdated Show resolved Hide resolved
src/cpu/testers/spatter_gen/SpatterGen.py Outdated Show resolved Hide resolved
src/cpu/testers/spatter_gen/SpatterGen.py Outdated Show resolved Hide resolved
src/cpu/testers/spatter_gen/SpatterGen.py Outdated Show resolved Hide resolved
src/cpu/testers/spatter_gen/SpatterGen.py Outdated Show resolved Hide resolved
src/cpu/testers/spatter_gen/spatter_gen.cc Outdated Show resolved Hide resolved
src/cpu/testers/spatter_gen/spatter_gen.cc Outdated Show resolved Hide resolved
src/cpu/testers/spatter_gen/spatter_gen.cc Outdated Show resolved Hide resolved
src/cpu/testers/spatter_gen/spatter_gen.cc Outdated Show resolved Hide resolved
src/cpu/testers/spatter_gen/spatter_gen.cc Outdated Show resolved Hide resolved
@mahyarsamani
Copy link
Contributor Author

@powerjg @giactra
Still working on addressing some comments. Will fix by tomorrow.

@mahyarsamani mahyarsamani force-pushed the spatter branch 4 times, most recently from 01e29f7 to 26c79d0 Compare May 29, 2024 22:41
src/cpu/testers/spatter_gen/spatter_gen.cc Outdated Show resolved Hide resolved
src/cpu/testers/spatter_gen/spatter_gen.cc Outdated Show resolved Hide resolved
src/cpu/testers/spatter_gen/spatter_gen.cc Outdated Show resolved Hide resolved
src/cpu/testers/spatter_gen/spatter_gen.hh Outdated Show resolved Hide resolved
@mahyarsamani mahyarsamani force-pushed the spatter branch 3 times, most recently from 3af10ab to a918732 Compare June 1, 2024 01:31
Copy link
Contributor

@powerjg powerjg left a comment

Choose a reason for hiding this comment

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

A few more little things

src/cpu/testers/spatter_gen/spatter_gen.cc Outdated Show resolved Hide resolved
src/cpu/testers/spatter_gen/spatter_gen.cc Show resolved Hide resolved
src/cpu/testers/spatter_gen/spatter_gen.hh Outdated Show resolved Hide resolved
src/cpu/testers/spatter_gen/spatter_gen.hh Show resolved Hide resolved
src/cpu/testers/spatter_gen/spatter_gen.hh Show resolved Hide resolved
@mahyarsamani mahyarsamani force-pushed the spatter branch 4 times, most recently from 290cf4c to cd6aa29 Compare June 7, 2024 00:08
This change adds source code for SpatterGen ClockedObject.
The set of source code pushed includes code for SpatterKernel
that tracks whether information is being gathered or scattered
as well as the list of indices to be accessed. This model
has PyBindMethod to add SpatterKernels from python.
This way all the preparations for kernels can be done in python.
SpatterGen has a few parameters that model limits on a few of
hardware resources in the backend of a processor, e.g. number
of functional units to calculate effective address, the latency
of calculating effective address, number of integer registers.

Change-Id: I451ffb385180a914e884cab220928c5f1944b2e3
This change adds code for SpatterGenCore and SpatterGen as well
as SpatterKernel to the standard library. SpatterGenCore and
SpatterGen follow the same structure as AbstractCore and
AbstractProcessor. spatter_kernel.py adds utility functions
to parse dictionaries as well as partition a list into
multiple lists through interleaving to be used when setting up
a multicore SpatterGen.

Change-Id: I003553e97f901c0724f5feac0bb6e21a020bd6ad
Copy link
Contributor

@powerjg powerjg left a comment

Choose a reason for hiding this comment

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

Looks good to me. Thanks for the updates!

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.

None yet

3 participants