Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[µTVM] Fix two warnings when deprecated forms are used #7269

Merged
merged 2 commits into from Jan 13, 2021

Conversation

gromero
Copy link
Contributor

@gromero gromero commented Jan 13, 2021

Hi,

This patchset addresses the following two warnings on microTVM:

[0]

[...]
/home/gromero/git/tvm/python/tvm/micro/contrib/zephyr.py:391: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
  doc = yaml.load(f)
[...]

[1]

[...]
/home/gromero/git/tvm/python/tvm/target/target.py:460: UserWarning: tvm.target.create() is being deprecated. Please use tvm.target.Target() instead
  warnings.warn("tvm.target.create() is being deprecated. Please use tvm.target.Target() instead")
[...]

Warning [0] is related to the deprecated form (no loader specified) of yaml.load(input), while the second one is related to the use of deprecated tvm.target.create().

Both warnings appear when running micro_tflite.py. The first one [0] when TARGET = tvm.target.target.micro("stm32f746xx") and the second one [1] when TARGET = tvm.target.target.micro("host"), which is the default target.

Thanks for contributing to TVM! Please refer to guideline https://tvm.apache.org/docs/contribute/ for useful information and tips. After the pull request is submitted, please request code reviews from Reviewers by @ them in the pull request thread.

Specify the loader to be used by yaml.load as the current form used without
specifying explicitly a loader is deprecated since PyYAML 5.1 and will
throw a noisy warning.

For details, please see:
https://github.com/yaml/pyyaml/wiki/PyYAML-yaml.load(input)-Deprecation

Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>
Avoid using tvm.target.create as it's deprecated and use
tvm.target.Target directly instead.

Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>
@gromero
Copy link
Contributor Author

gromero commented Jan 13, 2021

@areusch Hi. Could you review that small patchset, please? For warning [0] I'm assuming microTVM is not locked with any old PyYAML version (i.e. < 5.1). If it's locked we could simply silence the warning, which is not so nice I think. Thanks!

@areusch
Copy link
Contributor

areusch commented Jan 13, 2021

thanks for fixing these @gromero! @tmoreau89 @tqchen

Copy link
Contributor

@tmoreau89 tmoreau89 left a comment

Choose a reason for hiding this comment

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

thanks for the fix!

@tmoreau89 tmoreau89 merged commit 35dabd6 into apache:main Jan 13, 2021
@tmoreau89
Copy link
Contributor

Thanks @gromero @areusch the PR is merged.

masahi pushed a commit to masahi/tvm that referenced this pull request Jan 14, 2021
* [µTVM] Specify loader for yaml.load

Specify the loader to be used by yaml.load as the current form used without
specifying explicitly a loader is deprecated since PyYAML 5.1 and will
throw a noisy warning.

For details, please see:
https://github.com/yaml/pyyaml/wiki/PyYAML-yaml.load(input)-Deprecation

Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>

* [µTVM] Avoid using tvm.target.create

Avoid using tvm.target.create as it's deprecated and use
tvm.target.Target directly instead.

Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>
masahi pushed a commit to masahi/tvm that referenced this pull request Jan 18, 2021
* [µTVM] Specify loader for yaml.load

Specify the loader to be used by yaml.load as the current form used without
specifying explicitly a loader is deprecated since PyYAML 5.1 and will
throw a noisy warning.

For details, please see:
https://github.com/yaml/pyyaml/wiki/PyYAML-yaml.load(input)-Deprecation

Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>

* [µTVM] Avoid using tvm.target.create

Avoid using tvm.target.create as it's deprecated and use
tvm.target.Target directly instead.

Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>
TusharKanekiDey pushed a commit to TusharKanekiDey/tvm that referenced this pull request Jan 20, 2021
* [µTVM] Specify loader for yaml.load

Specify the loader to be used by yaml.load as the current form used without
specifying explicitly a loader is deprecated since PyYAML 5.1 and will
throw a noisy warning.

For details, please see:
https://github.com/yaml/pyyaml/wiki/PyYAML-yaml.load(input)-Deprecation

Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>

* [µTVM] Avoid using tvm.target.create

Avoid using tvm.target.create as it's deprecated and use
tvm.target.Target directly instead.

Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>
trevor-m pushed a commit to neo-ai/tvm that referenced this pull request Jan 21, 2021
* [µTVM] Specify loader for yaml.load

Specify the loader to be used by yaml.load as the current form used without
specifying explicitly a loader is deprecated since PyYAML 5.1 and will
throw a noisy warning.

For details, please see:
https://github.com/yaml/pyyaml/wiki/PyYAML-yaml.load(input)-Deprecation

Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>

* [µTVM] Avoid using tvm.target.create

Avoid using tvm.target.create as it's deprecated and use
tvm.target.Target directly instead.

Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>
electriclilies pushed a commit to electriclilies/tvm that referenced this pull request Feb 18, 2021
* [µTVM] Specify loader for yaml.load

Specify the loader to be used by yaml.load as the current form used without
specifying explicitly a loader is deprecated since PyYAML 5.1 and will
throw a noisy warning.

For details, please see:
https://github.com/yaml/pyyaml/wiki/PyYAML-yaml.load(input)-Deprecation

Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>

* [µTVM] Avoid using tvm.target.create

Avoid using tvm.target.create as it's deprecated and use
tvm.target.Target directly instead.

Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>
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.

None yet

3 participants