aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md5
-rw-r--r--aerialvision/guiclasses.py3
-rw-r--r--src/gpgpu-sim/gpu-cache.cc5
-rw-r--r--src/gpgpu-sim/gpu-cache.h27
-rw-r--r--src/gpgpu-sim/shader.cc4
-rw-r--r--src/gpgpu-sim/shader.h5
6 files changed, 44 insertions, 5 deletions
diff --git a/README.md b/README.md
index b56d5eb..96c1d15 100644
--- a/README.md
+++ b/README.md
@@ -257,15 +257,16 @@ To clean the docs run
The documentation resides at doc/doxygen/html.
+To run Pytorch applications with the simulator, install the modified Pytorch library as well by following instructions [here](https://github.com/gpgpu-sim/pytorch-gpgpu-sim).
## Step 3: Run
Before we run, we need to make sure the application's executable file is dynamically linked to CUDA runtime library. This can be done during compilation of your program by introducing the nvcc flag "--cudart shared" in makefile (quotes should be excluded).
To confirm the same, type the follwoing command:
-ldd <your_application_name>
+`ldd <your_application_name>`
-You should see that your application is using libcudart.so file in GPGPUSim directory.
+You should see that your application is using libcudart.so file in GPGPUSim directory. If the application is a Pytorch application, `<your_application_name>` should be `$PYTORCH_BIN`, which should be set during the Pytorch installation.
If running applications which use cuDNN or cuBLAS:
diff --git a/aerialvision/guiclasses.py b/aerialvision/guiclasses.py
index 45fed26..04036a8 100644
--- a/aerialvision/guiclasses.py
+++ b/aerialvision/guiclasses.py
@@ -1365,7 +1365,8 @@ class graphManager:
interpolation = 'nearest'
norm = plotFormat.norm
im = self.plot.imshow(y, cmap = cmap, interpolation = interpolation, aspect = 'auto', norm = norm )
- tmp = im.get_axes().get_position().get_points()
+ # tmp = im.get_axes().get_position().get_points()
+ tmp = im.get_window_extent().get_points()
if (plotID in self.cbarAxes):
self.figure.delaxes(self.cbarAxes[plotID])
diff --git a/src/gpgpu-sim/gpu-cache.cc b/src/gpgpu-sim/gpu-cache.cc
index 613403a..177a6d9 100644
--- a/src/gpgpu-sim/gpu-cache.cc
+++ b/src/gpgpu-sim/gpu-cache.cc
@@ -1456,16 +1456,19 @@ enum cache_request_status data_cache::wr_miss_wa_lazy_fetch_on_read(
m_tag_array->access(block_addr, time, cache_index, wb, evicted, mf);
assert(m_status != HIT);
cache_block_t *block = m_tag_array->get_block(cache_index);
- block->set_status(MODIFIED, mf->get_access_sector_mask());
if (m_status == HIT_RESERVED) {
block->set_ignore_on_fill(true, mf->get_access_sector_mask());
block->set_modified_on_fill(true, mf->get_access_sector_mask());
+ } else {
+ block->set_status(MODIFIED, mf->get_access_sector_mask());
}
if (mf->get_access_byte_mask().count() == m_config.get_atom_sz()) {
block->set_m_readable(true, mf->get_access_sector_mask());
} else {
block->set_m_readable(false, mf->get_access_sector_mask());
+ if (m_status == HIT_RESERVED)
+ block->set_readable_on_fill(true, mf->get_access_sector_mask());
}
if (m_status != RESERVATION_FAIL) {
diff --git a/src/gpgpu-sim/gpu-cache.h b/src/gpgpu-sim/gpu-cache.h
index 17c8c02..26369c3 100644
--- a/src/gpgpu-sim/gpu-cache.h
+++ b/src/gpgpu-sim/gpu-cache.h
@@ -129,6 +129,8 @@ struct cache_block_t {
mem_access_sector_mask_t sector_mask) = 0;
virtual void set_modified_on_fill(bool m_modified,
mem_access_sector_mask_t sector_mask) = 0;
+ virtual void set_readable_on_fill(bool readable,
+ mem_access_sector_mask_t sector_mask) = 0;
virtual unsigned get_modified_size() = 0;
virtual void set_m_readable(bool readable,
mem_access_sector_mask_t sector_mask) = 0;
@@ -148,6 +150,7 @@ struct line_cache_block : public cache_block_t {
m_status = INVALID;
m_ignore_on_fill_status = false;
m_set_modified_on_fill = false;
+ m_set_readable_on_fill = false;
m_readable = true;
}
void allocate(new_addr_type tag, new_addr_type block_addr, unsigned time,
@@ -160,12 +163,16 @@ struct line_cache_block : public cache_block_t {
m_status = RESERVED;
m_ignore_on_fill_status = false;
m_set_modified_on_fill = false;
+ m_set_readable_on_fill = false;
}
void fill(unsigned time, mem_access_sector_mask_t sector_mask) {
// if(!m_ignore_on_fill_status)
// assert( m_status == RESERVED );
m_status = m_set_modified_on_fill ? MODIFIED : VALID;
+
+ if (m_set_readable_on_fill)
+ m_readable = true;
m_fill_time = time;
}
@@ -198,6 +205,10 @@ struct line_cache_block : public cache_block_t {
mem_access_sector_mask_t sector_mask) {
m_set_modified_on_fill = m_modified;
}
+ virtual void set_readable_on_fill(bool readable,
+ mem_access_sector_mask_t sector_mask) {
+ m_set_readable_on_fill = readable;
+ }
virtual unsigned get_modified_size() {
return SECTOR_CHUNCK_SIZE * SECTOR_SIZE; // i.e. cache line size
}
@@ -219,6 +230,7 @@ struct line_cache_block : public cache_block_t {
cache_block_state m_status;
bool m_ignore_on_fill_status;
bool m_set_modified_on_fill;
+ bool m_set_readable_on_fill;
bool m_readable;
};
@@ -233,6 +245,7 @@ struct sector_cache_block : public cache_block_t {
m_status[i] = INVALID;
m_ignore_on_fill_status[i] = false;
m_set_modified_on_fill[i] = false;
+ m_set_readable_on_fill[i] = false;
m_readable[i] = true;
}
m_line_alloc_time = 0;
@@ -262,6 +275,7 @@ struct sector_cache_block : public cache_block_t {
m_status[sidx] = RESERVED;
m_ignore_on_fill_status[sidx] = false;
m_set_modified_on_fill[sidx] = false;
+ m_set_readable_on_fill[sidx] = false;
// set line stats
m_line_alloc_time = time; // only set this for the first allocated sector
@@ -284,6 +298,8 @@ struct sector_cache_block : public cache_block_t {
else
m_set_modified_on_fill[sidx] = false;
+ m_set_readable_on_fill[sidx] = false;
+
m_status[sidx] = RESERVED;
m_ignore_on_fill_status[sidx] = false;
// m_set_modified_on_fill[sidx] = false;
@@ -301,6 +317,11 @@ struct sector_cache_block : public cache_block_t {
// assert( m_status[sidx] == RESERVED );
m_status[sidx] = m_set_modified_on_fill[sidx] ? MODIFIED : VALID;
+
+ if (m_set_readable_on_fill[sidx]) {
+ m_readable[sidx] = true;
+ m_set_readable_on_fill[sidx] = false;
+ }
m_sector_fill_time[sidx] = time;
m_line_fill_time = time;
@@ -367,6 +388,11 @@ struct sector_cache_block : public cache_block_t {
m_set_modified_on_fill[sidx] = m_modified;
}
+ virtual void set_readable_on_fill(bool readable,
+ mem_access_sector_mask_t sector_mask) {
+ unsigned sidx = get_sector_index(sector_mask);
+ m_set_readable_on_fill[sidx] = readable;
+ }
virtual void set_m_readable(bool readable,
mem_access_sector_mask_t sector_mask) {
unsigned sidx = get_sector_index(sector_mask);
@@ -401,6 +427,7 @@ struct sector_cache_block : public cache_block_t {
cache_block_state m_status[SECTOR_CHUNCK_SIZE];
bool m_ignore_on_fill_status[SECTOR_CHUNCK_SIZE];
bool m_set_modified_on_fill[SECTOR_CHUNCK_SIZE];
+ bool m_set_readable_on_fill[SECTOR_CHUNCK_SIZE];
bool m_readable[SECTOR_CHUNCK_SIZE];
unsigned get_sector_index(mem_access_sector_mask_t sector_mask) {
diff --git a/src/gpgpu-sim/shader.cc b/src/gpgpu-sim/shader.cc
index 8b226b6..c6e7b8f 100644
--- a/src/gpgpu-sim/shader.cc
+++ b/src/gpgpu-sim/shader.cc
@@ -748,6 +748,8 @@ void shader_core_stats::visualizer_print(gzFile visualizer_file) {
}
gzprintf(visualizer_file, "\n");
+ gzprintf(visualizer_file, "ctas_completed: %d\n", ctas_completed);
+ ctas_completed = 0;
// warp issue breakdown
unsigned sid = m_config->gpgpu_warp_issue_shader;
unsigned count = 0;
@@ -2685,6 +2687,7 @@ void shader_core_ctx::register_cta_thread_exit(unsigned cta_num,
m_cta_status[cta_num]--;
if (!m_cta_status[cta_num]) {
// Increment the completed CTAs
+ m_stats->ctas_completed++;
m_gpu->inc_completed_cta();
m_n_active_cta--;
m_barriers.deallocate_barrier(cta_num);
@@ -2751,6 +2754,7 @@ void gpgpu_sim::shader_print_runtime_stat(FILE *fout) {
void gpgpu_sim::shader_print_scheduler_stat(FILE *fout,
bool print_dynamic_info) const {
+ fprintf(fout, "ctas_completed %d, ", m_shader_stats->ctas_completed);
// Print out the stats from the sampling shader core
const unsigned scheduler_sampling_core =
m_shader_config->gpgpu_warp_issue_shader;
diff --git a/src/gpgpu-sim/shader.h b/src/gpgpu-sim/shader.h
index 07cd2d0..6481790 100644
--- a/src/gpgpu-sim/shader.h
+++ b/src/gpgpu-sim/shader.h
@@ -238,6 +238,7 @@ class shd_warp_t {
unsigned get_dynamic_warp_id() const { return m_dynamic_warp_id; }
unsigned get_warp_id() const { return m_warp_id; }
+ class shader_core_ctx * get_shader() { return m_shader; }
private:
static const unsigned IBUFFER_SIZE = 2;
class shader_core_ctx *m_shader;
@@ -1668,6 +1669,7 @@ struct shader_core_stats_pod {
unsigned *single_issue_nums;
unsigned *dual_issue_nums;
+ unsigned ctas_completed;
// memory access classification
int gpgpu_n_mem_read_local;
int gpgpu_n_mem_write_local;
@@ -1781,6 +1783,7 @@ class shader_core_stats : public shader_core_stats_pod {
dual_issue_nums =
(unsigned *)calloc(config->gpgpu_num_sched_per_core, sizeof(unsigned));
+ ctas_completed = 0;
n_simt_to_mem = (long *)calloc(config->num_shader(), sizeof(long));
n_mem_to_simt = (long *)calloc(config->num_shader(), sizeof(long));
@@ -2129,7 +2132,7 @@ class shader_core_ctx : public core_t {
friend class scheduler_unit; // this is needed to use private issue warp.
friend class TwoLevelScheduler;
friend class LooseRoundRobbinScheduler;
- void issue_warp(register_set &warp, const warp_inst_t *pI,
+ virtual void issue_warp(register_set &warp, const warp_inst_t *pI,
const active_mask_t &active_mask, unsigned warp_id,
unsigned sch_id);