-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Texture support][Part 0] Device API and runtime support (#7711)
* Add TVMBackendAllocTexture and support in OpenCL device API. * Add runtime optimized caching allocator. This should be replaced with AOT memory planning when the relay/tir/compile engine refactor lands. * Few bug fixes for runtime texture allocator. * Add OpenCL device api support for image2d<float16> textures. * Update OpenCL DeviceAPI to support Image2D data space allocations and copying to/from host/image2d directly. Allocation employs a lowering convention to 2d images for activations and weights. * Fix to follow OpenCL spec. for indexing. * Rename texture_pool.h -> texture.h * Move Nd to 2d lowering convention code into runtime texture utilities that can be shared by codegen and the runtime. * Update texture lowering utilities * Add TODO comment about pitch support * Remove FreeTexture * Fix ICHECK comment * Partial cherry pick from @ZihengJiang [email protected]:ZihengJiang/tvm.git:52822c5bd [RUNTIME] OpenCL texture memory. * Remove runtime and device texture APIs. * Add OpenCL packed functions for texture workspace (de)allocations. * Add OpenCLBuffer structure to track memory layout through OpenCL Device API. * Rebase: TVMContext -> Device * Implement DLTensor* overload of CopyDataToFrom in OpenCL DeviceAPI. * Implement OpenCL CopyDataFromTo(DLTensor*...) overload and tensor shapes to calculate image extent when copying date directly to or from texture cache. * Update format (cpp-lint) * Update format (clang) * Buffer descriptor name change and formatting. * Add texture pool documentation. * Update runtime to use new global.texture scope. * Move texture_pool.cc into opencl impl. * Add test coverage for copying in and out of storage allocs of texture scope. * Documented APIs and structures, renamed buffer descriptor layout tags. Co-authored-by: ZihengJiang <[email protected]>
- Loading branch information
1 parent
f4ec5fd
commit 010d11b
Showing
6 changed files
with
703 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.