CUTLASS 3.6.0 (#1850)
* v3.6 * update changelog * update readme * fix typo * fixing typos * hopper gemm with weight prefetch --------- Co-authored-by: yuzhai <yuzhai@nvidia.com> Co-authored-by: Haicheng Wu <haichengw@nvidia.com>
This commit is contained in:
co-authored by
yuzhai
Haicheng Wu
parent
0837a2a00a
commit
cc3c29a81a
@@ -29,7 +29,7 @@
|
||||
*
|
||||
**************************************************************************************************/
|
||||
/* \file
|
||||
\brief
|
||||
\brief
|
||||
*/
|
||||
|
||||
#include "cutlass/profiler/device_context.h"
|
||||
@@ -41,29 +41,16 @@ namespace profiler {
|
||||
|
||||
/// Allocates memory of a given type, capacity (elements), and name
|
||||
DeviceAllocation *DeviceContext::allocate_block(
|
||||
Options const &options,
|
||||
std::string const &name,
|
||||
library::NumericTypeID type,
|
||||
size_t capacity) {
|
||||
library::NumericTypeID type,
|
||||
size_t capacity,
|
||||
size_t device_index) {
|
||||
|
||||
device_memory_.emplace_back(type, capacity);
|
||||
int device = options.device.device_id(device_index);
|
||||
device_memory_.emplace_back(type, capacity, device);
|
||||
DeviceAllocation *allocation = &device_memory_.back();
|
||||
|
||||
allocations_[name] = allocation;
|
||||
return allocation;
|
||||
}
|
||||
|
||||
/// Allocates memory of a given type, capacity (elements), and name
|
||||
DeviceAllocation *DeviceContext::allocate_tensor(
|
||||
std::string const &name,
|
||||
library::NumericTypeID type,
|
||||
library::LayoutTypeID layout_id,
|
||||
std::vector<int> const &extent,
|
||||
std::vector<int64_t> const &stride,
|
||||
int batch_count) {
|
||||
|
||||
device_memory_.emplace_back(type, layout_id, extent, stride, batch_count);
|
||||
DeviceAllocation *allocation = &device_memory_.back();
|
||||
|
||||
allocations_[name] = allocation;
|
||||
return allocation;
|
||||
}
|
||||
@@ -72,18 +59,40 @@ DeviceAllocation *DeviceContext::allocate_tensor(
|
||||
DeviceAllocation *DeviceContext::allocate_tensor(
|
||||
Options const &options,
|
||||
std::string const &name,
|
||||
library::NumericTypeID type,
|
||||
library::LayoutTypeID layout_id,
|
||||
std::vector<int> const &extent,
|
||||
library::NumericTypeID type,
|
||||
library::LayoutTypeID layout_id,
|
||||
std::vector<int> const &extent,
|
||||
std::vector<int64_t> const &stride,
|
||||
int batch_count,
|
||||
int seed_shift) {
|
||||
size_t device_index) {
|
||||
|
||||
DeviceAllocation *allocation =
|
||||
allocate_tensor(name, type, layout_id, extent, stride, batch_count);
|
||||
int device = options.device.device_id(device_index);
|
||||
device_memory_.emplace_back(type, layout_id, extent, stride, batch_count,
|
||||
device);
|
||||
DeviceAllocation *allocation = &device_memory_.back();
|
||||
|
||||
allocations_[name] = allocation;
|
||||
return allocation;
|
||||
}
|
||||
|
||||
/// Allocates memory of a given type, capacity (elements), and name
|
||||
DeviceAllocation *DeviceContext::allocate_and_initialize_tensor(
|
||||
Options const &options,
|
||||
std::string const &name,
|
||||
library::NumericTypeID type,
|
||||
library::LayoutTypeID layout_id,
|
||||
std::vector<int> const &extent,
|
||||
std::vector<int64_t> const &stride,
|
||||
int batch_count,
|
||||
int seed_shift,
|
||||
size_t device_index) {
|
||||
|
||||
DeviceAllocation *allocation =
|
||||
allocate_tensor(options, name, type, layout_id, extent, stride,
|
||||
batch_count, device_index);
|
||||
|
||||
if (options.initialization.enabled) {
|
||||
Distribution data_distribution = options.initialization.data_distribution;
|
||||
Distribution data_distribution = options.initialization.data_distribution;
|
||||
|
||||
// check if data distribution is allowed to change
|
||||
if(!options.initialization.fix_data_distribution) {
|
||||
@@ -129,13 +138,13 @@ DeviceAllocation *DeviceContext::allocate_tensor(
|
||||
double stddev = data_distribution.gaussian.stddev;
|
||||
int scale = data_distribution.int_scale;
|
||||
|
||||
if (name == "A" && data_distribution.gaussian.pnzA != 100.0) {
|
||||
if (name == "A" && data_distribution.gaussian.pnzA != 1.0) {
|
||||
data_distribution.set_gaussian(mean, stddev, scale, data_distribution.gaussian.pnzA);
|
||||
}
|
||||
else if (name == "B" && data_distribution.gaussian.pnzB != 100.0) {
|
||||
else if (name == "B" && data_distribution.gaussian.pnzB != 1.0) {
|
||||
data_distribution.set_gaussian(mean, stddev, scale, data_distribution.gaussian.pnzB);
|
||||
}
|
||||
else if (name == "C" && data_distribution.gaussian.pnzC != 100.0) {
|
||||
else if (name == "C" && data_distribution.gaussian.pnzC != 1.0) {
|
||||
data_distribution.set_gaussian(mean, stddev, scale, data_distribution.gaussian.pnzC);
|
||||
}
|
||||
}
|
||||
@@ -147,7 +156,7 @@ DeviceAllocation *DeviceContext::allocate_tensor(
|
||||
}
|
||||
else {
|
||||
allocation->initialize_random_device(
|
||||
options.initialization.seed + seed_shift,
|
||||
options.initialization.seed + seed_shift,
|
||||
data_distribution);
|
||||
}
|
||||
}
|
||||
@@ -158,7 +167,7 @@ DeviceAllocation *DeviceContext::allocate_tensor(
|
||||
}
|
||||
else {
|
||||
allocation->initialize_random_host(
|
||||
options.initialization.seed + seed_shift,
|
||||
options.initialization.seed + seed_shift,
|
||||
data_distribution);
|
||||
}
|
||||
}
|
||||
@@ -167,20 +176,22 @@ DeviceAllocation *DeviceContext::allocate_tensor(
|
||||
return allocation;
|
||||
}
|
||||
|
||||
/// Allocates memory for sparse meta data
|
||||
DeviceAllocation *DeviceContext::allocate_sparsemeta_tensor(
|
||||
/// Allocates memory for sparse meta data
|
||||
DeviceAllocation *DeviceContext::allocate_and_initialize_sparsemeta_tensor(
|
||||
Options const &options,
|
||||
std::string const &name,
|
||||
library::NumericTypeID type,
|
||||
library::LayoutTypeID layout_id,
|
||||
library::NumericTypeID type,
|
||||
library::LayoutTypeID layout_id,
|
||||
library::NumericTypeID type_a,
|
||||
std::vector<int> const &extent,
|
||||
std::vector<int> const &extent,
|
||||
std::vector<int64_t> const &stride,
|
||||
int batch_count,
|
||||
int seed_shift) {
|
||||
int seed_shift,
|
||||
size_t device_index) {
|
||||
|
||||
DeviceAllocation *allocation =
|
||||
allocate_tensor(name, type, layout_id, extent, stride, batch_count);
|
||||
DeviceAllocation *allocation =
|
||||
allocate_tensor(options, name, type, layout_id, extent, stride,
|
||||
batch_count, device_index);
|
||||
|
||||
if (options.initialization.enabled) {
|
||||
// TF32 has 4bit meta data. The rest has 2bit.
|
||||
@@ -188,12 +199,12 @@ DeviceAllocation *DeviceContext::allocate_sparsemeta_tensor(
|
||||
|
||||
if (options.initialization.provider == library::Provider::kReferenceDevice) {
|
||||
allocation->initialize_random_sparsemeta_device(
|
||||
options.initialization.seed + seed_shift,
|
||||
options.initialization.seed + seed_shift,
|
||||
MetaSizeInBits);
|
||||
}
|
||||
else if (options.initialization.provider == library::Provider::kReferenceHost) {
|
||||
allocation->initialize_random_sparsemeta_host(
|
||||
options.initialization.seed + seed_shift,
|
||||
options.initialization.seed + seed_shift,
|
||||
MetaSizeInBits);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user