Comments (5)
Hello @iclementine and thank you for reporting this issue! I can verify that vectorization doesn't happen due to the extra template parameter. It's also the case for the warp load algorithm. I have a local fix that removes extra template parameters and leads to vectorized loads, but I don't think we can merge it right now. The issue is that vectorized load guarantees that:
/* - The following conditions will prevent vectorization and loading will fall
* back to cub::BLOCK_LOAD_DIRECT:
* - The block input offset is not quadword-aligned
*/
There are no checks of the input alignment. When given a pointer that's not aligned to the vectorized type, block / warp load leads to invalid loads. I believe this has to be addressed before enabling vectorization.
from cub.
@iclementine thank you for noticing that! Could you please reopen the issue against https://github.com/NVIDIA/cccl? We are transitioning to that repo at the moment, so all the issue tracking happens there. Also, please update the issue name to include warp-scope.
@senior-zero Thank you. I've reopen an issue at NVIDIA/cccl#431.
from cub.
Thank you, @senior-zero. Yes, InputT
is a template parameter of BlockLoad
( I missed that.)
BTW, I also tried removing that template parameter which enables vectorized load. But I've found another issue that some functions like ThreadLoad
(which is used by BlockLoad
) does not have const T*
as input parameter, which prevents passing in const T*
to BlockLoad::Load
in some cases. The non-constness propagates all the way to user code. I hope there will be a fixe to that too.
#pragma unroll
for (int ITEM = 0; ITEM < VECTORS_PER_THREAD; ITEM++)
{
vec_items[ITEM] = ThreadLoad<MODIFIER>(vec_ptr + ITEM);
}
template <typename T>
__device__ __forceinline__ T ThreadLoad(
T *ptr,
Int2Type<LOAD_DEFAULT> /*modifier*/,
Int2Type<true> /*is_pointer*/)
{
return *ptr;
}
from cub.
@iclementine thank you for noticing that! Could you please reopen the issue against https://github.com/NVIDIA/cccl? We are transitioning to that repo at the moment, so all the issue tracking happens there. Also, please update the issue name to include warp-scope.
from cub.
@iclementine thank you! I'm closing this one in this case.
from cub.
Related Issues (20)
- DeviceMemcpy::Batched supports only memory buffers HOT 4
- Specialize DeviceMemcpy::Batched to also support iterators HOT 1
- Documentation of warp-wide collectives refers to `__syncthreads` instead of `__syncwarp` HOT 1
- Add policy parameter to allow tuning
- Unresolved extern function 'cudaLaunchDevice' error while using NVCC 11.x and cub 2.10 with -G HOT 3
- Make decoupled look-back delay part of tuning HOT 2
- Implement tuning db merger HOT 3
- Write example for decoupled look-back API
- Segfault in CachingDeviceAllocator when out of memory HOT 4
- Tune Decoupled Look-back based Algorithms for H100 HOT 1
- Can't get correct result when use cub in CUDA12.0 HOT 24
- Illegal memory access on trying to use `DeviceReduce::Sum()` to count number of non-zeros HOT 2
- What is the correct compile command in Linux platform to compile a function citing cuh? HOT 1
- Segmented sorting does not preserve data in-between segments. HOT 6
- Misleading documentation for DeviceSegmentedRadixSort (or I'm using it wrong) HOT 1
- what's the purpose of CUB_SUBSCRIPTION_FACTOR
- select_if kernel needs grid boundary or reprogramming tile_idx HOT 1
- Possible bug in variable naming HOT 2
- How do I reduce partially filled 2D blocks? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cub.