co-authored by
Aniket Shivam
parent
9b8166e3f0
commit
d572cc1aab
@@ -611,7 +611,7 @@ Status Conv2dOperationProfiler::initialize_workspace(
|
||||
|
||||
|
||||
if (options.execution_mode != ExecutionMode::kDryRun) {
|
||||
|
||||
int seed_shift = 0;
|
||||
conv_workspace_.A = device_context.allocate_tensor(
|
||||
options,
|
||||
"A",
|
||||
@@ -619,7 +619,8 @@ Status Conv2dOperationProfiler::initialize_workspace(
|
||||
operation_desc.A.layout,
|
||||
problem_.extent_a(operation_desc.conv_kind),
|
||||
conv_workspace_.configuration.stride_a,
|
||||
conv_workspace_.problem_count
|
||||
conv_workspace_.problem_count,
|
||||
seed_shift++
|
||||
);
|
||||
|
||||
conv_workspace_.B = device_context.allocate_tensor(
|
||||
@@ -629,7 +630,8 @@ Status Conv2dOperationProfiler::initialize_workspace(
|
||||
operation_desc.B.layout,
|
||||
problem_.extent_b(operation_desc.conv_kind),
|
||||
conv_workspace_.configuration.stride_b,
|
||||
conv_workspace_.problem_count
|
||||
conv_workspace_.problem_count,
|
||||
seed_shift++
|
||||
);
|
||||
|
||||
if(problem_.groups == problem_.c && problem_.groups == problem_.k){
|
||||
@@ -641,7 +643,8 @@ Status Conv2dOperationProfiler::initialize_workspace(
|
||||
operation_desc.B.layout,
|
||||
problem_.extent_b(operation_desc.conv_kind),
|
||||
conv_workspace_.configuration.stride_b,
|
||||
conv_workspace_.problem_count
|
||||
conv_workspace_.problem_count,
|
||||
seed_shift++
|
||||
);
|
||||
}
|
||||
|
||||
@@ -652,7 +655,8 @@ Status Conv2dOperationProfiler::initialize_workspace(
|
||||
operation_desc.C.layout,
|
||||
problem_.extent_c(operation_desc.conv_kind),
|
||||
conv_workspace_.configuration.stride_c,
|
||||
conv_workspace_.problem_count
|
||||
conv_workspace_.problem_count,
|
||||
seed_shift++
|
||||
);
|
||||
|
||||
conv_workspace_.Computed = device_context.allocate_tensor(
|
||||
|
||||
@@ -651,7 +651,7 @@ Status Conv3dOperationProfiler::initialize_workspace(
|
||||
|
||||
|
||||
if (options.execution_mode != ExecutionMode::kDryRun) {
|
||||
|
||||
int seed_shift = 0;
|
||||
conv_workspace_.A = device_context.allocate_tensor(
|
||||
options,
|
||||
"A",
|
||||
@@ -659,7 +659,8 @@ Status Conv3dOperationProfiler::initialize_workspace(
|
||||
operation_desc.A.layout,
|
||||
problem_.extent_a(operation_desc.conv_kind),
|
||||
conv_workspace_.stride_a(operation_desc.conv_kind),
|
||||
conv_workspace_.problem_count
|
||||
conv_workspace_.problem_count,
|
||||
seed_shift++
|
||||
);
|
||||
|
||||
conv_workspace_.B = device_context.allocate_tensor(
|
||||
@@ -669,7 +670,8 @@ Status Conv3dOperationProfiler::initialize_workspace(
|
||||
operation_desc.B.layout,
|
||||
problem_.extent_b(operation_desc.conv_kind),
|
||||
conv_workspace_.stride_b(operation_desc.conv_kind),
|
||||
conv_workspace_.problem_count
|
||||
conv_workspace_.problem_count,
|
||||
seed_shift++
|
||||
);
|
||||
|
||||
conv_workspace_.C = device_context.allocate_tensor(
|
||||
@@ -679,7 +681,8 @@ Status Conv3dOperationProfiler::initialize_workspace(
|
||||
operation_desc.C.layout,
|
||||
problem_.extent_c(operation_desc.conv_kind),
|
||||
conv_workspace_.stride_c(operation_desc.conv_kind),
|
||||
conv_workspace_.problem_count
|
||||
conv_workspace_.problem_count,
|
||||
seed_shift++
|
||||
);
|
||||
|
||||
conv_workspace_.Computed = device_context.allocate_tensor(
|
||||
|
||||
@@ -103,13 +103,22 @@ bool get_cublas_transpose_operation(
|
||||
|
||||
/// Maps a CUTLASS numeric type to a cuBLAS data type enumeration
|
||||
bool get_cublas_datatype(cublasDataType_t &data_type, library::NumericTypeID element_type) {
|
||||
switch (element_type) {
|
||||
switch (element_type) {
|
||||
case library::NumericTypeID::kFE4M3:
|
||||
data_type = CUDA_R_8F_E4M3;
|
||||
return true;
|
||||
|
||||
case library::NumericTypeID::kFE5M2:
|
||||
data_type = CUDA_R_8F_E5M2;
|
||||
return true;
|
||||
|
||||
case library::NumericTypeID::kF16:
|
||||
data_type = CUDA_R_16F;
|
||||
return true;
|
||||
|
||||
case library::NumericTypeID::kBF16:
|
||||
break;
|
||||
data_type = CUDA_R_16BF;
|
||||
return true;
|
||||
|
||||
case library::NumericTypeID::kTF32:
|
||||
break;
|
||||
|
||||
@@ -68,7 +68,7 @@ Disposition get_cutlass_disposition(cudnnStatus_t cudnn_status) {
|
||||
return Disposition::kFailed;
|
||||
}
|
||||
|
||||
/// Checks cudnnStatus_t converts to cutlass status and returns if Status::kSuccess o.w. throws exception
|
||||
/// Checks cudnnStatus_t converts to cutlas status and returns if Status::kSuccess o.w. throws exception
|
||||
Status checkCudnnErr(cudnnStatus_t cudnn_status) {
|
||||
Status cutlass_status = get_cutlass_status(cudnn_status);
|
||||
if(cutlass_status != Status::kSuccess) {
|
||||
|
||||
@@ -55,7 +55,7 @@ Status get_cutlass_status(cudnnStatus_t cudnn_status);
|
||||
/// Converts a cuDNN status to cutlass::profiler::Disposition
|
||||
Disposition get_cutlass_disposition(cudnnStatus_t cudnn_status);
|
||||
|
||||
/// Checks cudnnStatus_t converts to cutlass status and returns if Status::kSuccess o.w. throws exception
|
||||
/// Checks cudnnStatus_t converts to cutlas status and returns if Status::kSuccess o.w. throws exception
|
||||
Status checkCudnnErr(cudnnStatus_t cudnn_status);
|
||||
|
||||
/// Maps a CUTLASS conv mode to a cuDNN conv mode enumeration
|
||||
|
||||
@@ -549,6 +549,22 @@ void DeviceAllocation::initialize_random_device(int seed, Distribution dist) {
|
||||
dist
|
||||
);
|
||||
break;
|
||||
case library::NumericTypeID::kFE4M3:
|
||||
cutlass::reference::device::BlockFillRandom<cutlass::float_e4m3_t>(
|
||||
reinterpret_cast<cutlass::float_e4m3_t *>(pointer_),
|
||||
capacity_,
|
||||
seed,
|
||||
dist
|
||||
);
|
||||
break;
|
||||
case library::NumericTypeID::kFE5M2:
|
||||
cutlass::reference::device::BlockFillRandom<cutlass::float_e5m2_t>(
|
||||
reinterpret_cast<cutlass::float_e5m2_t *>(pointer_),
|
||||
capacity_,
|
||||
seed,
|
||||
dist
|
||||
);
|
||||
break;
|
||||
case library::NumericTypeID::kF64:
|
||||
cutlass::reference::device::BlockFillRandom<double>(
|
||||
reinterpret_cast<double *>(pointer_),
|
||||
@@ -681,6 +697,22 @@ void DeviceAllocation::initialize_random_host(int seed, Distribution dist) {
|
||||
std::vector<uint8_t> host_data(bytes());
|
||||
|
||||
switch (type_) {
|
||||
case library::NumericTypeID::kFE4M3:
|
||||
cutlass::reference::host::BlockFillRandom<cutlass::float_e4m3_t>(
|
||||
reinterpret_cast<cutlass::float_e4m3_t *>(pointer_),
|
||||
capacity_,
|
||||
seed,
|
||||
dist
|
||||
);
|
||||
break;
|
||||
case library::NumericTypeID::kFE5M2:
|
||||
cutlass::reference::host::BlockFillRandom<cutlass::float_e5m2_t>(
|
||||
reinterpret_cast<cutlass::float_e5m2_t *>(pointer_),
|
||||
capacity_,
|
||||
seed,
|
||||
dist
|
||||
);
|
||||
break;
|
||||
case library::NumericTypeID::kF16:
|
||||
cutlass::reference::host::BlockFillRandom<cutlass::half_t>(
|
||||
reinterpret_cast<cutlass::half_t *>(host_data.data()),
|
||||
@@ -942,6 +974,18 @@ bool DeviceAllocation::block_compare_equal(
|
||||
size_t capacity) {
|
||||
|
||||
switch (numeric_type) {
|
||||
case library::NumericTypeID::kFE4M3:
|
||||
return reference::device::BlockCompareEqual<float_e4m3_t>(
|
||||
reinterpret_cast<float_e4m3_t const *>(ptr_A),
|
||||
reinterpret_cast<float_e4m3_t const *>(ptr_B),
|
||||
capacity);
|
||||
|
||||
case library::NumericTypeID::kFE5M2:
|
||||
return reference::device::BlockCompareEqual<float_e5m2_t>(
|
||||
reinterpret_cast<float_e5m2_t const *>(ptr_A),
|
||||
reinterpret_cast<float_e5m2_t const *>(ptr_B),
|
||||
capacity);
|
||||
|
||||
case library::NumericTypeID::kF16:
|
||||
return reference::device::BlockCompareEqual<half_t>(
|
||||
reinterpret_cast<half_t const *>(ptr_A),
|
||||
@@ -1095,6 +1139,22 @@ bool DeviceAllocation::block_compare_relatively_equal(
|
||||
double nonzero_floor) {
|
||||
|
||||
switch (numeric_type) {
|
||||
case library::NumericTypeID::kFE4M3:
|
||||
return reference::device::BlockCompareRelativelyEqual<float_e4m3_t>(
|
||||
reinterpret_cast<float_e4m3_t const *>(ptr_A),
|
||||
reinterpret_cast<float_e4m3_t const *>(ptr_B),
|
||||
capacity,
|
||||
static_cast<float_e4m3_t>(epsilon),
|
||||
static_cast<float_e4m3_t>(nonzero_floor));
|
||||
|
||||
case library::NumericTypeID::kFE5M2:
|
||||
return reference::device::BlockCompareRelativelyEqual<float_e5m2_t>(
|
||||
reinterpret_cast<float_e5m2_t const *>(ptr_A),
|
||||
reinterpret_cast<float_e5m2_t const *>(ptr_B),
|
||||
capacity,
|
||||
static_cast<float_e5m2_t>(epsilon),
|
||||
static_cast<float_e5m2_t>(nonzero_floor));
|
||||
|
||||
case library::NumericTypeID::kF16:
|
||||
return reference::device::BlockCompareRelativelyEqual<half_t>(
|
||||
reinterpret_cast<half_t const *>(ptr_A),
|
||||
@@ -1430,6 +1490,14 @@ void DeviceAllocation::write_tensor_csv(
|
||||
std::ostream &out) {
|
||||
|
||||
switch (this->type()) {
|
||||
case library::NumericTypeID::kFE4M3:
|
||||
write_tensor_csv_static_type<float_e4m3_t>(out, *this);
|
||||
break;
|
||||
|
||||
case library::NumericTypeID::kFE5M2:
|
||||
write_tensor_csv_static_type<float_e5m2_t>(out, *this);
|
||||
break;
|
||||
|
||||
case library::NumericTypeID::kF16:
|
||||
write_tensor_csv_static_type<half_t>(out, *this);
|
||||
break;
|
||||
@@ -1586,6 +1654,14 @@ static void tensor_fill(DeviceAllocation &allocation, Element val = Element()) {
|
||||
void DeviceAllocation::fill(double val = 0.0) {
|
||||
|
||||
switch (this->type()) {
|
||||
case library::NumericTypeID::kFE4M3:
|
||||
tensor_fill<float_e4m3_t>(*this, static_cast<float_e4m3_t>(val));
|
||||
break;
|
||||
|
||||
case library::NumericTypeID::kFE5M2:
|
||||
tensor_fill<float_e5m2_t>(*this, static_cast<float_e5m2_t>(val));
|
||||
break;
|
||||
|
||||
case library::NumericTypeID::kF16:
|
||||
tensor_fill<half_t>(*this, static_cast<half_t>(val));
|
||||
break;
|
||||
|
||||
@@ -76,7 +76,8 @@ DeviceAllocation *DeviceContext::allocate_tensor(
|
||||
library::LayoutTypeID layout_id,
|
||||
std::vector<int> const &extent,
|
||||
std::vector<int64_t> const &stride,
|
||||
int batch_count) {
|
||||
int batch_count,
|
||||
int seed_shift) {
|
||||
|
||||
DeviceAllocation *allocation =
|
||||
allocate_tensor(name, type, layout_id, extent, stride, batch_count);
|
||||
@@ -88,6 +89,12 @@ DeviceAllocation *DeviceContext::allocate_tensor(
|
||||
if(!options.initialization.fix_data_distribution) {
|
||||
// change data distribution based on bit width
|
||||
switch(type) {
|
||||
case library::NumericTypeID::kFE4M3:
|
||||
data_distribution.set_uniform(-1, 1, 0);
|
||||
break;
|
||||
case library::NumericTypeID::kFE5M2:
|
||||
data_distribution.set_uniform(-1, 1, 0);
|
||||
break;
|
||||
case library::NumericTypeID::kF16:
|
||||
data_distribution.set_uniform(-3, 3, 0);
|
||||
break;
|
||||
@@ -118,12 +125,12 @@ DeviceAllocation *DeviceContext::allocate_tensor(
|
||||
|
||||
if (options.initialization.provider == library::Provider::kReferenceDevice) {
|
||||
allocation->initialize_random_device(
|
||||
options.initialization.seed,
|
||||
options.initialization.seed + seed_shift,
|
||||
data_distribution);
|
||||
}
|
||||
else if (options.initialization.provider == library::Provider::kReferenceHost) {
|
||||
allocation->initialize_random_host(
|
||||
options.initialization.seed,
|
||||
options.initialization.seed + seed_shift,
|
||||
data_distribution);
|
||||
}
|
||||
}
|
||||
@@ -140,7 +147,8 @@ DeviceAllocation *DeviceContext::allocate_sparsemeta_tensor(
|
||||
library::NumericTypeID type_a,
|
||||
std::vector<int> const &extent,
|
||||
std::vector<int64_t> const &stride,
|
||||
int batch_count) {
|
||||
int batch_count,
|
||||
int seed_shift) {
|
||||
|
||||
DeviceAllocation *allocation =
|
||||
allocate_tensor(name, type, layout_id, extent, stride, batch_count);
|
||||
@@ -151,12 +159,12 @@ DeviceAllocation *DeviceContext::allocate_sparsemeta_tensor(
|
||||
|
||||
if (options.initialization.provider == library::Provider::kReferenceDevice) {
|
||||
allocation->initialize_random_sparsemeta_device(
|
||||
options.initialization.seed,
|
||||
options.initialization.seed + seed_shift,
|
||||
MetaSizeInBits);
|
||||
}
|
||||
else if (options.initialization.provider == library::Provider::kReferenceHost) {
|
||||
allocation->initialize_random_sparsemeta_host(
|
||||
options.initialization.seed,
|
||||
options.initialization.seed + seed_shift,
|
||||
MetaSizeInBits);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -93,8 +93,9 @@ public:
|
||||
library::NumericTypeID type,
|
||||
library::LayoutTypeID layout_id,
|
||||
std::vector<int> const &extent,
|
||||
std::vector<int64_t> const &stride = std::vector<int64_t>(),
|
||||
int batch_count = 1);
|
||||
std::vector<int64_t> const &stride,
|
||||
int batch_count,
|
||||
int seed_shift = 0);
|
||||
|
||||
/// Allocates memory for sparse meta data
|
||||
DeviceAllocation *allocate_sparsemeta_tensor(
|
||||
@@ -104,8 +105,9 @@ public:
|
||||
library::LayoutTypeID layout_id,
|
||||
library::NumericTypeID type_a,
|
||||
std::vector<int> const &extent,
|
||||
std::vector<int64_t> const &stride = std::vector<int64_t>(),
|
||||
int batch_count = 1);
|
||||
std::vector<int64_t> const &stride,
|
||||
int batch_count,
|
||||
int seed_shift = 0);
|
||||
|
||||
/// Clears named allocations (but does not necessarily free memory)
|
||||
void clear();
|
||||
|
||||
@@ -61,7 +61,7 @@ GemmOperationProfiler::GemmOperationProfiler(Options const &options):
|
||||
options,
|
||||
library::OperationKind::kGemm,
|
||||
{
|
||||
{ArgumentTypeID::kEnumerated, {"gemm_kind"}, "Variant of GEMM (gemm, batched, array, universal, planar_complex, planar_complex_array)"},
|
||||
{ArgumentTypeID::kEnumerated, {"gemm_kind"}, "Variant of GEMM (universal, gemm, planar_complex, planar_complex_array)"},
|
||||
{ArgumentTypeID::kInteger, {"m", "problem-size::m"}, "M dimension of the GEMM problem space"},
|
||||
{ArgumentTypeID::kInteger, {"n", "problem-size::n"}, "N dimension of the GEMM problem space"},
|
||||
{ArgumentTypeID::kInteger, {"k", "problem-size::k"}, "K dimension of the GEMM problem space"},
|
||||
@@ -432,7 +432,7 @@ bool GemmOperationProfiler::initialize_reduction_configuration_(
|
||||
library::Provider::kCUTLASS,
|
||||
gemm_desc.tile_description.math_instruction.element_accumulator, // element workspace
|
||||
gemm_desc.tile_description.math_instruction.element_accumulator, // element accumulator
|
||||
gemm_desc.C.element, // element output
|
||||
gemm_desc.D.element, // element output
|
||||
gemm_desc.element_epilogue // element compute
|
||||
);
|
||||
|
||||
@@ -485,7 +485,7 @@ Status GemmOperationProfiler::initialize_workspace(
|
||||
}
|
||||
|
||||
if (options.execution_mode != ExecutionMode::kDryRun) {
|
||||
|
||||
int seed_shift = 0;
|
||||
gemm_workspace_.A = device_context.allocate_tensor(
|
||||
options,
|
||||
"A",
|
||||
@@ -493,7 +493,8 @@ Status GemmOperationProfiler::initialize_workspace(
|
||||
operation_desc.A.layout,
|
||||
{int(problem_.m), int(problem_.k)},
|
||||
{int(problem_.lda)},
|
||||
problem_.batch_count * gemm_workspace_.problem_count
|
||||
problem_.batch_count * gemm_workspace_.problem_count,
|
||||
seed_shift++
|
||||
);
|
||||
|
||||
gemm_workspace_.B = device_context.allocate_tensor(
|
||||
@@ -503,7 +504,8 @@ Status GemmOperationProfiler::initialize_workspace(
|
||||
operation_desc.B.layout,
|
||||
{int(problem_.k), int(problem_.n)},
|
||||
{int(problem_.ldb)},
|
||||
problem_.batch_count * gemm_workspace_.problem_count
|
||||
problem_.batch_count * gemm_workspace_.problem_count,
|
||||
seed_shift++
|
||||
);
|
||||
|
||||
gemm_workspace_.C = device_context.allocate_tensor(
|
||||
@@ -513,13 +515,14 @@ Status GemmOperationProfiler::initialize_workspace(
|
||||
operation_desc.C.layout,
|
||||
{int(problem_.m), int(problem_.n)},
|
||||
{int(problem_.ldc)},
|
||||
problem_.batch_count * gemm_workspace_.problem_count
|
||||
problem_.batch_count * gemm_workspace_.problem_count,
|
||||
seed_shift++
|
||||
);
|
||||
|
||||
gemm_workspace_.Computed = device_context.allocate_tensor(
|
||||
"D",
|
||||
operation_desc.C.element,
|
||||
operation_desc.C.layout,
|
||||
operation_desc.D.element,
|
||||
operation_desc.D.layout,
|
||||
{int(problem_.m), int(problem_.n)},
|
||||
{int(problem_.ldc)},
|
||||
problem_.batch_count * gemm_workspace_.problem_count
|
||||
@@ -527,8 +530,8 @@ Status GemmOperationProfiler::initialize_workspace(
|
||||
|
||||
gemm_workspace_.Reference = device_context.allocate_tensor(
|
||||
"Reference",
|
||||
operation_desc.C.element,
|
||||
operation_desc.C.layout,
|
||||
operation_desc.D.element,
|
||||
operation_desc.D.layout,
|
||||
{int(problem_.m), int(problem_.n)},
|
||||
{int(problem_.ldc)},
|
||||
problem_.batch_count * gemm_workspace_.problem_count
|
||||
@@ -547,6 +550,9 @@ Status GemmOperationProfiler::initialize_workspace(
|
||||
gemm_workspace_.arguments.batch_stride_B = gemm_workspace_.B->batch_stride();
|
||||
gemm_workspace_.arguments.batch_stride_C = gemm_workspace_.C->batch_stride();
|
||||
gemm_workspace_.arguments.batch_stride_D = gemm_workspace_.Computed->batch_stride();
|
||||
|
||||
/* Query device SM count to pass onto the kernel as an argument, where needed */
|
||||
gemm_workspace_.arguments.sm_count = options.device.properties.multiProcessorCount;
|
||||
}
|
||||
|
||||
//
|
||||
@@ -965,9 +971,12 @@ bool GemmOperationProfiler::verify_with_reference_(
|
||||
problem_.beta.data(),
|
||||
|
||||
gemm_desc.C.element,
|
||||
gemm_desc.C.layout,
|
||||
ptr_C,
|
||||
int(gemm_workspace_.configuration.ldc),
|
||||
|
||||
gemm_desc.D.element,
|
||||
gemm_desc.D.layout,
|
||||
ptr_D,
|
||||
int(gemm_workspace_.configuration.ldd),
|
||||
|
||||
@@ -975,8 +984,7 @@ bool GemmOperationProfiler::verify_with_reference_(
|
||||
gemm_workspace_.A->batch_stride(),
|
||||
gemm_workspace_.B->batch_stride(),
|
||||
gemm_workspace_.C->batch_stride(),
|
||||
gemm_workspace_.Reference->batch_stride()
|
||||
);
|
||||
gemm_workspace_.Reference->batch_stride());
|
||||
|
||||
if (status != Status::kSuccess) {
|
||||
results_.back().verification_map[provider] = Disposition::kNotRun;
|
||||
|
||||
@@ -66,8 +66,9 @@ public:
|
||||
|
||||
/// Problem structure obtained from problem space
|
||||
struct GemmProblem {
|
||||
|
||||
|
||||
cutlass::library::GemmUniversalMode mode;
|
||||
|
||||
int64_t m;
|
||||
int64_t n;
|
||||
int64_t k;
|
||||
|
||||
@@ -713,9 +713,10 @@ Options::Options(cutlass::CommandLine const &cmdline):
|
||||
}
|
||||
|
||||
// Prevent launches on the device for anything other than CUTLASS operation
|
||||
// Allow verification only on host
|
||||
if (execution_mode == ExecutionMode::kTrace) {
|
||||
initialization.provider = library::Provider::kReferenceHost;
|
||||
verification.enabled = false;
|
||||
verification.providers = {library::Provider::kReferenceHost};
|
||||
profiling.enabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -391,14 +391,16 @@ Status Rank2KOperationProfiler::initialize_workspace(
|
||||
static_cast<library::RankKDescription const &>(operation->description());
|
||||
|
||||
if (options.execution_mode != ExecutionMode::kDryRun) {
|
||||
|
||||
int seed_shift = 0;
|
||||
rank_k_workspace_.A = device_context.allocate_tensor(
|
||||
options,
|
||||
"A",
|
||||
operation_desc.A.element,
|
||||
operation_desc.A.layout,
|
||||
{int(problem_.n), int(problem_.k)},
|
||||
{int(problem_.lda)}
|
||||
{int(problem_.lda)},
|
||||
1, // batch_count
|
||||
seed_shift++
|
||||
);
|
||||
|
||||
rank_k_workspace_.B = device_context.allocate_tensor(
|
||||
@@ -407,7 +409,9 @@ Status Rank2KOperationProfiler::initialize_workspace(
|
||||
operation_desc.B.element,
|
||||
operation_desc.B.layout,
|
||||
{int(problem_.n), int(problem_.k)},
|
||||
{int(problem_.ldb)}
|
||||
{int(problem_.ldb)},
|
||||
1, // batch_count
|
||||
seed_shift++
|
||||
);
|
||||
|
||||
rank_k_workspace_.C = device_context.allocate_tensor(
|
||||
@@ -417,7 +421,8 @@ Status Rank2KOperationProfiler::initialize_workspace(
|
||||
operation_desc.C.layout,
|
||||
{int(problem_.n), int(problem_.n)},
|
||||
{int(problem_.ldc)},
|
||||
1 // batch_count = 1, default
|
||||
1, // batch_count
|
||||
seed_shift++
|
||||
);
|
||||
|
||||
rank_k_workspace_.Computed = device_context.allocate_tensor(
|
||||
|
||||
@@ -391,14 +391,16 @@ Status RankKOperationProfiler::initialize_workspace(
|
||||
static_cast<library::RankKDescription const &>(operation->description());
|
||||
|
||||
if (options.execution_mode != ExecutionMode::kDryRun) {
|
||||
|
||||
int seed_shift = 0;
|
||||
rank_k_workspace_.A = device_context.allocate_tensor(
|
||||
options,
|
||||
"A",
|
||||
operation_desc.A.element,
|
||||
operation_desc.A.layout,
|
||||
{int(problem_.n), int(problem_.k)},
|
||||
{int(problem_.lda)}
|
||||
{int(problem_.lda)},
|
||||
1, // batch_count
|
||||
seed_shift++
|
||||
);
|
||||
|
||||
rank_k_workspace_.C = device_context.allocate_tensor(
|
||||
@@ -408,7 +410,8 @@ Status RankKOperationProfiler::initialize_workspace(
|
||||
operation_desc.C.layout,
|
||||
{int(problem_.n), int(problem_.n)},
|
||||
{int(problem_.ldc)},
|
||||
1 // batch_count = 1, default
|
||||
1, // batch_count
|
||||
seed_shift++
|
||||
);
|
||||
|
||||
rank_k_workspace_.Computed = device_context.allocate_tensor(
|
||||
|
||||
@@ -56,7 +56,7 @@ SparseGemmOperationProfiler::SparseGemmOperationProfiler(Options const &options)
|
||||
options,
|
||||
library::OperationKind::kSparseGemm,
|
||||
{
|
||||
{ArgumentTypeID::kEnumerated, {"gemm_kind"}, "Variant of GEMM (e.g. gemm, planar complex, batched, ...)"},
|
||||
{ArgumentTypeID::kEnumerated, {"gemm_kind"}, "Variant of GEMM (e.g. sparse, ...)"},
|
||||
{ArgumentTypeID::kInteger, {"m", "problem-size::m"}, "M dimension of the GEMM problem space"},
|
||||
{ArgumentTypeID::kInteger, {"n", "problem-size::n"}, "N dimension of the GEMM problem space"},
|
||||
{ArgumentTypeID::kInteger, {"k", "problem-size::k"}, "K dimension of the GEMM problem space"},
|
||||
@@ -348,14 +348,16 @@ Status SparseGemmOperationProfiler::initialize_workspace(
|
||||
static_cast<library::SparseGemmDescription const &>(operation->description());
|
||||
|
||||
if (options.execution_mode != ExecutionMode::kDryRun) {
|
||||
|
||||
int seed_shift = 0;
|
||||
gemm_workspace_.A = device_context.allocate_tensor(
|
||||
options,
|
||||
"A",
|
||||
operation_desc.A.element,
|
||||
operation_desc.A.layout,
|
||||
{int(problem_.m), int(problem_.k) / int(problem_.sparse)},
|
||||
{int(problem_.lda)}
|
||||
{int(problem_.lda)},
|
||||
1, // batch_count
|
||||
seed_shift++
|
||||
);
|
||||
|
||||
gemm_workspace_.B = device_context.allocate_tensor(
|
||||
@@ -364,7 +366,9 @@ Status SparseGemmOperationProfiler::initialize_workspace(
|
||||
operation_desc.B.element,
|
||||
operation_desc.B.layout,
|
||||
{int(problem_.k), int(problem_.n)},
|
||||
{int(problem_.ldb)}
|
||||
{int(problem_.ldb)},
|
||||
1, // batch_count
|
||||
seed_shift++
|
||||
);
|
||||
|
||||
gemm_workspace_.C = device_context.allocate_tensor(
|
||||
@@ -373,7 +377,9 @@ Status SparseGemmOperationProfiler::initialize_workspace(
|
||||
operation_desc.C.element,
|
||||
operation_desc.C.layout,
|
||||
{int(problem_.m), int(problem_.n)},
|
||||
{int(problem_.ldc)}
|
||||
{int(problem_.ldc)},
|
||||
1, // batch_count
|
||||
seed_shift++
|
||||
);
|
||||
|
||||
gemm_workspace_.Computed = device_context.allocate_tensor(
|
||||
@@ -391,7 +397,9 @@ Status SparseGemmOperationProfiler::initialize_workspace(
|
||||
operation_desc.E.layout,
|
||||
operation_desc.A.element,
|
||||
{int(problem_.m), int(problem_.k) / int(problem_.sparse) / int(problem_.elements_per_128b)},
|
||||
{int(problem_.lde)}
|
||||
{int(problem_.lde)},
|
||||
1, // batch_count
|
||||
seed_shift++
|
||||
);
|
||||
|
||||
gemm_workspace_.Reference = device_context.allocate_tensor(
|
||||
|
||||
@@ -415,7 +415,7 @@ Status SymmOperationProfiler::initialize_workspace(
|
||||
static_cast<library::SymmDescription const &>(operation->description());
|
||||
|
||||
if (options.execution_mode != ExecutionMode::kDryRun) {
|
||||
|
||||
int seed_shift = 0;
|
||||
if (operation_desc.side_mode == SideMode::kLeft) {
|
||||
symm_workspace_.A = device_context.allocate_tensor(
|
||||
options,
|
||||
@@ -424,7 +424,8 @@ Status SymmOperationProfiler::initialize_workspace(
|
||||
operation_desc.A.layout,
|
||||
{int(problem_.m), int(problem_.m)},
|
||||
{int(problem_.lda)},
|
||||
1 // batch_count = 1, default
|
||||
1, // batch_count
|
||||
seed_shift++
|
||||
);
|
||||
} else if (operation_desc.side_mode == SideMode::kRight) {
|
||||
symm_workspace_.A = device_context.allocate_tensor(
|
||||
@@ -434,7 +435,8 @@ Status SymmOperationProfiler::initialize_workspace(
|
||||
operation_desc.A.layout,
|
||||
{int(problem_.n), int(problem_.n)},
|
||||
{int(problem_.lda)},
|
||||
1 // batch_count = 1, default
|
||||
1, // batch_count
|
||||
seed_shift++
|
||||
);
|
||||
}
|
||||
|
||||
@@ -444,7 +446,9 @@ Status SymmOperationProfiler::initialize_workspace(
|
||||
operation_desc.B.element,
|
||||
operation_desc.B.layout,
|
||||
{int(problem_.m), int(problem_.n)},
|
||||
{int(problem_.ldb)}
|
||||
{int(problem_.ldb)},
|
||||
1, // batch_count
|
||||
seed_shift++
|
||||
);
|
||||
|
||||
symm_workspace_.C = device_context.allocate_tensor(
|
||||
@@ -454,7 +458,8 @@ Status SymmOperationProfiler::initialize_workspace(
|
||||
operation_desc.C.layout,
|
||||
{int(problem_.m), int(problem_.n)},
|
||||
{int(problem_.ldc)},
|
||||
1 // batch_count = 1, default
|
||||
1, // batch_count
|
||||
seed_shift++
|
||||
);
|
||||
|
||||
symm_workspace_.Computed = device_context.allocate_tensor(
|
||||
|
||||
@@ -372,7 +372,7 @@ Status TrmmOperationProfiler::initialize_workspace(
|
||||
static_cast<library::TrmmDescription const &>(operation->description());
|
||||
|
||||
if (options.execution_mode != ExecutionMode::kDryRun) {
|
||||
|
||||
int seed_shift = 0;
|
||||
if (operation_desc.side_mode == SideMode::kLeft) {
|
||||
trmm_workspace_.A = device_context.allocate_tensor(
|
||||
options,
|
||||
@@ -381,7 +381,8 @@ Status TrmmOperationProfiler::initialize_workspace(
|
||||
operation_desc.A.layout,
|
||||
{int(problem_.m), int(problem_.m)},
|
||||
{int(problem_.lda)},
|
||||
1 // batch_count = 1, default
|
||||
1, // batch_count
|
||||
seed_shift++
|
||||
);
|
||||
} else if (operation_desc.side_mode == SideMode::kRight) {
|
||||
trmm_workspace_.A = device_context.allocate_tensor(
|
||||
@@ -391,7 +392,8 @@ Status TrmmOperationProfiler::initialize_workspace(
|
||||
operation_desc.A.layout,
|
||||
{int(problem_.n), int(problem_.n)},
|
||||
{int(problem_.lda)},
|
||||
1 // batch_count = 1, default
|
||||
1, // batch_count
|
||||
seed_shift++
|
||||
);
|
||||
}
|
||||
|
||||
@@ -401,7 +403,9 @@ Status TrmmOperationProfiler::initialize_workspace(
|
||||
operation_desc.B.element,
|
||||
operation_desc.B.layout,
|
||||
{int(problem_.m), int(problem_.n)},
|
||||
{int(problem_.ldb)}
|
||||
{int(problem_.ldb)},
|
||||
1, // batch_count
|
||||
seed_shift++
|
||||
);
|
||||
|
||||
trmm_workspace_.Computed = device_context.allocate_tensor(
|
||||
|
||||
Reference in New Issue
Block a user