Skip to content

Support new prefetching methodology for stride prefetcher - #7

Open
SabaJamilan wants to merge 2 commits into
stanford-mast:memtracefrom
SabaJamilan:memtrace
Open

Support new prefetching methodology for stride prefetcher#7
SabaJamilan wants to merge 2 commits into
stanford-mast:memtracefrom
SabaJamilan:memtrace

Conversation

@SabaJamilan

@SabaJamilan SabaJamilan commented Feb 15, 2019

Copy link
Copy Markdown

No description provided.

@hlitz hlitz left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hi Saba,
thanks for your patch!
The code does not compile on my side. Also added 6 nits. Please fix and send another pull request.

--
build/opt/trace_init.cpp: In function ‘CacheGroup* BuildCacheGroup(Config&, const string&, bool)’:
build/opt/trace_init.cpp:435:73: error: no matching function for call to ‘StreamPrefetcher::StreamPrefetcher(g_string&, uint32_t&, uint32_t&, uint32_t&)’
log_distance, degree);
^
In file included from build/opt/trace_init.cpp:59:0:
build/opt/prefetcher.h:132:18: note: candidate: StreamPrefetcher::StreamPrefetcher(const g_string&, uint32_t, uint32_t, uint32_t, const g_string&)
explicit StreamPrefetcher(const g_string& _name,
^~~~~~~~~~~~~~~~
build/opt/prefetcher.h:132:18: note: candidate expects 5 arguments, 4 provided
In file included from build/opt/trace_init.cpp:59:0:
build/opt/prefetcher.h:68:7: note: candidate: StreamPrefetcher::StreamPrefetcher(const StreamPrefetcher&)
class StreamPrefetcher : public BaseCache{
^~~~~~~~~~~~~~~~
build/opt/prefetcher.h:68:7: note: candidate expects 1 argument, 4 provided
build/opt/prefetcher.h:68:7: note: candidate: StreamPrefetcher::StreamPrefetcher(StreamPrefetcher&&)
build/opt/prefetcher.h:68:7: note: candidate expects 1 argument, 4 provided
scons: *** [build/opt/trace_init.o] Error 1
scons: building terminated because of errors.

Comment thread src/cache_arrays.cpp
profPrefSavedCycles.inc(array[id].availCycle - array[id].startCycle);
}
}
//line is in flight, compensate for potential OOO

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

NIT: no reason for this, please revert

Comment thread src/cache_arrays.cpp
profPrefHit.inc();
}
array[id].prefetch = false;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

NIT: no reason for this, please revert

Comment thread src/cache_arrays.cpp
uint32_t candidate = rp->rankCands(req, SetAssocCands(first, first+assoc));

*wbLineAddr = array[candidate].addr;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

NIT: no reason for this, please revert

Comment thread src/cache_arrays.cpp
#include "cache_arrays.h"
#include "hash.h"
#include "repl_policies.h"
#include <inttypes.h>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

not clear why these are needed. There should be no changes to cache_arrays.cpp in this pull request.

Comment thread src/prefetcher.cpp
profStrideSwitches.init("strideSwitches", "Predicted stride switches"); s->append(&profStrideSwitches);
profLowConfAccs.init("lcAccs", "Low-confidence accesses with no prefetches"); s->append(&profLowConfAccs);
parentStat->append(s);
prof_emitted_prefetches_.init("pff", "Total prefetches emitted");

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

NIT: identation

Comment thread src/prefetcher.h
* FIXME: For now, mostly hardcoded; 64-line entries (4KB w/64-byte lines), fixed granularities, etc.
* TODO: Adapt to use weave models
*/
class StreamPrefetcher : public BaseCache {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

NIT: leave spacing

Comment thread src/prefetcher.cpp Outdated
//#define DBG(args...) info(args)
#define DBG(args...)

void StreamPrefetcher::postInit() {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

why is this copied from basecache? This class should just inherit from basecache.

@SabaJamilan

Copy link
Copy Markdown
Author

Hi Heiner,
I removed the nits that you mentioned before. Also, the new stream prefetcher inherits postInit, setParent, ... from the cache prefetcher class.
I added the changes to trace_init.cpp and I think it would be work now on your side.
Thanks,
Saba

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