Skip to content

mlir: add gpu_block and gpu_thread, gpu_lane, gpu_warp primitive - #100

Merged
yadej merged 8 commits into
xtc-tools:mainfrom
yadej:dev/rcesista/add-gpu-primitive
Sep 28, 2026
Merged

yadej merged 8 commits into
xtc-tools:mainfrom
yadej:dev/rcesista/add-gpu-primitive

Conversation

@yadej

@yadej yadej commented Jun 29, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

The current version of appointing gpu block id or thread id is not very good.
So to be more flexible we should be able to choose what GPU block or thread dimension we want a loop to be.

Description

Add 4 primitives gpu_block and gpu_thread, gpu_lane, and gpu_warp to the scheduler.
Each primitive accepts at most a list of 3 elements each mapped to a certain dimension.
It works with memref and tensor. Also work with descript.
Only works on CUDA cores.

Limitation

The mapping of a thread can only be done on a loop that is a tile.
Doesn't work with splitting yet.

TODO:

  • Find a way to be able to determine the number of thread of gpu_thread without depending on gpu_block

Next Step:

  • Make it work with splitting
  • Add shared memory
  • Make it work with tensor cores
  • Maybe gpu work on tvm

@yadej
yadej force-pushed the dev/rcesista/add-gpu-primitive branch from 93e70a1 to e549085 Compare July 27, 2026 08:08
@codecov

codecov Bot commented Jul 27, 2026 •

Copy link
Copy Markdown

@yadej
yadej force-pushed the dev/rcesista/add-gpu-primitive branch from e549085 to b914e5f Compare August 4, 2026 07:59
@yadej yadej changed the title mlir: add gpu_block and gpu_thread primitive mlir: add gpu_block and gpu_thread, gpu_lane, gpu_warp primitive Aug 4, 2026
@yadej
yadej force-pushed the dev/rcesista/add-gpu-primitive branch from b914e5f to 96d17ee Compare September 8, 2026 07:39
@yadej
yadej force-pushed the dev/rcesista/add-gpu-primitive branch 2 times, most recently from ef7c848 to 9a52f78 Compare September 21, 2026 15:06
@yadej
yadej force-pushed the dev/rcesista/add-gpu-primitive branch from 9a52f78 to 66dd8d1 Compare September 22, 2026 11:13
Fix some tests on gpu + add schedule to nvgpu test
@yadej
yadej force-pushed the dev/rcesista/add-gpu-primitive branch from 66dd8d1 to b6973f7 Compare September 22, 2026 11:57
@yadej
yadej marked this pull request as ready for review September 22, 2026 12:22
@yadej
yadej requested a review from guillon September 22, 2026 12:27
@liamsemeria liamsemeria added the enhancement New feature or request label Sep 22, 2026
…that we don't put loop to several gpu_primitive

@guillon guillon left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great!

In the description you mention "Also should work with descript", though you implemented it, didn't you?

@yadej

yadej commented Sep 23, 2026

Copy link
Copy Markdown
Contributor Author

Yeah it is implemented since there is descript test on that.

@yadej
yadej merged commit 11277b4 into xtc-tools:main Sep 28, 2026
10 checks passed
@yadej
yadej deleted the dev/rcesista/add-gpu-primitive branch September 28, 2026 08:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants