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

[tritonbench] A better way to encode input shapes with parameters #2418

Open
xuzhao9 opened this issue Aug 13, 2024 · 0 comments
Open

[tritonbench] A better way to encode input shapes with parameters #2418

xuzhao9 opened this issue Aug 13, 2024 · 0 comments

Comments

@xuzhao9
Copy link
Contributor

xuzhao9 commented Aug 13, 2024

Right now developers need to manually specify the input shape metadata to generate the input tensors.
I am thinking if we could use decorators to make this process easier and more user-friendly.

Old style:

def get_input_iter(self) -> Generator:
    shape_a = range(x, y)
    shape_b = range(m, n)
    for a in shape_a:
        for b in shape_b:
            yield generate_input(a, b)

New style:

@given(
        a=st.integers(min_value=x, max_value=y),
        b=st.integers(min_value=m, max_value=n),
)
def get_input(self, a, b):
      return generate_input(a, b)
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

No branches or pull requests

1 participant