当前位置: 首页 > news >正文

莱州网站建设多少钱虚拟主机wordpress解压位置

莱州网站建设多少钱,虚拟主机wordpress解压位置,银行官网登录入口,建设景区网站的目的TRT8 一个大版本#xff0c;8.4-、 8.5、 8.6#xff08;包含预览功能#xff09;却有很多变动#xff0c;一不注意就发现很混乱#xff0c;特备注此贴。建议具体case可以参考这个合集#xff0c;真心安利#xff1a;https://github.com/NVIDIA/trt-samples-for-hackath…        TRT8 一个大版本8.4-、 8.5、 8.6包含预览功能却有很多变动一不注意就发现很混乱特备注此贴。建议具体case可以参考这个合集真心安利https://github.com/NVIDIA/trt-samples-for-hackathon-cn/tree/master/cookbook 版本差异概述 1当前使用了8.4 参考 https://github.com/NVIDIA/trt-samples-for-hackathon-cn/blob/master/cookbook/01-SimpleDemo/TensorRT8.0/main-cuda.py 28.5版本废弃了binding, 导致开内存代码不同 参考 https://github.com/NVIDIA/trt-samples-for-hackathon-cn/blob/master/cookbook/01-SimpleDemo/TensorRT8.5/main.py 38.6版本以后支持dynamic shape统一个profile 用于不同的context。不再支持Pascal P40但完全改变了原来TRT engine必须绑定硬件和版本的要求 现在可以解耦出来但是有如下限制 1、binding 改变 18.5前需要使用biding 接口 对应dynamic batch 多个profile 需要计算偏置。偏置或者说index 是针对profile 同一个engine的不是针对context的。下图是一个engine里有3个profile模型有4个输入1个输出那么就有41*3 15个binding。 engine.num_bindings 获取binding 总数 engine.binding_is_input 计算出input数量每个profile里 算一个 engine.binding_is_inpu // nProfile 才是模型的输入个数 context.set_binding_shape 设置输入输出的维度如上面表格需要计算出pad和对应输入输出的顺序index contex.get_binding_shape 获得对应profile 的输出的维度 context.execute_async_v2 执行推理这里传入的第一个参数为输出输出GPU显存的地址并且需要填满如上的表格不用的位置填0。 完整代码 https://github.com/NVIDIA/trt-samples-for-hackathon-cn/blob/master/cookbook/08-Advance/MultiOptimizationProfile/main-BindingAPI.py logger trt.Logger(trt.Logger.ERROR) engine trt.Runtime(logger).deserialize_cuda_engine(engineString) # engineString 是二进制 open engine文件 nIO engine.num_bindings nInput np.sum([engine.binding_is_input(i) for i in range(engine.num_bindings)]) nOutput nIO - nInput nIO, nInput, nOutput nIO // nProfile, nInput // nProfile, nOutput // nProfile context engine.create_execution_context() context.set_optimization_profile_async(index, stream) bindingPad nIO * index_profile  # 计算binding 的偏置 context.set_binding_shape(bindingPad 0, inputShape) # 第一个输入 outputShape contex.get_binding_shape(bindingPad nInput 0) # 第一个输出 bufferList [int(0) for b in bufferD[:bindingPad]] \[int(b) for b in bufferD[bindingPad:(bindingPad nInput nOutput)]] \[int(0) for b in bufferD[(bindingPad nInput nOutput):]] context.execute_async_v2(bufferList, stream) 28.5 之后废弃binding 使用范例如下 engine.num_io_tensors  获取输入输出总个数 engine.get_tensor_name  获得对应的输入输出名字 engine.get_tensor_mode 判断是输入还是输出trt.TensorIOMode.INPUT 、trt.TensorIOMode.OUTPUT context.set_input_shape 直接设置对应的形状不再需要计算偏置 context.get_tensor_shape 直接获得输入输出需要先设置输入自动计算形状 context.set_tensor_address 绑定TRT 输入输出和 开辟的显存 context.execute_async_v3 来执行推理 完整代码 https://github.com/NVIDIA/trt-samples-for-hackathon-cn/blob/master/cookbook/08-Advance/MultiOptimizationProfile/main.py logger trt.Logger(trt.Logger.ERROR) engine trt.Runtime(logger).deserialize_cuda_engine(engineString) # engineString 是二进制 open engine文件 nIO engine.num_io_tensors lTensorName [engine.get_tensor_name(i) for i in range(nIO)] nInput [engine.get_tensor_mode(lTensorName[i]) for i in range(nIO)].count(trt.TensorIOMode.INPUT) context engine.create_execution_context() context.set_optimization_profile_async(index, stream) context.set_input_shape(lTensorName[0], inputShape) outputShape context.get_tensor_shape(lTensorName[1]) context.set_tensor_address(lTensorName[0], int(cudart.cudaMalloc(nbytes)[1])) context.execute_async_v3(0) 2、dynamic shape 性能 如果跨度较大建议使用多个配置文件可以明显提升推理性能 参考 Developer Guide :: NVIDIA Deep Learning TensorRT Documentation https://github.com/NVIDIA/trt-samples-for-hackathon-cn/blob/master/cookbook/09-BestPractice/UsingMultiOptimizationProfile/result-A30.md https://github.com/NVIDIA/trt-samples-for-hackathon-cn/blob/master/cookbook/09-BestPractice/UsingMultiOptimizationProfile/main.py 获得真实推理形状假设真实为3150150要使用 context.get_tensor_shape(0) 返回 (3, 150, 250)而不是 engine.get_tensor_shape(foo”)  返回  (3, -1, -1)  。 3、engine、 context、stream、profile动态batch的配置文件 一个engine 可以拥有多个context共享一个权重。 可以将不同的context 放到不同的stream 中实现并行。 一个context可以拥有多个profile至少一个但是8.6 0805预览特性前一个profile 只能绑定一个contextcontext 和profile 需要错开使用。 参考 多流8.6 https://github.com/NVIDIA/trt-samples-for-hackathon-cn/blob/master/cookbook/08-Advance/MultiStream/main.py 多上下文-动态batch8.6 https://github.com/NVIDIA/trt-samples-for-hackathon-cn/blob/master/cookbook/08-Advance/MultiContext/main.py  多上下文-动态batch8.5- https://github.com/NVIDIA/trt-samples-for-hackathon-cn/blob/master/cookbook/08-Advance/MultiContext/main-MultiOptimizationProfile.py
http://www.pierceye.com/news/499502/

相关文章:

  • html网站首页图片切换一元购物网站怎么做
  • 焦作网站建设费用wordpress php最大输出变量
  • 移动端高端网站开发做私活的网站
  • 广东专业做网站浙江建设工程信息网高工评选
  • 当阳网站建设电话时尚类网站建设
  • 南平网站建设公司seo中文含义是什么
  • 重庆科技建设信息网站关键词做网站标题是什么意思
  • 潍坊中企动力做的网站怎么样哪个网站做黄金交易最好
  • 徐州金网网站建设西安网站建设制作公司
  • 中小企业网站建设好么做国外网站衣服码数要怎么写
  • 新浪做网站wordpress divi 主题
  • 微网站建设资讯网页游戏开发教程
  • 网站建设评估百度公司地址
  • python 做网站开发吗搜房网网站跳出率
  • 深圳企业模板网站建设做高性能的网站 哪门语言好
  • 网站后台不能上传微信公众平台网页版登陆
  • 广州网站营销seo费用成都建设网站那家好
  • 网站建设规划书结构简单wordpress
  • 域名注册网站哪个好山东淄博网络科技有限公司
  • 固始县网站建设培训怎么制作网站首页
  • 产品经理做网站三河市最新消息
  • 做新闻类网站需要什么资质如何外贸seo网站建设
  • 注册网站流程和费用百度seo关键词排名s
  • 做推广网站的去哪能买到有效资料苏州建设网站找网络公司
  • vs做网站如何输出怎么做flash网站
  • 网站做政务广告传媒公司简介ppt
  • 番茄网络营销策划方案seo网站培训
  • 自己做一网站高唐网页定制
  • 快速网站seo效果什么是网络营销与概念
  • 个体网站建设企业网站做的好的有什么公司