Repository navigation
Closed
Description
Functional/Non-Functional C++ Tile Evaluation
Tile-based GPU programming is a promising direction for both providing performance and maintainable code. As a new technology, it is fundamental to explore and evaluate capabilities and limitations in the context of CCCL algorithms.
In particular, this issue lists several functional and non-functional properties that should be covered to get a robust understanding of the new programming approach. This step is critical to understand future directions and development effort.
We will focus on the following routine for the exploration:
Functional
-
Correctness
- What (current) cuTile limitations prevent algorithm implementation?
- Numerical behavior compared to CUDA C++ implementation.
- Could GPU arch-dependencies or constrains impact correctness?
-
API surface
- What new APIs are introduced? and they could be coupled together with existing one? (are they stable, experimental, internal?)
- Which input sizes, ranks, layouts, data types, execution spaces, or iterator/category are supported?
-
Interoperability
- Interaction with existing CCCL components: CUB, Thrust, libcudacxx, CMake targets, tests, benchmarks.
Non-functional properties
Implementation Complexity
- Is Tile documented enough?
- Does the Tile implementation reduce or increase the amount work?
- Are diagnostics good enough to understand the problem?
- How well it support direct or automatic tuning?
Maintainability
- Are implementation details isolated from public APIs?
- What could be enforced in Debug mode?
Performance
- Is Tile mature enough to compete with C++ implementation in terms of perfomance metrics? (do they have the same distribution properties, see NVBench)
- Launch overhead? Impact of tuning?
- Compilation intermediate steps inspection, e.g. IR
Ecosystem
- How current tools Nsight Compute/Systems,
nvdisasm,cuobjdumpinteract with Tile?
Compile time
- How Tile compared to C++ implementation?
- Linking time?
Binary size
- Any changes in final or intermediate artifacts, e.g object files, fatbin
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
- StatusShow more project fieldsDone
Activity
nanan-nvidia commentedon May 18, 2026
A tile kernel was implemented and did some test runs on RTX A6000 ADA.
Of the 22
CUB::DeviceTransformbenches ran on RTX A6000 ADA, 20 of them is on the same performance as CUB. The ones that showed sigificant performance degrade are two cases:fibonacciandheavy.1. fibonacci
Measurements
Code on each side
CUB (
bench/fib_cub.cu):Tile (
bench/fib_tile.cu):The fundemental reason for performance difference is because how the tile semantics works : we have to operate on the whole tile. Therefore, we have to use fully unroll the kernel with
ct::selectwhich does a lot more wasted compute.2. heavy
The tile kernel fails to launch at any size beyond 6K elements because
Device-side malloc failed.The tile function is as follows:
At compile time, lets say the input is
intand withN=8andTileSize=256,Tistile<int, shape<256>>. Here, with normal cuda semantics this should be 8 registers per thread; however, the nvcc frontend lowers this toFor
N=8withTileSize=256, that is8 x 256 x 4 = 8192 bytes. This gets lowered to amalloccall on GPU:Therefore,
reg[N]is entirely on global memory and allocated on heap (I did not even know you can call malloc on GPUs, LOL), which causes sigificant performance degrade and failures when there are too many elements to malloc.Not sure if this is the expected behavior of the front end, since for those cases we'd expect them to be on registers.
nanan-nvidia commentedon Jun 1, 2026
Benchmarks on B200s are on #9210. Walking through the checklist with answers we can give today.
Functional
Correctness
cuTile limitations preventing algorithm implementation:
std::complexNumerical behavior: We have correctness tests in #9210, all of them pass.
Arch dependencies: cutile only supports sm80+.
Interoperability
__tile__kernels are basically standalone and cannot be interleaved with SIMT kernels.Non-functional
Implementation Complexity
Maintainability
Performance
Discussed in detail in #9210.
Ecosystem
Compile time
Results from cross compiling for sm_100 on my local workstation,
--enable-tilevs CUB:Tile is about 25 - 30% faster to compile.
Binary size
Tile binaries are ~35-45% smaller.
Note that those comparison is unfair to CUB since it is a much bigger library.
fbusato commentedon Jun 2, 2026
amazing analysis. I have many questions:
This seems not a blocker. I guess unvectorized loads have comparable performance with CUB in the same conditions.
Could you be more specific? are all fundamental C++ types supported? from
chartolong long,float,int128, extended floating-point types, pointers, structure, complex, etc.what kind of array? C raw array, std::array? and where? e.g. passed by argument, local variable, etc.
My main concern is about floating-point. I don't think we can get identical results with C++ implementation.
we also depend on the CTK version and C++ versions (>= c++20), right?
wow
this is surprising to me. I would expect the opposite as it adds more steps for the compiler, not less. I don't have a strong reason for that, maybe because it is just less code to compile.
The compiler strips practically everything that is not used in C++. This is also amazing, considering that performance benefits!
bernhardmgruber commentedon Jun 2, 2026
Not for the ublkcp kernel of
DeviceTransform, which should perform well for unaligned inputs ;) I would be very curious to also compare performance of a tile kernel withDeviceTransformwhere the input is off by 1 element and the size is reduced by 2 elements (so input is unaligned + oddly sized)I am surprised, since the ublkcp kernel has about 200 SASS instructions. I am curious how tile can do it in less. Unless the entire programming model is different. Doesn't the binary store some intermediate language as well (like PTX) and JIT compiles the tile kernel when loading?
cub::DeviceTransformpulls in a TON of headers to cover a lot of edge cases. I am not surprised Tile is ahead. Also, Tile can handle a lot more logic in the compiler. Like, it doesn't need all the headers for libcuda-ptx, bulk copy, barriers, all the CUB launching and tuning infrastructure, arch utilities, etc. Thinking about it, I think Tile should actually be a lot faster than CUB. Does-fdevice-time-tracework for Tile kernels btw? Can we get a compilation trace?I really love the results so far, this is going into a good direction! I am curious