Skip to content

Conversation

@qsqqsqqsq-intellif
Copy link
Contributor

@qsqqsqqsq-intellif qsqqsqqsq-intellif commented Mar 19, 2024

Prior to this commit, cache_read primitive may not update the block reads buffer region properly when there is a nested buffer access.

@T.prim_func
def cache_read_nested_buffer_access(var_A: T.handle, var_B: T.handle, var_C: T.handle):
    for ax0, ax1 in T.grid(T.int64(1), T.int64(512)):
        with T.block("C"):
            v_ax0, v_ax1 = T.axis.remap("SS", [ax0, ax1])
            T.reads(A[B[v_ax0], v_ax1], B_global[v_ax0])
            T.writes(C[v_ax0, v_ax1])
            C[v_ax0, v_ax1] = A[B_global[v_ax0], v_ax1]

T.reads(A[B[v_ax0], v_ax1]) should be updated as T.reads(A[B_global[v_ax0], v_ax1])
cc @Hzfengsy

@github-actions github-actions bot requested a review from Hzfengsy March 19, 2024 09:33
@qsqqsqqsq-intellif qsqqsqqsq-intellif force-pushed the tir_bugfix_cache_read_update_buffer_region branch 2 times, most recently from 97b0083 to 534ff63 Compare March 20, 2024 02:35
@qsqqsqqsq-intellif qsqqsqqsq-intellif changed the title [Bugfix][TIR] Fix cache_read update buffer region bug. [Bugfix][TIR] Fix cache_read update buffer region Mar 20, 2024
Prior to this commit, cache_read primitive may not update the block
reads buffer region properly when there is a nested buffer access.

This commit fix this bug and add a cache_read unit test.
@qsqqsqqsq-intellif qsqqsqqsq-intellif force-pushed the tir_bugfix_cache_read_update_buffer_region branch from 534ff63 to 41a2761 Compare March 20, 2024 02:52
@tqchen tqchen merged commit 0f38ef2 into apache:main Mar 20, 2024
@qsqqsqqsq-intellif qsqqsqqsq-intellif deleted the tir_bugfix_cache_read_update_buffer_region branch March 21, 2024 01:54
thaisacs pushed a commit to thaisacs/tvm that referenced this pull request Apr 3, 2024
Prior to this commit, cache_read primitive may not update the block
reads buffer region properly when there is a nested buffer access.

This commit fix this bug and add a cache_read unit test.

Co-authored-by: qsqqsqqsq-intellif <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants