pytorch / pytorch/benchmark

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

Open
#2,418 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
1k
Forks
346
PR merge metrics
No merged PRs in 30d

Description

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)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue does not name files, tests, or an entry point. Start by locating tritonbench's input-shape metadata and tensor-generation code, then compare the current manual iterator flow with the proposed decorator-based interface. Done means developers can express parameterized input shapes without manually writing the nested iteration.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
testing
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.