-
Notifications
You must be signed in to change notification settings - Fork 17
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
PIMbench Min/max Reduce API #190
base: main
Are you sure you want to change the base?
Conversation
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.
The code needs to be merged with the latest main branch
c72c3b0
to
6ec224b
Compare
I tired to fix the unspecified error by casting float to pimRedMax/Min execution. (since we are using void* unlike specified types from redSum implementation.) Feels a bit dangerous. Also, the major blocker is that I can't figure out why I'm having error: ‘pimCmdRedSum’ was not declared in this scope; did you mean ‘pimRedSum’? This is from redSum but I didn't change the redSum implementation. As this is currently the only error that I'm having. |
c0a4906
to
4eb042c
Compare
Co-authored-by: Farzana Ahmed Siddique <fas9nw@virginia.edu>
Co-authored-by: Farzana Ahmed Siddique <fas9nw@virginia.edu>
Co-authored-by: Farzana Ahmed Siddique <fas9nw@virginia.edu>
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.
I like the new code design. Thanks for the effort!
I haven't reviewed all details, but I left some comments for further improvements.
libpimeval/src/pimSim.cpp
Outdated
if (idxBegin != idxEnd && idxBegin < idxEnd) pimPerfMon perfMon("pimRedMinRanged"); | ||
else pimPerfMon perfMon("pimRedMin"); |
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.
if (idxBegin != idxEnd && idxBegin < idxEnd) pimPerfMon perfMon("pimRedMinRanged"); | |
else pimPerfMon perfMon("pimRedMin"); | |
std::string tag = (idxBegin != idxEnd && idxBegin < idxEnd) ? "pimRedMinRanged" : "pimRedMin"; | |
pimPerfMon perfMon(tag); |
Please note that pimPerfMon is an on-stack object and its ctor-to-dtor lifetime needs to cover entire operation.
libpimeval/src/pimSim.cpp
Outdated
if (idxBegin != idxEnd && idxBegin < idxEnd) pimPerfMon perfMon("pimRedMaxRanged"); | ||
else pimPerfMon perfMon("pimRedMax"); |
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.
if (idxBegin != idxEnd && idxBegin < idxEnd) pimPerfMon perfMon("pimRedMaxRanged"); | |
else pimPerfMon perfMon("pimRedMax"); | |
std::string tag = (idxBegin != idxEnd && idxBegin < idxEnd) ? "pimRedMaxRanged" : "pimRedMax"; | |
pimPerfMon perfMon(tag); |
libpimeval/src/pimSim.cpp
Outdated
if (idxBegin != idxEnd && idxBegin < idxEnd) pimPerfMon perfMon("pimRedSumRanged"); | ||
else pimPerfMon perfMon("pimRedSum"); |
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.
if (idxBegin != idxEnd && idxBegin < idxEnd) pimPerfMon perfMon("pimRedSumRanged"); | |
else pimPerfMon perfMon("pimRedSum"); | |
std::string tag = (idxBegin != idxEnd && idxBegin < idxEnd) ? "pimRedSumRanged" : "pimRedSum"; | |
pimPerfMon perfMon(tag); |
#include "pimCmd.h" | ||
#include "pimSim.h" | ||
#include "pimDevice.h" | ||
#include "pimCore.h" | ||
#include "pimResMgr.h" | ||
#include <cstdio> | ||
#include <cmath> | ||
#include <unordered_map> | ||
#include <unordered_set> | ||
#include <climits> | ||
#include <cmath> |
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.
#include "pimCmd.h" | |
#include "pimSim.h" | |
#include "pimDevice.h" | |
#include "pimCore.h" | |
#include "pimResMgr.h" | |
#include <cstdio> | |
#include <cmath> | |
#include <unordered_map> | |
#include <unordered_set> | |
#include <climits> | |
#include <cmath> | |
#include <cmath> | |
#include <climits> |
} | ||
} | ||
currIdx += 1; | ||
} | ||
return true; | ||
} | ||
|
||
//! @brief PIM CMD: redsum non-ranged/ranged - update stats |
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.
Please revert this deletion
{ | ||
// Reduction tree approach for min/max | ||
unsigned levels = static_cast<unsigned>(std::ceil(std::log2(numElements))); // Tree depth | ||
pimeval::perfEnergy perfEnergyBS = getPerfEnergyBitSerial(m_simTarget, PimCmdEnum::MIN, dataType, bitsPerElement, numPass, obj); |
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.
We need to add an entry for reduction Min/Max in the bitserial table and then cmdType
should be passed.
Implemented min/max reduce and added pimCmdReduction for sum min max all in one. (ideally).