Skip to content

[QST] [CuTeDSL] Object aliasing breaks inside cutlass.range #2931

@HanGuo97

Description

@HanGuo97

What is your question?

Hi, I noticed that when using dynamic range, object aliasing seems to break if inplace operations are performed. Is this expected?

Sample code:

import cutlass
import cutlass.cute as cute

@cute.jit
def f():
    state0 = cutlass.pipeline.make_pipeline_state(cutlass.pipeline.PipelineUserType.Producer, stages=2)
    state1 = state0
    print(state1 is state0)
    state0.advance()
    print(state1 is state0)  # -> True
    state0.advance()
    print(state1 is state0)  # -> True
    state0.advance()
    print(state1 is state0)  # -> True

    for i in cutlass.range_constexpr(3):
        state0.advance()
        print(state1 is state0)  # --> True
    print(state1 is state0)  # --> True

    print("--- Here! ---")
    for i in cutlass.range(3):
        state0.advance()
        print(state1 is state0)  # --> False!
    print(state1 is state0)  # --> False!
f()

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions