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

[PYTHON][FFI] Speed Up get DataType #9072

Merged
merged 2 commits into from
Sep 22, 2021
Merged

[PYTHON][FFI] Speed Up get DataType #9072

merged 2 commits into from
Sep 22, 2021

Conversation

wangxiang2713
Copy link
Contributor

@wangxiang2713 wangxiang2713 commented Sep 22, 2021

Hi, i just run a tensorflow model with TVM. My model has 321 inputs so i find create NDArray inputs for model is time consuming.

Code:

dtype = DataType(dtype)

is used in function NDArray.empty when create NDArray. If dtype is numpy.dtype, function DataType will convert it to str, and i find this convert is time consuming, about 0.83ms for my model.

So i use a table to avoid convert numpy.dtype to str.

@tqchen tqchen changed the title Speed Up get DataType [PYTHON][FFI] Speed Up get DataType Sep 22, 2021
@tqchen tqchen merged commit 287ee40 into apache:main Sep 22, 2021
@tqchen
Copy link
Member

tqchen commented Sep 22, 2021

Thanks @wangxiang2713

ylc pushed a commit to ylc/tvm that referenced this pull request Sep 29, 2021
ylc pushed a commit to ylc/tvm that referenced this pull request Jan 13, 2022
@wangxiang2713 wangxiang2713 deleted the commit_2 branch March 9, 2022 02:52
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