Skip to content

Conversation

thaisacs
Copy link
Contributor

Before this PR, I encountered the following error when tuning a resnet_18 task:

/home/thais/Dev/tvm/python/tvm/meta_schedule/cost_model/xgb_model.py:543: RuntimeWarning: invalid value encountered in divide [g.min_cost / g.costs for g in self.data.values()],

Copy link
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.

@thaisacs

LGTM, thanks for the fix !

@cbalint13
Copy link
Contributor

@tvm-bot rerun

@cbalint13
Copy link
Contributor

cbalint13 commented May 14, 2025

@thaisacs ,

This proposed fix here omits from the ratio any div by zero positions that before would happened and omitted anyway.

This looks to me equivalent in previous functionality, minus the undesired warning message 👍


A initial tempting idea of mine would be to give statistical meaning to those '0' zeros, by replacing with something likenp.finfo(np.float32).max) , but this would run in machine overflows and choosing a "right" somewhat large but not at machine boundaries would become another problem, so 👎 for this idea.

@cbalint13
Copy link
Contributor

@Hzfengsy Hzfengsy merged commit f766c34 into apache:main May 15, 2025
13 checks passed
ShiboXing pushed a commit to ShiboXing/tvm that referenced this pull request Aug 10, 2025
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