-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Update CUDA sdpa #2468
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
Update CUDA sdpa #2468
Conversation
inline fe::DataType_t dtype_to_cudnn_type(Dtype dtype) { | ||
switch (dtype) { | ||
case int8: | ||
return fe::DataType_t::INT8; | ||
case int32: | ||
return fe::DataType_t::INT32; | ||
case uint8: | ||
return fe::DataType_t::UINT8; | ||
case float16: | ||
return fe::DataType_t::HALF; | ||
case bfloat16: | ||
return fe::DataType_t::BFLOAT16; | ||
case float32: | ||
return fe::DataType_t::FLOAT; | ||
case float64: | ||
return fe::DataType_t::DOUBLE; | ||
default: | ||
throw std::runtime_error(fmt::format( | ||
"Unsupported dtype in SDPA: {}.", dtype_to_string(dtype))); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can refactor that into a shared header cuddn.h
that gets reused by conv.cpp
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks awesome! Let's merge it after you fix the compile issue and the tests clear
Proposed changes
Checklist
Put an
x
in the boxes that apply.pre-commit run --all-files
to format my code / installed pre-commit prior to committing changes