Skip to content

[CuTeDSL] Add dataclass example: passing pointers via frozen dataclass#3070

Merged
Junkai-Wu merged 2 commits intoNVIDIA:mainfrom
fengxie:add-dataclass-example
Mar 30, 2026
Merged

[CuTeDSL] Add dataclass example: passing pointers via frozen dataclass#3070
Junkai-Wu merged 2 commits intoNVIDIA:mainfrom
fengxie:add-dataclass-example

Conversation

@fengxie
Copy link
Copy Markdown
Collaborator

@fengxie fengxie commented Feb 25, 2026

Demonstrates passing pointers from tensor arguments in @cute.jit to @cute.kernel using @DataClass(frozen=True). Shows the pattern of extracting pointers with tensor.iterator, bundling into a dataclass, and reconstructing tensors in the kernel.

Uses fake tensors for compilation and TVM-FFI for runtime dispatch.

Demonstrates passing pointers from tensor arguments in @cute.jit to
@cute.kernel using @DataClass(frozen=True). Shows the pattern of
extracting pointers with tensor.iterator, bundling into a dataclass,
and reconstructing tensors in the kernel.

Uses fake tensors for compilation and TVM-FFI for runtime dispatch.

Co-authored-by: Cursor <cursoragent@cursor.com>
@fengxie fengxie changed the title Add dataclass example: passing pointers via frozen dataclass [CuTe DSL] Add dataclass example: passing pointers via frozen dataclass Feb 25, 2026
@fengxie fengxie changed the title [CuTe DSL] Add dataclass example: passing pointers via frozen dataclass [CuTeDSL] Add dataclass example: passing pointers via frozen dataclass Feb 25, 2026
@fengxie fengxie force-pushed the add-dataclass-example branch 2 times, most recently from 2469879 to 2e878e6 Compare February 25, 2026 16:44
Demonstrates passing tensors from @cute.jit to @cute.kernel using
@DataClass(frozen=True). Shows the pattern of bundling tensors into
a dataclass with static configuration.

Uses fake tensors for compilation and TVM-FFI for runtime dispatch.
Includes reference check against PyTorch implementation.

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions
Copy link
Copy Markdown

This PR has been labeled inactive-30d due to no recent activity in the past 30 days. Please close this PR if it is no longer required. Otherwise, please respond with a comment indicating any updates. This PR will be labeled inactive-90d if there is no activity in the next 60 days.

@Junkai-Wu Junkai-Wu merged commit 4ca61d0 into NVIDIA:main Mar 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants