Skip to content

[Docs] Improve static shape tuning parameter configuration (follow-up to commit c71aefc)#18545

Merged
cbalint13 merged 4 commits intoapache:mainfrom
ConvolutedDog:rebase-pr-18159
Dec 6, 2025
Merged

[Docs] Improve static shape tuning parameter configuration (follow-up to commit c71aefc)#18545
cbalint13 merged 4 commits intoapache:mainfrom
ConvolutedDog:rebase-pr-18159

Conversation

@ConvolutedDog
Copy link
Copy Markdown
Contributor

  • Expose max_trials_per_task parameter to static_shape_tuning_pipeline
  • Adjust default TOTAL_TRIALS from 8000 to 80 for tutorial demonstration purposes
  • Add documentation for tuning parameters in tutorial, clarifying relationship between MAX_TRIALS_PER_TASK and TOTAL_TRIALS

… to commit c71aefc)

- Add max_trials_per_task parameter to static_shape_tuning_pipeline
- Adjust default TOTAL_TRIALS from 8000 to 80 for tutorial demonstration purposes
- Add documentation for tuning parameters in tutorial, clarifying relationship between MAX_TRIALS_PER_TASK and TOTAL_TRIALS
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @ConvolutedDog, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request refines the configuration of static shape tuning parameters within the relax pipeline. It introduces a new parameter, max_trials_per_task, to provide finer control over the tuning process. Additionally, it updates the tutorial to leverage these parameters for more efficient demonstrations and provides clearer documentation on their interaction and recommended usage for both tutorial and production scenarios.

Highlights

  • Exposed new tuning parameter: The max_trials_per_task parameter has been exposed in the static_shape_tuning_pipeline function, allowing for more granular control over the tuning process.
  • Tutorial parameter adjustment: The default TOTAL_TRIALS in the tutorial has been reduced from 8000 to 80, and MAX_TRIALS_PER_TASK set to 4, to facilitate quicker demonstration and feedback.
  • Enhanced documentation: Comprehensive documentation has been added to the tutorial and the static_shape_tuning_pipeline function, clarifying the relationship and optimal usage of MAX_TRIALS_PER_TASK and TOTAL_TRIALS.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request exposes the max_trials_per_task parameter to the static_shape_tuning_pipeline and updates the corresponding tutorial. The changes are a good improvement for controlling the tuning process. However, I've found a critical bug in the implementation that will cause a TypeError when max_trials_per_task is not provided. Additionally, I've pointed out a couple of areas in the new documentation and comments that could be clarified to avoid user confusion. Please see my detailed comments.

Comment thread python/tvm/relax/pipeline.py Outdated
Comment thread docs/how_to/tutorials/e2e_opt_model.py Outdated
Comment thread python/tvm/relax/pipeline.py Outdated
@ConvolutedDog
Copy link
Copy Markdown
Contributor Author

@tlopex Please review this follow-up PR addressing feedback from #18481 and #18159 regarding tuning parameter configuration improvements.

Copy link
Copy Markdown
Contributor

@cbalint13 cbalint13 left a comment

Choose a reason for hiding this comment

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

LGTM, but would 512/16 be more resonable ?

Comment thread docs/how_to/tutorials/e2e_opt_model.py Outdated
Comment thread docs/how_to/tutorials/e2e_opt_model.py Outdated
@cbalint13 cbalint13 self-assigned this Dec 4, 2025
@cbalint13
Copy link
Copy Markdown
Contributor

@tvm-bot rerun

@ConvolutedDog
Copy link
Copy Markdown
Contributor Author

@cbalint13 @mshr-h Could you please take another look at the latest commit? Thanks~

Copy link
Copy Markdown
Member

@tlopex tlopex left a comment

Choose a reason for hiding this comment

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

It looks great to me! Thank you

Comment thread docs/how_to/tutorials/e2e_opt_model.py
@cbalint13 cbalint13 merged commit dcecb86 into apache:main Dec 6, 2025
10 checks passed
@cbalint13
Copy link
Copy Markdown
Contributor

@ConvolutedDog

Thank you for the enhancement !

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.

4 participants