Skip to content

[Dlight] Fix Customized Dynamic Shape Sampling#15466

Closed
zxybazh wants to merge 10 commits intoapache:unityfrom
zxybazh:feature/2023-07-26/support-custom-benchmark
Closed

[Dlight] Fix Customized Dynamic Shape Sampling#15466
zxybazh wants to merge 10 commits intoapache:unityfrom
zxybazh:feature/2023-07-26/support-custom-benchmark

Conversation

@zxybazh
Copy link
Member

@zxybazh zxybazh commented Aug 3, 2023

This PR is a follow up for #15322 to better support model level workload benchmarking as in mlc-ai/dlight-bench#6

introduces some minor fixes to enable easier dynamic shape sampling for model level workload benchmarking. For example, a dynamic shape sampling function can take sample_idx and sample_num as input to generate better selection of shapes. It also makes life easier by converting all the dynamic variable to str when parsing from PrimFuncs.

Other than that, this PR includes a few minor changes, including type annotation and supporting customizing the columns in the benchmarking output.

@tvm-bot
Copy link
Collaborator

tvm-bot commented Aug 3, 2023

Thanks for contributing to TVM! Please refer to the contributing guidelines https://tvm.apache.org/docs/contribute/ for useful information and tips. Please request code reviews from Reviewers by @-ing them in a comment.

  • No users to tag found in teams: dlight See #10317 for details

Generated by tvm-bot

@zxybazh zxybazh force-pushed the feature/2023-07-26/support-custom-benchmark branch 2 times, most recently from e5182e7 to c667e9a Compare August 10, 2023 00:14
@zxybazh zxybazh force-pushed the feature/2023-07-26/support-custom-benchmark branch from c667e9a to b523607 Compare August 10, 2023 22:32
@zxybazh zxybazh force-pushed the feature/2023-07-26/support-custom-benchmark branch from a52f8b0 to 4a3ad87 Compare August 10, 2023 23:16
@Hzfengsy
Copy link
Member

any update?

@zxybazh
Copy link
Member Author

zxybazh commented Aug 11, 2023

Thanks for checking in! The issues are all fixed, and demo is updated in mlc-ai/dlight-bench#6 . Ready for review.

After this PR it should be really easy to conduct PrimFunc level benchmarking & customize dynamic shape. I'm creating a notebook to demonstrate all the use cases. Will post in the thread.

@zxybazh
Copy link
Member Author

zxybazh commented Aug 11, 2023

The mentioned colab notebook can be found here: https://colab.research.google.com/drive/1wof8KvUnAaqoXI7HAcItlOquB4cPfiny?usp=sharing

CC: @sunggg @Hzfengsy

Copy link
Contributor

@sunggg sunggg left a comment

Choose a reason for hiding this comment

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

LGTM, thank you @zxybazh!

else "static",
"Time(us)": median * 1e6,
"Std(us)": std * 1e6,
"Memory(GB/s)": total_input_bytes / median / 1024**3,
Copy link
Contributor

Choose a reason for hiding this comment

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

One potential future work item is to show the HW maximum bandwidth. This would be helpful to understand the gap from the theoretical upper bound.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for the tip! I think it makes sense to have a maximum bandwidth if the workload is memory bond. On the other hand, this is a rough calculation of throughput so it may not reflect the computation flops, we can show peak FLOPS of the hardware for comparison.

@junrushao junrushao force-pushed the unity branch 2 times, most recently from c95d45f to 45eeb8c Compare December 18, 2023 21:00
@tqchen tqchen deleted the branch apache:unity March 29, 2024 12:18
@tqchen tqchen closed this Mar 29, 2024
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.

5 participants