Skip to content
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

[BUG] Can't resolve variables with the same name inside callFunc #169

Open
AdrianLiu00 opened this issue Aug 6, 2024 · 0 comments
Open
Labels
bug Something isn't working

Comments

@AdrianLiu00
Copy link
Contributor

Describe the bug
Can't resolve variables with the same name inside callFunc, when importing the function module and defining the variables (as the same name) in one funtion body.

To Reproduce

import allo
from allo.ir.types import int8

def test():

    from allo.library.systolic import systolic

    M = 5

    A = 5
    B = 3
    C = 8
    A0 = 1
    B0 = 4

    def top[Ty](X: "Ty[A, B]", W_A: "Ty[B, C]") -> "Ty[A, C]":
        Z: Ty[A, C]
        systolic[int8, int8, int8, M, B, C, A0, B0](X, W_A, Z)
        return Z

    s = allo.customize(top, instantiate=[int8])

test()

Buggy output
RuntimeError: Cannot resolve type M with M

Expected behavior
Reslove and passing parameters correctly.

Additional context
This problem does not arise when the import function and variable definitions are not in the same function body.

@AdrianLiu00 AdrianLiu00 added the bug Something isn't working label Aug 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant