本文作者:StubbornHuang
版权声明:本文为站长原创文章,如果转载请注明原文链接!
原文标题:TensorRT – workspace的作用
原文链接:https://www.stubbornhuang.com/2460/
发布于:2022年12月21日 14:06:20
修改于:2022年12月21日 14:06:20
1 TensorRT中workspace的作用
TensorRT提供了workspace作为每层网络执行时的临时存储空间,该空间时共享的,目的是为了减少显存占用。
- 在使用TensorRT SDK时,在构建Builder时通过调用
getWorkspaceSize()
来确定workspace的需求,如果在该函数中设置了workspace,则会在创建和执行Context
时分配该workspace,然后在runtime时提供给enqueue
、enqueueV2
、enqueueV3
等方法使用,并在销毁时回收。 - 在使用trtexec工具转换模型时,也需要指定workspace的大小
使用TensorRT分配的workspace的好处在于不同的网络层之间进行共享以减少显存开销。
参考链接
当前分类随机文章推荐
- TensorRT - Invalid Node - TopK,This version of TensorRT only supports input K as an initializer 阅读216次,点赞0次
- TensorRT - 使用C++ SDK出现无法解析的外部符号 "class sample::Logger sample::gLogger"错误 阅读381次,点赞0次
- TensorRT - 转换onnx模型出现Slice_74 requires bool or uint8 I/O but node can not be handled by Myelin错误 阅读428次,点赞0次
- TensorRT - 使用torch普通算子组合替代torch.einsum爱因斯坦求和约定算子的一般性方法 阅读2901次,点赞1次
- TensorRT - 喜大普奔,TensorRT8.2 EA起开始支持Einsum爱因斯坦求和算子 阅读1704次,点赞0次
- TensorRT - 安装TensorRT工具Polygraphy 阅读4260次,点赞0次
- TensorRT - 计算模型推理时间 阅读254次,点赞1次
- TensorRT - 扩展TensorRT C++API的模型输入维度,增加Dims5,Dims6,Dims7,Dims8 阅读1809次,点赞0次
- TensorRT - 使用trtexec工具转换模型、运行模型、测试网络性能 阅读3823次,点赞2次
- TensorRT - Using an engine plan file across different models of devices is not recommended and is likely to affect performance or even cause errors 阅读263次,点赞0次
全站随机文章推荐
- 资源分享 - The Nature of Code - Simulating Natural Systems with Processing 英文高清PDF下载 阅读1746次,点赞0次
- 资源分享 - Quaternions for Computer Graphics , First Edition 英文高清PDF下载 阅读2125次,点赞0次
- 资源分享 - Visualizing Quaternions 英文高清PDF下载 阅读1826次,点赞0次
- 资源分享 - Game AI Pro 360 - Guide to Tactics and Strategy 英文高清PDF下载 阅读1838次,点赞0次
- 资源分享 - 3D Engine Design for Virtual Globes 英文高清PDF下载 阅读1965次,点赞0次
- 资源分享 - Game AI Pro 360 - Guide to Movement and Pathfinding 英文高清PDF下载 阅读1902次,点赞0次
- C++ - 使用宏区分不同系统平台、不同编译器、不同编译模式等编译期宏使用总结 阅读1397次,点赞0次
- Youtube运营 - Youtube做哪些视频内容可以快速通过人工审核 阅读312次,点赞1次
- 资源分享 - Beginning DirectX 11 Game Programming 英文高清PDF下载 阅读1353次,点赞0次
- 书籍翻译 – Fundamentals of Computer Graphics, Fourth Edition,第5章 Linear Algebra中文翻译 阅读1775次,点赞5次
评论
169