Skip to content

Commit f783a4c

Browse files
JRPanShichenQiao
andauthored
per stream stats (accel-sim#326)
* Passed cuda_stream_id from accelsim to gpgpusim * Fixed for (auto k : kernels_info) in main() for multi-stream app * Passed streamID of last finished kernel to gpgpu_sim::print_stats * checkout correct gpgpu-sim branch for multi stream stats * Move Jenkins to bak * Adding merge_group trigger to worklow * rename jenkinsfile * Automated clang-format * update formatter * correct format script path --------- Co-authored-by: Justin Qiao <[email protected]> Co-authored-by: JRPan <[email protected]>
1 parent 8253fd6 commit f783a4c

File tree

7 files changed

+26
-28
lines changed

7 files changed

+26
-28
lines changed

.github/workflows/short-tests.yml

Lines changed: 14 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -48,29 +48,22 @@ jobs:
4848
- name: Run Simulation
4949
run: echo "skipped Tracer-Simulation. Will perform in merge queue"
5050
format-code:
51-
runs-on: ubuntu-latest
51+
if: github.event_name == 'pull_request'
52+
runs-on: tgrogers-raid
5253
needs: [SASS-Simulation, PTX-Simulation, Tracer-Tool]
53-
54-
permissions:
55-
# Give the default GITHUB_TOKEN write permission to commit and push the
56-
# added or changed files to the repository.
57-
contents: write
58-
5954
steps:
6055
- uses: actions/checkout@v4
61-
# Other steps that change files in the repository go here
62-
#
56+
with:
57+
ref: ${{github.event.pull_request.head.ref}}
58+
repository: ${{github.event.pull_request.head.repo.full_name}}
59+
ssh-key: ''
60+
6361
- name: Run clang-format
6462
run: |
65-
sudo apt-get install -y clang-format
66-
./gpu-simulator/format-code.sh
67-
./util/tracer_nvbit/tracer_tool/format-code.sh
68-
69-
- uses: stefanzweifel/git-auto-commit-action@v5
70-
with:
71-
# Optional. Commit message for the created commit.
72-
# Defaults to "Apply automatic changes"
73-
commit_message: Automated clang-format
74-
# Optional. Option used by `git-status` to determine if the repository is
75-
# dirty. See https://git-scm.com/docs/git-status#_options
76-
status_options: '--untracked-files=no'
63+
git config user.name "purdue-jenkins"
64+
git config user.email "[email protected]"
65+
git remote set-url origin [email protected]:${{github.event.pull_request.head.repo.full_name}}
66+
git remote -v
67+
/bin/bash ./gpu-simulator/format-code.sh
68+
/bin/bash ./util/tracer_nvbit/tracer_tool/format-code.sh
69+
if git status --untracked-files=no | grep -q "nothing to commit"; then echo "No changes to commit."; else git commit -a -m "Automated Format"; git push; fi

gpu-simulator/accel-sim.cc

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ void accel_sim_framework::simulation_loop() {
5858
if (!stream_busy && m_gpgpu_sim->can_start_kernel() &&
5959
!k->was_launched()) {
6060
std::cout << "launching kernel name: " << k->get_name()
61-
<< " uid: " << k->get_uid() << std::endl;
61+
<< " uid: " << k->get_uid()
62+
<< " cuda_stream_id: " << k->get_cuda_stream_id()
63+
<< std::endl;
6264
m_gpgpu_sim->launch(k);
6365
k->set_launched();
6466
busy_streams.push_back(k->get_cuda_stream_id());
@@ -119,12 +121,14 @@ void accel_sim_framework::parse_commandlist() {
119121

120122
void accel_sim_framework::cleanup(unsigned finished_kernel) {
121123
trace_kernel_info_t *k = NULL;
124+
unsigned long long finished_kernel_cuda_stream_id = -1;
122125
for (unsigned j = 0; j < kernels_info.size(); j++) {
123126
k = kernels_info.at(j);
124127
if (k->get_uid() == finished_kernel ||
125128
m_gpgpu_sim->cycle_insn_cta_max_hit() || !m_gpgpu_sim->active()) {
126129
for (unsigned int l = 0; l < busy_streams.size(); l++) {
127130
if (busy_streams.at(l) == k->get_cuda_stream_id()) {
131+
finished_kernel_cuda_stream_id = k->get_cuda_stream_id();
128132
busy_streams.erase(busy_streams.begin() + l);
129133
break;
130134
}
@@ -138,7 +142,7 @@ void accel_sim_framework::cleanup(unsigned finished_kernel) {
138142
}
139143
}
140144
assert(k);
141-
m_gpgpu_sim->print_stats();
145+
m_gpgpu_sim->print_stats(finished_kernel_cuda_stream_id);
142146
}
143147

144148
unsigned accel_sim_framework::simulate() {

gpu-simulator/accel-sim.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class accel_sim_framework {
6767
unsigned window_size;
6868
unsigned commandlist_index;
6969

70-
std::vector<unsigned long> busy_streams;
70+
std::vector<unsigned long long> busy_streams;
7171
std::vector<trace_kernel_info_t *> kernels_info;
7272
std::vector<trace_command> commandlist;
7373

gpu-simulator/trace-driven/trace_driven.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,8 @@ trace_kernel_info_t::trace_kernel_info_t(dim3 gridDim, dim3 blockDim,
9494
trace_parser *parser,
9595
class trace_config *config,
9696
kernel_trace_t *kernel_trace_info)
97-
: kernel_info_t(gridDim, blockDim, m_function_info) {
97+
: kernel_info_t(gridDim, blockDim, m_function_info,
98+
kernel_trace_info->cuda_stream_id) {
9899
m_parser = parser;
99100
m_tconfig = config;
100101
m_kernel_trace_info = kernel_trace_info;

gpu-simulator/trace-driven/trace_driven.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ class trace_kernel_info_t : public kernel_info_t {
9393
void get_next_threadblock_traces(
9494
std::vector<std::vector<inst_trace_t> *> threadblock_traces);
9595

96-
unsigned long get_cuda_stream_id() {
96+
unsigned long long get_cuda_stream_id() {
9797
return m_kernel_trace_info->cuda_stream_id;
9898
}
9999

gpu-simulator/trace-parser/trace_parser.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ kernel_trace_t *trace_parser::parse_kernel_info(
379379
} else if (string1 == "nregs") {
380380
sscanf(line.c_str(), "-nregs = %d", &kernel_info->nregs);
381381
} else if (string1 == "cuda" && string2 == "stream") {
382-
sscanf(line.c_str(), "-cuda stream id = %lu",
382+
sscanf(line.c_str(), "-cuda stream id = %llu",
383383
&kernel_info->cuda_stream_id);
384384
} else if (string1 == "binary" && string2 == "version") {
385385
sscanf(line.c_str(), "-binary version = %d",

gpu-simulator/trace-parser/trace_parser.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ struct kernel_trace_t {
8888
unsigned tb_dim_z;
8989
unsigned shmem;
9090
unsigned nregs;
91-
unsigned long cuda_stream_id;
91+
unsigned long long cuda_stream_id;
9292
unsigned binary_verion;
9393
unsigned enable_lineinfo;
9494
unsigned trace_verion;

0 commit comments

Comments
 (0)