Skip to content

Add values for bandwidth estimate computations#107

Merged
vikaskurapati merged 3 commits into
masterfrom
davschneller/bandwidth
May 19, 2026
Merged

Add values for bandwidth estimate computations#107
vikaskurapati merged 3 commits into
masterfrom
davschneller/bandwidth

Conversation

@davschneller
Copy link
Copy Markdown
Contributor

Compute the amount of memory transferred in/out by a kernel, in a similar vein to the FLOP counters.
Probably only really useful as an estimate (and only as an estimate) for the rough bandwidth in the GPU case, if we ignore any caching from previous kernels.

Copy link
Copy Markdown
Contributor

@vikaskurapati vikaskurapati left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please also write (or make AI write) the relevant tests for it? We are then good to go.

AI-generated. Model: Opus 4.7
Comment thread yateto/codegen/visitor.py
inConstBytes = sum(size for size in inConstTensors.values())
inBytes = sum(size for size in inTensors.values())
outBytes = sum(size for size in outTensors.values())

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we not directly write something like this:

Suggested change
inConstBytes = sum(inConstTensors.values())

and similarly for the remaining two?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thanks for writing the test!

Copy link
Copy Markdown
Contributor

@vikaskurapati vikaskurapati left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One minor comment. Can be ignored if it does not make sense. LGTM otherwise.

@vikaskurapati vikaskurapati merged commit eb43580 into master May 19, 2026
12 checks passed
@vikaskurapati vikaskurapati deleted the davschneller/bandwidth branch May 19, 2026 08:41
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.

2 participants