Skip to content

Commit

Permalink
#5480: Add test_prefetcher.cpp tests back to CI and update test numbers
Browse files Browse the repository at this point in the history
 - Also, improve some BW/iterations logging in test_dispatcher.cpp
   now that tests will use device iterations instead of host iterations
  • Loading branch information
kmabeeTT committed Apr 2, 2024
1 parent b14d41a commit 4bed077
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
11 changes: 6 additions & 5 deletions tests/scripts/run_cpp_fd2_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@ fi
#############################################
echo "Running test_prefetcher tests now...";

# FIXME Hangs sometimes TT_METAL_SLOW_DISPATCH_MODE=1 ./build/test/tt_metal/perf_microbenchmark/dispatch/test_prefetcher -t 0 -i 3 # Smoke Test
# FIXME comment out just in case TT_METAL_SLOW_DISPATCH_MODE=1 ./build/test/tt_metal/perf_microbenchmark/dispatch/test_prefetcher -t 1 -i 3 # Random Test
# FIXME occasional hang/mismatch TT_METAL_SLOW_DISPATCH_MODE=1 ./build/test/tt_metal/perf_microbenchmark/dispatch/test_prefetcher -t 2 -i 3 # PCIE Test
# FIXME comment out just in case TT_METAL_SLOW_DISPATCH_MODE=1 ./build/test/tt_metal/perf_microbenchmark/dispatch/test_prefetcher -t 3 -i 3 # Paged DRAM Read Test
# FIXME Failing TT_METAL_SLOW_DISPATCH_MODE=1 ./build/test/tt_metal/perf_microbenchmark/dispatch/test_prefetcher -t 4 -i 3 # Paged DRAM Write + Read Test
TT_METAL_SLOW_DISPATCH_MODE=1 ./build/test/tt_metal/perf_microbenchmark/dispatch/test_prefetcher -t 0 -i 3 # TrueSmoke Test
TT_METAL_SLOW_DISPATCH_MODE=1 ./build/test/tt_metal/perf_microbenchmark/dispatch/test_prefetcher -t 1 -i 3 # Smoke Test
TT_METAL_SLOW_DISPATCH_MODE=1 ./build/test/tt_metal/perf_microbenchmark/dispatch/test_prefetcher -t 2 -i 3 # Random Test
TT_METAL_SLOW_DISPATCH_MODE=1 ./build/test/tt_metal/perf_microbenchmark/dispatch/test_prefetcher -t 3 -i 3 # PCIE Test
TT_METAL_SLOW_DISPATCH_MODE=1 ./build/test/tt_metal/perf_microbenchmark/dispatch/test_prefetcher -t 4 -i 3 # Paged DRAM Read Test
TT_METAL_SLOW_DISPATCH_MODE=1 ./build/test/tt_metal/perf_microbenchmark/dispatch/test_prefetcher -t 5 -i 3 # Paged DRAM Write + Read Test

# Testcase: Paged Write Cmd to DRAM. 256 pages, 224b size.
TT_METAL_SLOW_DISPATCH_MODE=1 ./build/test/tt_metal/perf_microbenchmark/dispatch/test_prefetcher -t 4 -i 1 -dpgs 224 -dpgr 256
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -514,8 +514,9 @@ int main(int argc, char **argv) {
}

std::chrono::duration<double> elapsed_seconds = (end-start);
log_info(LogTest, "Ran in {}us", elapsed_seconds.count() * 1000 * 1000);
log_info(LogTest, "Ran in {}us per iteration", elapsed_seconds.count() * 1000 * 1000 / iterations_g);
uint32_t total_iterations = iterations_g * prefetcher_iterations_g;
log_info(LogTest, "Ran in {}us (for total iterations: {})", elapsed_seconds.count() * 1000 * 1000, total_iterations);
log_info(LogTest, "Ran in {}us per iteration", elapsed_seconds.count() * 1000 * 1000 /total_iterations);
if (iterations_g > 0) {
float total_words = 0;
if (min_xfer_size_bytes_g != max_xfer_size_bytes_g) {
Expand Down Expand Up @@ -543,12 +544,12 @@ int main(int argc, char **argv) {
break;
}

total_words *= iterations_g;
float bw = total_words * sizeof(uint32_t) * prefetcher_iterations_g / (elapsed_seconds.count() * 1024.0 * 1024.0 * 1024.0);
total_words *= total_iterations;
float bw = total_words * sizeof(uint32_t) / (elapsed_seconds.count() * 1024.0 * 1024.0 * 1024.0);
std::stringstream ss;
ss << std::fixed << std::setprecision(3) << bw;
log_info(LogTest, "BW: {} GB/s (from total_words: {} size: {} MB via host_iter: {} for num_cores: {})",
ss.str(), total_words, total_words * sizeof(uint32_t) / (1024.0 * 1024.0), iterations_g, all_workers_g.size());
log_info(LogTest, "BW: {} GB/s (from total_words: {} size: {} MB via host_iter: {} prefetcher_iter: {} for num_cores: {})",
ss.str(), total_words, total_words * sizeof(uint32_t) / (1024.0 * 1024.0), iterations_g, prefetcher_iterations_g, all_workers_g.size());
} else {
log_info(LogTest, "BW: -- GB/s (use -i 1 to report bandwidth)");
}
Expand Down

0 comments on commit 4bed077

Please sign in to comment.