Skip to content

[MetaSchedule][Minor] Update CPU Flush ArgParse Type#11792

Merged
junrushao merged 1 commit intoapache:mainfrom
zxybazh:feature/2022-06-20/better-argparse-cpu-flush
Jun 21, 2022
Merged

[MetaSchedule][Minor] Update CPU Flush ArgParse Type#11792
junrushao merged 1 commit intoapache:mainfrom
zxybazh:feature/2022-06-20/better-argparse-cpu-flush

Conversation

@zxybazh
Copy link
Member

@zxybazh zxybazh commented Jun 20, 2022

Previously cpu-flush option existed as a boolean or integer argument, which is a bit counter-intuitive because for argparse, any non-empty string such as False will be parsed to True when using as a boolean and integer a little bit vague here IMHO. This PR used a function from distutils to directly parse input string to boolean, which makes the usage more stragiht-forward like --cpu-flush True or --cpu-flush False. Meanwhile it still supports usage of 0/1 and made sure the argument is always required.

CC: @junrushao1994

Copy link
Member

@junrushao junrushao left a comment

Choose a reason for hiding this comment

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

I don’t have strong opinion, so if you prefer this way, let’s get it in

@junrushao junrushao merged commit 25db381 into apache:main Jun 21, 2022
blackkker pushed a commit to blackkker/tvm that referenced this pull request Jul 7, 2022
Previously `cpu-flush` option existed as a boolean or integer argument, which is a bit counter-intuitive because for argparse, any non-empty string such as `False` will be parsed to `True` when using as a boolean and integer a little bit vague here IMHO. This PR used a function from `distutils` to directly parse input string to boolean, which makes the usage more stragiht-forward like `--cpu-flush True` or `--cpu-flush False`. Meanwhile it still supports usage of `0/1` and made sure the argument is always required.
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