feat: optimal BLOCK_SIZE for cuda kernel and support Iluvatar SwigLU#17
Open
zhangyue207 wants to merge 5 commits intofeat/dev-infrafrom
Open
feat: optimal BLOCK_SIZE for cuda kernel and support Iluvatar SwigLU#17zhangyue207 wants to merge 5 commits intofeat/dev-infrafrom
BLOCK_SIZE for cuda kernel and support Iluvatar SwigLU#17zhangyue207 wants to merge 5 commits intofeat/dev-infrafrom
Conversation
BLOCK_SIZE for cuda kernel and support Iluvatar SwigLU
… caching - Implemented `operator==` and `operator!=` for the `Device` class to facilitate comparison. - Introduced `CacheKey` struct in `operator.h` to enhance caching mechanism with a hash and vector of tensors. - Updated the `Operator::call` method to utilize `CacheKey` for caching operators based on input arguments. - Added `MetaEqual` method in `Tensor` class for tensor comparison based on metadata.
… comparison - Changed the namespace of `CacheKey` to `infini::ops::detail` for better organization. - Updated the hash and equality operators for `CacheKey` to reflect the new namespace. - Removed the `MetaEqual` method from the `Tensor` class and replaced it with a dedicated `std::equal_to` specialization for `Tensor` to improve comparison logic.
- Moved CPU casting functions to a new file `common/cpu/cast.h` and updated the `Cast` function to utilize these utilities. - Updated CUDA kernel files to include the new casting utilities and improved block size handling in kernel launches. - Enhanced the `Add`, `CausalSoftmax`, `Gemm`, `RmsNorm`, and `Swiglu` operators to utilize the new casting mechanisms for better type handling. - Added support for additional data types in tests and adjusted test cases for consistency across CPU and GPU backends.
6096e3f to
a6f3529
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
QueryMaxThreadsPerBlockfor Iluvatar platformBLOCK_SIZEin cuda kernelsSwiGLUfor Iluvatar platformAdddevice code and kernel launcher