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

[RFC] Support Codegen Using Texture Memory #2250

Closed
antinucleon opened this issue Dec 6, 2018 · 6 comments
Closed

[RFC] Support Codegen Using Texture Memory #2250

antinucleon opened this issue Dec 6, 2018 · 6 comments

Comments

@antinucleon
Copy link
Contributor

Current TVM is not supporting mixture texture and buffer. This pattern is essential to obtain state-of-art performance on iOS device, and potentially better OpenGL backend for legacy devices.

A potential solution is providing extra device hints, eg:

a = tvm.placeholder((32,), name="a", storage_dev="2d_texture")
b = tvm.placeholder((32,), name="b", storage_dev="buffer")

In lowering process, some extra work is required I think:

  1. We need a pass to infer output storage dev for each node
  2. We need special data access lowing rule for texture, especially different layout of texture (1D/2D texture)
  3. We need modify codegen
  4. We need to modify runtime, to support NDArray laying on texture memory.

Once we support 2D texture, I think we are able to achieve state-of-art performance on iOS, and OpenGL.

@tqchen
Copy link
Member

tqchen commented Jan 8, 2019

I would recommend us to start with backend support for texture and list them as a separate device type. Once we have enough evidence to support the texture code, then we can start this migration

@tqchen tqchen changed the title [RFC][Discussion] Extend storage device hint [RFC] Support Codegen Using Texture Memory Jan 8, 2019
@antinucleon
Copy link
Contributor Author

antinucleon commented Jan 17, 2019

@dmlc/tvm-comitter

Just FYI there is other effort on this topic: https://medium.com/tensorflow/tensorflow-lite-now-faster-with-mobile-gpus-developer-preview-e15797e6dee7

I want to check whether there is other people in community plan to work on this problem so we may avoid redundant work.

@masahi
Copy link
Member

masahi commented Jan 9, 2022

This should be supported now.

@masahi masahi closed this as completed Jan 9, 2022
@tmoreau89
Copy link
Contributor

Technically it hasn't been merged in but it's worth pointing to the RFCs and PRs for posterity @masahi:

See this RFC to understand the broader contributions of the texture enablement work.

There are several PRs that need to land in order for the texture support to be fully enabled in Open Source TVM. Some of these PRs will need to be revisited extensively before they can be merged, for instance in light of the work on TECompiler refactor, and efforts to provide physical and logical layout separation.

@masahi
Copy link
Member

masahi commented Jan 10, 2022

Thanks @tmoreau89, I've opened a fresh tracking #9891

@tmoreau89
Copy link
Contributor

Good idea, thank you @masahi !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants