Skip to content

LaunchConfig.grid is in the wrong unit if .cluster is set #867

Description

@leofang

When comparing notes between cuda.core and cccl-rt @pciolkosz and I noticed one discrepancy. The public example code we have

# prepare launch config
grid = 4
cluster = 2
block = 32
config = LaunchConfig(grid=grid, cluster=cluster, block=block)

is meant to match the C++ counterpart

cudax::make_hierarchy(cudax::grid_dims(4), cudax::cluster_dims(2), cudax::block_dims(32));

However, it actually does not because cuda.core generates the following output today:

$ python thread_block_cluster.py 
grid dim: (4, 1, 1)
cluster dim: (2, 1, 1)
block dim: (32, 1, 1)
done!

which is wrong. The reason is that we did not do a proper unit conversion internally. When .cluster is set, .grid = 4 should mean we have 4 clusters, not 4 blocks. The correct output should be

grid dim: (8, 1, 1)
cluster dim: (2, 1, 1)
block dim: (32, 1, 1)

Metadata

Metadata

Assignees

Labels

P0High priority - Must do!bugSomething isn't workingcuda.coreEverything related to the cuda.core moduletriageNeeds the team's attention

Type

No type

Projects

Status
Done

Relationships

None yet

Development

No branches or pull requests

Issue actions