Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SYCLomatic]Enable migration CUBLASLT_MATRIX_LAYOUT_BATCH_COUNT #2421

Open
wants to merge 1 commit into
base: SYCLomatic
Choose a base branch
from

Conversation

abhilash1910
Copy link
Contributor

// CHECK-NEXT: matLayout = new dpct::blas_gemm::experimental::matrix_layout_t(type, rows, cols, ld);
cublasLtMatrixLayout_t matLayout;
cudaDataType type;
uint64_t rows;
uint64_t cols;
int64_t ld;
cublasLtMatrixLayoutCreate(&matLayout, type, rows, cols, ld);
uint64_t batch_count;
cublasLtMatrixLayoutCreate(&matLayout, type, rows, cols, ld, batch_count);
Copy link
Contributor

@zhiweij1 zhiweij1 Oct 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
cublasLtMatrixLayoutCreate(&matLayout, type, rows, cols, ld, batch_count);
cublasLtMatrixLayoutCreate(&matLayout, type, rows, cols, ld);

cublasLtMatrixLayoutCreate does not accept batch_count as a parameter. https://docs.nvidia.com/cuda/cublas/#cublasltmatrixlayoutcreate

@@ -1916,6 +1916,9 @@ void MapNames::setExplicitNamespaceMap(
{"CUBLASLT_MATRIX_LAYOUT_TYPE",
getLibraryHelperNamespace() +
"blas_gemm::experimental::matrix_layout_t::attribute::type"},
{"CUBLASLT_MATRIX_LAYOUT_BATCH_COUT",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{"CUBLASLT_MATRIX_LAYOUT_BATCH_COUT",
{"CUBLASLT_MATRIX_LAYOUT_BATCH_COUNT",

@@ -62,11 +62,11 @@ class descriptor {

class matrix_layout_t {
public:
enum class attribute { type, order, rows, cols, ld };
enum class attribute { type, order, rows, cols, ld, batch_count};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
enum class attribute { type, order, rows, cols, ld, batch_count};
enum class attribute { type, order, rows, cols, ld, batch_count };

Comment on lines +68 to +69
std::int64_t ld, std::uint64_t batch_count=1)
: _type(type), _rows(rows), _cols(cols), _ld(ld), _batch_count(batch_count) {}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer to keep the constructor since its parameters can 1:1 mapping to cublasLtMatrixLayoutCreate. We can use set/get_attribute() to access the value.
And please add a private std::uint64_t _batch_count; member in this class.

Suggested change
std::int64_t ld, std::uint64_t batch_count=1)
: _type(type), _rows(rows), _cols(cols), _ld(ld), _batch_count(batch_count) {}
std::int64_t ld)
: _type(type), _rows(rows), _cols(cols), _ld(ld)) {}

Copy link
Contributor

@zhiweij1 zhiweij1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants