Skip to content

Commit d7be156

Browse files
committed
TDM productionization in TB
1 parent 9eede61 commit d7be156

6 files changed

Lines changed: 785 additions & 753 deletions

File tree

src/client/EnvVars.hpp

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,9 @@ class EnvVars
127127
// TDM (async tensor) options
128128
int tdmBlockSize; // Size of each threadblock for TDM (async tensor) kernels (must be multiple of 32)
129129
int tdmMaxLdsBytes; // Max LDS (shared memory) bytes per workgroup for TDM kernels (INT_MAX = use device max)
130-
int tdmPipelined; // Use the pipelined (depth=2) TDM tensor kernel (0=non-pipelined, 1=pipelined)
130+
int tdmBlockOrder; // Worker ranking across blocks for TDM kernels (0=sequential, 1=interleaved)
131+
int tdmTemporal; // TDM non-temporal cache hint (0=none, 1=loads, 2=stores, 3=both)
132+
int tdmWordSize; // TDM tensor descriptor data-size encoding (advanced; default 2)
131133

132134
// Developer features
133135
int gpuMaxHwQueues; // Tracks GPU_MAX_HW_QUEUES environment variable
@@ -180,7 +182,9 @@ class EnvVars
180182
showPercentiles = GetEnvVarArray("SHOW_PERCENTILES", {});
181183
tdmBlockSize = GetEnvVar("TDM_BLOCK_SIZE" , 256);
182184
tdmMaxLdsBytes = GetEnvVar("TDM_MAX_LDS_BYTES" , INT_MAX);
183-
tdmPipelined = GetEnvVar("TDM_PIPELINED" , 0);
185+
tdmBlockOrder = GetEnvVar("TDM_BLOCK_ORDER" , 0);
186+
tdmTemporal = GetEnvVar("TDM_TEMPORAL" , 0);
187+
tdmWordSize = GetEnvVar("TDM_WORD_SIZE" , 2);
184188
useHipEvents = GetEnvVar("USE_HIP_EVENTS" , 1);
185189
useHsaDma = GetEnvVar("USE_HSA_DMA" , 0);
186190
useInteractive = GetEnvVar("USE_INTERACTIVE" , 0);
@@ -398,10 +402,14 @@ class EnvVars
398402
printf(" SHOW_BORDERS - Show ASCII box-drawing characters in tables\n");
399403
printf(" SHOW_ITERATIONS - Show per-iteration timing info\n");
400404
printf(" SHOW_PERCENTILES - Comma-separated percentiles iteration duration\n");
405+
printf(" TDM_BLOCK_ORDER - TDM worker ranking across blocks. 0=sequential, 1=interleaved\n");
401406
printf(" TDM_BLOCK_SIZE - # of threads per threadblock for TDM (async tensor) kernels (Must be multiple of 32)\n");
402407
printf(" TDM_MAX_LDS_BYTES - Max LDS bytes per workgroup for TDM kernels (defaults to device max; K/M/G suffixes accepted)\n");
403-
printf(" TDM_PIPELINED - 1=use pipelined (depth=2) TDM kernel, 0=use non-pipelined kernel\n");
404-
printf(" USE_HIP_EVENTS - Use HIP events for GFX executor timing\n");
408+
printf(" TDM_TEMPORAL - TDM non-temporal cache hint (0=none, 1=loads, 2=stores, 3=both)\n");
409+
printf(" TDM_WORD_SIZE - TDM tensor descriptor data-size encoding (advanced; default 2)\n");
410+
printf(" NOTE: T/A (TDM / async load-store) executors do NOT honor GFX_* or\n");
411+
printf(" XCC_PREF_TABLE. Their threadblock size comes from TDM_BLOCK_SIZE.\n");
412+
printf(" USE_HIP_EVENTS - Use HIP events for GFX/DMA/TDM executor timing (0=CPU wall-clock)\n");
405413
printf(" USE_HSA_DMA - Use hsa_amd_async_copy instead of hipMemcpy for non-targeted DMA execution\n");
406414
printf(" USE_INTERACTIVE - Pause for user-input before starting transfer loop\n");
407415
printf(" USE_SINGLE_STREAM - Use a single stream per GPU GFX executor instead of stream per Transfer\n");
@@ -543,16 +551,23 @@ class EnvVars
543551
"%s per-iteration timing", showIterations ? "Showing" : "Hiding");
544552
Print("SHOW_PERCENTILES", showPercentiles.empty() ? 0 : 1, "%s",
545553
showPercentiles.empty() ? "Disabled" : GetStr(showPercentiles).c_str());
554+
Print("TDM_BLOCK_ORDER", tdmBlockOrder,
555+
"TDM worker ranking: %s", tdmBlockOrder == 0 ? "Sequential" : "Interleaved");
546556
Print("TDM_BLOCK_SIZE", tdmBlockSize,
547557
"TDM threadblock size of %d", tdmBlockSize);
548558
Print("TDM_MAX_LDS_BYTES", tdmMaxLdsBytes,
549559
"%s", tdmMaxLdsBytes == INT_MAX
550560
? "Using device max LDS bytes per workgroup"
551561
: (std::string("Capping LDS to ") + std::to_string(tdmMaxLdsBytes) + " bytes per workgroup").c_str());
552-
Print("TDM_PIPELINED", tdmPipelined,
553-
"Using %s TDM tensor kernel", tdmPipelined ? "pipelined (depth=2)" : "non-pipelined");
562+
Print("TDM_TEMPORAL", tdmTemporal,
563+
"%s", (tdmTemporal == 0 ? "Not using non-temporal hints" :
564+
tdmTemporal == 1 ? "Using non-temporal load hint" :
565+
tdmTemporal == 2 ? "Using non-temporal store hint" :
566+
"Using non-temporal load and store hints"));
567+
Print("TDM_WORD_SIZE", tdmWordSize,
568+
"Using TDM tensor data-size encoding of %d", tdmWordSize);
554569
Print("USE_HIP_EVENTS", useHipEvents,
555-
"Using %s for GFX/DMA Executor timing", useHipEvents ? "HIP events" : "CPU wall time");
570+
"Using %s for GFX/DMA/TDM Executor timing", useHipEvents ? "HIP events" : "CPU wall time");
556571
Print("USE_HSA_DMA", useHsaDma,
557572
"Using %s for DMA execution", useHsaDma ? "hsa_amd_async_copy" : "hipMemcpyAsync");
558573
Print("USE_INTERACTIVE", useInteractive,
@@ -761,7 +776,10 @@ class EnvVars
761776

762777
cfg.tdm.blockSize = tdmBlockSize;
763778
cfg.tdm.maxLDSBytes = tdmMaxLdsBytes;
764-
cfg.tdm.pipelined = tdmPipelined;
779+
cfg.tdm.useHipEvents = useHipEvents;
780+
cfg.tdm.blockOrder = tdmBlockOrder;
781+
cfg.tdm.temporalMode = tdmTemporal;
782+
cfg.tdm.wordSize = tdmWordSize;
765783

766784
return cfg;
767785
}

src/client/Presets/Help.hpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,16 @@ int HelpPreset([[maybe_unused]] EnvVars& ev,
3737
printf("# SRC 1 -> Executor -> DST 1\n");
3838
printf("# SRC X DST Y\n");
3939
printf("\n");
40-
printf("# Seven Executors are supported by TransferBench\n");
40+
printf("# Eight Executors are supported by TransferBench\n");
4141
printf("# Executor: SubExecutor:\n");
4242
printf("# 1) CPU CPU thread\n");
4343
printf("# 2) GPU GPU threadblock/Compute Unit (CU)\n");
4444
printf("# 3) DMA N/A. (Must have single SRC, at least one DST)\n");
4545
printf("# 4) NIC Queue Pair\n");
46-
printf("# 5) Batched-DMA Batch item (Must have single SRC, at least one DST)\n");
47-
printf("# 6) TDM GPU threadblock/Compute Unit (CU)\n");
48-
printf("# 7) Async Load/Store GPU threadblock/Compute Unit (CU)\n");
46+
printf("# 5) Nearest NIC Queue Pair (uses closest NIC)\n");
47+
printf("# 6) Batched-DMA Batch item (Must have single SRC, at least one DST)\n");
48+
printf("# 7) TDM GPU threadblock/Compute Unit (CU)\n");
49+
printf("# 8) Async Load/Store GPU threadblock/Compute Unit (CU)\n");
4950
printf("\n");
5051
printf("# Each single line in the configuration file defines a set of Transfers (a Test) to run in parallel\n");
5152
printf("\n");
@@ -73,8 +74,8 @@ int HelpPreset([[maybe_unused]] EnvVars& ev,
7374
printf("# - B: Batched-DMA-executor (Indexed from 0 to # GPUs - 1)\n");
7475
printf("# - I#.#: NIC executor (Indexed from 0 to # NICs - 1)\n");
7576
printf("# - N#.#: Nearest NIC executor (Indexed from 0 to # GPUs - 1)\n");
76-
printf("# - T: GPU TDM kernel kernel (Indexed from 0 to # GPUs - 1)\n");
77-
printf("# - L: GPU async load/store (Indexed from 0 to # GPUs - 1)\n");
77+
printf("# - T: GPU TDM kernel (Indexed from 0 to # GPUs - 1)\n");
78+
printf("# - A: GPU async load/store (Indexed from 0 to # GPUs - 1)\n");
7879
printf("# dstMemL : Destination memory locations (Where the data is to be written to)\n");
7980
printf("# bytesL : Number of bytes to copy (0 means use command-line specified size)\n");
8081
printf("# Must be a multiple of 4 and may be suffixed with ('K','M', or 'G')\n");

src/client/Utilities.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -439,8 +439,8 @@ namespace TransferBench::Utils
439439
case EXE_NIC: return "NIC";
440440
case EXE_NIC_NEAREST: return "NIC";
441441
case EXE_GPU_BDMA: return "BMA";
442-
case EXE_GPU_ASYNC_TENSOR: return "AT"; // async tensor kernel path
443-
case EXE_GPU_ASYNC_MEMOPS: return "AL"; // async load/store kernel path
442+
case EXE_GPU_TDM: return "TDM";
443+
case EXE_GPU_ALS: return "ALS";
444444
default: return "N/A";
445445
}
446446
}

0 commit comments

Comments
 (0)