-
Notifications
You must be signed in to change notification settings - Fork 65
Add a nvfp4 gemv example #69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
The tests can pass with the latest CuTe DSL release For NVFP4 GEMV (using FFMA to simulate the computation logic) For NVFP4 GEMM (using tensor-core) For NVFP4 dual_gemm(using tensor-core) For NVFP4 group gemm(using tensor-core) |
| # Slice to per mma tile index | ||
| # | ||
| # ((atom_v, rest_v), RestK) | ||
| tAgA = tAgA[(None, mma_tile_coord_mnl[0], None, mma_tile_coord_mnl[2])] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename tAgA_mkl
| # Wait for AB buffer empty | ||
| ab_empty = ab_producer.acquire_and_advance() | ||
|
|
||
| # TMALDG A/B1/B2/SFA/SFB1/SFB2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change comment to TMA load
| tTR_gC[None, None, None, None, 0, 0, 0].shape, cutlass.Float32 | ||
| ) | ||
| # (T2R_M, T2R_N, EPI_M, EPI_N) | ||
| tTR_rAcc2 = cute.make_fragment( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
replace this with make_rmem_tensor_like
|
|
||
| # Release tensor memory allocation lock | ||
| if warp_idx == 0: | ||
| cute.arch.relinquish_tmem_alloc_permit() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this.
| m, n, k, l = problem_size | ||
|
|
||
| # Setup attributes that depend on gemm inputs | ||
| cta_tile_shape_mnk = ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove cta_tile_shape_mnk and directly use mma_tiler_mnk
| ) | ||
| atom_thr_size = cute.size(tiled_mma.thr_id.shape) | ||
|
|
||
| # TMA load for A |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
replace with setup TMA for A
| key_size_b = lambda item: item[1][1] * item[1][2] | ||
| key_size_c = lambda item: item[1][0] * item[1][1] | ||
| # Find the indices of the groups with the smallest tensor sizes | ||
| min_a_idx, _ = min(enumerate(problem_sizes), key=key_size_a) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this logic and use random shapes.
No description provided.