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

Release notes for cudnn-frontend 1.5.2: #86

Merged
merged 1 commit into from
Jun 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.17)

project(cudnn_frontend VERSION 1.5.1)
project(cudnn_frontend VERSION 1.5.2)

option(CUDNN_FRONTEND_SKIP_JSON_LIB "Defines whether FE should not include nlohmann/json.hpp." OFF)
option(CUDNN_FRONTEND_BUILD_SAMPLES "Defines if samples are built or not." ON)
Expand Down
2 changes: 1 addition & 1 deletion include/cudnn_frontend.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@

#define CUDNN_FRONTEND_MAJOR_VERSION 1
#define CUDNN_FRONTEND_MINOR_VERSION 5
#define CUDNN_FRONTEND_PATCH_VERSION 1
#define CUDNN_FRONTEND_PATCH_VERSION 2
#define CUDNN_FRONTEND_VERSION \
((CUDNN_FRONTEND_MAJOR_VERSION * 10000) + (CUDNN_FRONTEND_MINOR_VERSION * 100) + CUDNN_FRONTEND_PATCH_VERSION)

Expand Down
66 changes: 38 additions & 28 deletions include/cudnn_frontend/node/scaled_dot_product_flash_attention.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,20 +38,25 @@ class SDPANode : public NodeCRTP<SDPANode> {

// check that Q, K, V, O tensors has been assigned
// check that dim and strides has been assigned and last stride is 1
#define CUDNN_FE_SDPA_VALIDATE_DIM_STRIDE(port, port_map) \
{ \
std::shared_ptr<Tensor_attributes> tensor_ptr = port_map.at(port); \
RETURN_CUDNN_FRONTEND_ERROR_IF(tensor_ptr->get_dim().size() != 4, \
error_code_t::ATTRIBUTE_NOT_SET, \
"The dim for " + std::string(#port) + " is invalid"); \
RETURN_CUDNN_FRONTEND_ERROR_IF(tensor_ptr->get_stride().size() != 4, \
error_code_t::ATTRIBUTE_NOT_SET, \
"The stride for " + std::string(#port) + " is invalid"); \
RETURN_CUDNN_FRONTEND_ERROR_IF( \
tensor_ptr->get_stride()[3] != 1, \
error_code_t::GRAPH_NOT_SUPPORTED, \
"The stride for the last dimension corresponding to the embedding size per head should be 1 for " + \
std::string(#port)); \
#define CUDNN_FE_SDPA_VALIDATE_DIM_STRIDE(port, port_map) \
{ \
std::shared_ptr<Tensor_attributes> tensor_ptr = port_map.at(port); \
RETURN_CUDNN_FRONTEND_ERROR_IF(tensor_ptr->get_dim().size() != 4, \
error_code_t::ATTRIBUTE_NOT_SET, \
"The dim for " + std::string(#port) + " is invalid"); \
RETURN_CUDNN_FRONTEND_ERROR_IF(tensor_ptr->get_stride().size() != 4, \
error_code_t::ATTRIBUTE_NOT_SET, \
"The stride for " + std::string(#port) + " is invalid"); \
RETURN_CUDNN_FRONTEND_ERROR_IF( \
tensor_ptr->get_stride()[3] != 1, \
error_code_t::GRAPH_NOT_SUPPORTED, \
"The stride for the last dimension corresponding to the embedding size per head should be 1 for " + \
std::string(#port)); \
RETURN_CUDNN_FRONTEND_ERROR_IF( \
tensor_ptr->get_stride()[2] == 0, \
error_code_t::GRAPH_NOT_SUPPORTED, \
"The stride for the dimension corresponding to the sequence lengths per head should not be 0 for " + \
std::string(#port)); \
}

CUDNN_FE_VALIDATE_INPUT_TENSOR(input_names::Q);
Expand Down Expand Up @@ -681,20 +686,25 @@ class SDPABackwardNode : public NodeCRTP<SDPABackwardNode> {

// check that Q, K, V, O, stats, dO, dQ, dK, dV tensors has been assigned
// check that dim and strides has been assigned and last stride is 1
#define CUDNN_FE_SDPA_VALIDATE_DIM_STRIDE(port, port_map) \
{ \
std::shared_ptr<Tensor_attributes> tensor_ptr = port_map.at(port); \
RETURN_CUDNN_FRONTEND_ERROR_IF(tensor_ptr->get_dim().size() != 4, \
error_code_t::ATTRIBUTE_NOT_SET, \
"The dim for " + std::string(#port) + " is invalid"); \
RETURN_CUDNN_FRONTEND_ERROR_IF(tensor_ptr->get_stride().size() != 4, \
error_code_t::ATTRIBUTE_NOT_SET, \
"The stride for " + std::string(#port) + " is invalid"); \
RETURN_CUDNN_FRONTEND_ERROR_IF( \
tensor_ptr->get_stride()[3] != 1, \
error_code_t::GRAPH_NOT_SUPPORTED, \
"The stride for the last dimension corresponding to the embedding size per head should be 1 for " + \
std::string(#port)); \
#define CUDNN_FE_SDPA_VALIDATE_DIM_STRIDE(port, port_map) \
{ \
std::shared_ptr<Tensor_attributes> tensor_ptr = port_map.at(port); \
RETURN_CUDNN_FRONTEND_ERROR_IF(tensor_ptr->get_dim().size() != 4, \
error_code_t::ATTRIBUTE_NOT_SET, \
"The dim for " + std::string(#port) + " is invalid"); \
RETURN_CUDNN_FRONTEND_ERROR_IF(tensor_ptr->get_stride().size() != 4, \
error_code_t::ATTRIBUTE_NOT_SET, \
"The stride for " + std::string(#port) + " is invalid"); \
RETURN_CUDNN_FRONTEND_ERROR_IF( \
tensor_ptr->get_stride()[3] != 1, \
error_code_t::GRAPH_NOT_SUPPORTED, \
"The stride for the last dimension corresponding to the embedding size per head should be 1 for " + \
std::string(#port)); \
RETURN_CUDNN_FRONTEND_ERROR_IF( \
tensor_ptr->get_stride()[2] == 0, \
error_code_t::GRAPH_NOT_SUPPORTED, \
"The stride for the dimension corresponding to the sequence lengths per head should not be 0 for " + \
std::string(#port)); \
}

CUDNN_FE_VALIDATE_INPUT_TENSOR(input_names::Q);
Expand Down
2 changes: 1 addition & 1 deletion include/cudnn_frontend_Tensor.h
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ class TensorBuilder_v8 {
"CUDNN_BACKEND_TENSOR_DESCRIPTOR: Check and Set the CUDNN_ATTR_TENSOR_UNIQUE_ID as a valid value");
return std::move(m_tensor);
}
if (m_tensor.btensor_strA[0] <= 0) {
if (m_tensor.btensor_strA[0] < 0) {
set_error_and_throw_exception(
&m_tensor,
CUDNN_STATUS_BAD_PARAM,
Expand Down
2 changes: 1 addition & 1 deletion python/cudnn/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

from .datatypes import _library_type, _is_torch_tensor

__version__ = "1.5.1"
__version__ = "1.5.2"


def _tensor(
Expand Down