This directory contains the main GPU queue workflows:
- Raytracing (RT) benchmark (
concurrent_rt/rt_final.cpp) - Throughput benchmark (
throughout_bench.cpp) - History generation + FIFO linearizability checking (
correctness/history.cpp,correctness/lincheck/main.go) - BFS benchmark and sweeps (
concurrent_bfs/bfs_bench.cpp,concurrent_bfs/run_bfs_sweep.sh) - Throughput Profiling with Rocprofv2 for each QUEUE type on GPU (
profiling/run_profile.sh)
All commands below are run from the root directory.
SFQ: Scogland-Feng QueueWFQ: G-WFQ-YMC (GPU adaptation of the YMC CPU design, as referenced in our paper)GWFQ: G-WFQGLFQ: G-LFQ
Only these four queues are supported through this Makefile: gwfq | glfq | wfq | sfq.
Build + run:
make rt QUEUE=gwfq SCENE=0 THREADS=1024 BOUNCES=4Key RT variables:
QUEUE:gwfq | glfq | wfq | sfqSCENE:0(complex) or1(cornell)THREADS: worker threads per tileBOUNCES: max reflection depthGPU_NAME: optional label override; when unset, GPU name is auto-detected from HIPMAX_THREADS: compile-time ceiling used by RT build (default isTHREADS)QUEUE_N: compile-time queue capacity macro for RT (default32768)EXTRA_FLAGS: extra compile flags appended to RT build
Build + run (normal mode):
make tb QUEUE=gwfqBuild + run with per-test FIFO check enabled:
make tb-run-fifo QUEUE=gwfqQueue support for throughput harness:
gwfq,glfq,wfq,sfq
Key throughput variables:
TB_FIFO_MODE:0(off) or1(on)GPU_NAME: optional label override for console/CSV; default is auto-detected GPU nameTB_RUN_MS: timed run duration per caseTB_WARMUP_MS: warmup duration per caseTB_CHUNK_OPS: operations per kernel launch chunkTB_BLOCK_SIZE: GPU block sizeTB_FIFO_OPS_PER_THREAD: FIFO-check work per producer threadTB_ONLY_BALANCED:1to run only balanced testTB_ONLY_SPLIT:1to run only split producer/consumer testTB_CSV_FILE: output CSV path (defaultbenchmark_results.csv)TB_EXTRA_FLAGS: extra compile flags appended to throughput build
Example tuned run:
make tb-run-fifo QUEUE=sfq TB_RUN_MS=1000 TB_WARMUP_MS=200 TB_CHUNK_OPS=128 TB_FIFO_OPS_PER_THREAD=32Generate a single queue history JSONL:
make hist-run QUEUE=gwfqGenerate histories for all supported queues (gwfq, glfq, wfq, sfq):
make hist-run-allAll generated histories are written under:
correctness/histories
Default output naming:
correctness/histories/history_<queue>_m<mode>_t<threads>_o<ops>.jsonl
History tuning variables:
HIST_THREADS: thread count used by history kernelHIST_OPS: operations per threadHIST_MODE:0alternating (enq,deq) or1split rolesHIST_PRODUCER_PERCENT: used only whenHIST_MODE=1HIST_BLOCK_SIZE: GPU block sizeHIST_OUT_DIR: output directory (defaultcorrectness/histories)HIST_EXTRA_FLAGS: extra compile flags for history binary
Example:
make hist-run QUEUE=wfq HIST_MODE=1 HIST_THREADS=128 HIST_OPS=32 HIST_PRODUCER_PERCENT=25Prerequisites:
- Go installed and available on
PATH - One or more history files already present in
correctness/histories
Check FIFO linearizability for one history:
make lincheck LINCHECK_HISTORY=correctness/histories/history_gwfq_m0_t64_o16.jsonlCheck and also emit an HTML visualization:
make lincheck-html \
LINCHECK_HISTORY=correctness/histories/history_gwfq_m0_t64_o16.jsonl \
LINCHECK_HTML=correctness/histories/history_gwfq_m0_t64_o16.htmlExpected checker output status:
Linearizable (FIFO)→ success (exit code 0)Not linearizable (FIFO)orUnknown (timeout)→ failure (exit code 1)
make rt-helpBuild one BFS binary for a selected queue:
make bfs-build QUEUE=gwfqBuild all BFS queue binaries (gwfq, glfq, wfq, sfq) into:
concurrent_bfs/out
Graph datasets are expected under concurrent_bfs/graphs.
The .mtx files are intentionally not tracked; see concurrent_bfs/graphs/README.md for required file names.
make bfs-build-allRun one BFS case with a selected queue and graph:
make bfs-run \
QUEUE=wfq \
BFS_GRAPH=concurrent_bfs/graphs/road_usa.mtx \
BFS_THREADS=8192 \
BFS_BLOCK=256 \
BFS_ITERS=10 \
BFS_WARMUP=3Run an automated sweep over all graphs in concurrent_bfs/graphs, all queues, and default thread counts (512 1024 2048 4096 8192):
make bfs-sweepSweep tuning variables:
BFS_QUEUES: queue list (defaultgwfq glfq wfq sfq)BFS_CHUNKS: thread sizes (default512 1024 2048 4096 8192)BFS_GRAPHS: optional graph list (for exampleak2010 road_usa)GPU_NAME: optional GPU label override for BFS console/CSV rowsBFS_GRAPH_DIR: graph directory (defaultconcurrent_bfs/graphs)BFS_BUILD_DIR: BFS binary directory (defaultconcurrent_bfs/out)BFS_LOG_DIR: sweep log directory (defaultconcurrent_bfs/logs)BFS_CSV_NAME: BFS CSV file path passed via environmentBFS_BLOCK,BFS_SRC_VERTEX,BFS_ITERS,BFS_WARMUPBFS_GPU_FAMILY: label used in log filenames (for examplemi210ormi300a)
Example custom sweep:
make bfs-sweep \
BFS_GPU_FAMILY=mi300a \
BFS_QUEUES="wfq sfq" \
BFS_GRAPHS="ak2010 road_usa" \
BFS_CHUNKS="512 1024 2048 4096 8192" \
BFS_CSV_NAME=concurrent_bfs/bfs_bench_final.csvBaseline usage notes are documented in:
concurrent_bfs/README.mdfor Gunrock BFS baseline (-mmarket input mode)concurrent_rt/README.mdfor the RT compaction baseline
RT compaction baseline source is in:
concurrent_rt/baselines/rt_compaction.cpp
The profiling workflow builds the selected throughput binaries through the Makefile, detects the local AMD GPU family, selects the appropriate rocprofv2 metric files, and writes profiling CSVs under:
results/profiling/
Basic throughput profiling for all queues:
make profile-tbProfile selected queues:
make profile-tb PROFILE_QUEUES="gwfq glfq wfq sfq"Profile only one queue:
make profile-tb PROFILE_QUEUES="gwfq"Profile FIFO-check binaries:
make profile-tb PROFILE_FIFO_MODE=1If GPU auto-detection fails, override the GPU family manually:
make profile-tb GPU_FAMILY=mi210
make profile-tb GPU_FAMILY=mi300aProfiling variables:
PROFILE_QUEUES: queues to profile, defaultgwfq glfq wfq sfqPROFILE_FIFO_MODE:0or1, default0PROFILE_OUT_ROOT: profiling CSV output root, defaultresults/profilingPROFILE_BIN_ROOT: profiling binary output root, defaultout/profilePROFILE_EXTRA_MAKE_FLAGS: optional extra flags passed to the nested Makefile buildGPU_FAMILY: optional GPU-family override,mi210ormi300a
Expected profiling output layout:
results/profiling/<gpu>/tb/<queue>/fifo<mode>/
<gpu>_<queue>_fifo<mode>_stalls.csv
<gpu>_<queue>_fifo<mode>_ea_atomic.csv
<gpu>_<queue>_fifo<mode>_occ.csv # MI210
<gpu>_<queue>_fifo<mode>_occa.csv # MI300A
raw/
logs/
Metric selection is automatic:
- MI210 / gfx90a uses
profiling/metrics/mi210/occ.in - MI300A / gfx942 uses
profiling/metrics/mi300a/occa.in - both use common metric files from
profiling/metrics/common
For QUEUE=gwfq, the Makefile applies architecture-specific patience settings by default.
| GPU family | WF_ENQ_PATIENCE |
WF_DEQ_PATIENCE |
|---|---|---|
| MI210 / gfx90a | 2048 | 8192 |
| MI300A / gfx942 | 1024 | 2048 |
The GPU family is auto-detected using:
scripts/detect_gpu_family.shOverride the detected family manually:
make tb QUEUE=gwfq GPU_FAMILY=mi210
make tb QUEUE=gwfq GPU_FAMILY=mi300aOverride the GWFQ patience values manually:
make tb QUEUE=gwfq GWFQ_ENQ_PATIENCE=4096 GWFQ_DEQ_PATIENCE=4096These GWFQ patience flags are only added when QUEUE=gwfq. Other queues are not passed WF_ENQ_PATIENCE or WF_DEQ_PATIENCE.
The same GWFQ tuning flags are used by the RT, throughput, BFS, and history build targets.
All plotting commands are exposed through the Makefile. Generated figures are written under:
results/figures/
Generate the fixed-duration throughput 2x4 plot from benchmark_results.csv:
make plot-throughputOutput:
results/figures/throughput_compact_2x4.png
The throughput figure expects benchmark_results.csv to contain both MI210 and MI300A rows if both GPU rows should be populated.
Generate both MI210 and MI300A profiling 2x4 plots:
make plot-profileGenerate only MI210:
make plot-profile-mi210Generate only MI300A:
make plot-profile-mi300aOutputs:
results/figures/mi210_profiling_compact_2x4.png
results/figures/mi300a_profiling_compact_2x4.png
The profiling plots use:
benchmark_results.csvfor successful-operation denominatorsresults/profiling/<gpu>/tb/<queue>/fifo0/for rocprofv2 metric numerators
Generate the RT relative 1x4 plot versus stream compaction:
make plot-rtOutput:
results/figures/rt_queue_relative_vs_compaction_all_1x4.png
The RT plot reads:
rt_queue_perf.csv
Generate the BFS centered relative-speed plot versus Gunrock:
make plot-bfsOutput:
results/figures/bfs_best_speedup_centered.png
The BFS plot reads:
bfs_bench_final.csv
make plots-paperThis runs plot-throughput, plot-profile, plot-rt, and plot-bfs in sequence.
If only one GPU has profiling data available, use make plot-profile-mi210 or make plot-profile-mi300a instead of make plot-profile.
A minimal throughput workflow on the current GPU:
rm -f benchmark_results.csv
for q in gwfq glfq wfq sfq; do
make tb QUEUE=$q
done
make plot-throughputA profiling workflow on MI210:
make profile-tb GPU_FAMILY=mi210 PROFILE_QUEUES="gwfq glfq wfq sfq"
make plot-profile-mi210A BFS workflow:
make bfs-build-all
make bfs-sweep
make plot-bfsAn RT workflow:
make rt QUEUE=gwfq SCENE=0 THREADS=1024 BOUNCES=4
make plot-rtThis artifact is released under the MIT License.
LICENSE