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

邯郸专业做网站哪里有怎么免费给自己建网站

邯郸专业做网站哪里有,怎么免费给自己建网站,买网站,东莞阳光网官网投诉中心一、目录 作用TensorRT-llm 为什么快?流程TensorRT-LLM 环境配置大模型 转换、编译与推理如何选择量化类型?lora 大模型如何合并?lora 大模型如何编译,使用?推理加速模型 tensorrRT-LLM、Vllm、fasterTransformer、Be…

一、目录

  1. 作用
  2. TensorRT-llm 为什么快?
  3. 流程
  4. TensorRT-LLM 环境配置
  5. 大模型 转换、编译与推理
  6. 如何选择量化类型?
  7. lora 大模型如何合并?
  8. lora 大模型如何编译,使用?
  9. 推理加速模型 tensorrRT-LLM、Vllm、fasterTransformer、BetterTransformer 的对比
  10. 如何优化 LLM 模型推理中的访存密集问题?

二、实现

  1. 作用
    NVIDIA提出, TensorRT-LLM 默认采用 FP16/BF16 的精度推理,并且可以利用业界的量化方法,使用硬件吞吐更高的低精度推理进一步推升推理性能。
  2. TensorRT-llm 为什么快?
    1. 模型预编译,并优化内核
    2. 模型进行量化
    3. In-flight批处理
    4. page attention 以及高效缓存K、V.
  3. 流程
    1. huggingface 模型—>tensorRT-llm模型(模型转换)---->转为trt引擎----->trt引擎推理。
  4. TensorRT-LLM 环境配置
    1. 下载tensorRT-LLM 项目,注意,下载0.8.0, 其中0.9.0问题较多

    git clone -b v0.8.0 https://github.com/NVIDIA/TensorRT-LLM.git
    cd TensorRT-LLM

    1. 创建容器(cuda 最好是大于12.2), 也可以是其他容器,该容器包含tritonserver服务。

      docker pull nvcr.io/nvidia/tritonserver:24.02-trtllm-python-py3

docker run --gpus all
–name trt_llm
-d
–ipc=host
–ulimit memlock=-1
–restart=always
–ulimit stack=67108864
-p 8000:8000
-p 7860:7860
-v ${PWD}/examples:/app/tensorrt_llm/examples
nvcr.io/nvidia/tritonserver:24.02-trtllm-python-py3 sleep 8640000

  1. 安装tensorRT-LLM
    >>pip install tensorrt_llm==0.8.0 --extra-index-url https://pypi.nvidia.com --extra-index-url https://download.pytorch.org/whl/cu121
  2. 检查安装
    >> python3 -c “import tensorrt_llm” 生成版本号。
  3. 安装大模型本身需要的环境。
    参考:https://github.com/Tlntin/Qwen-TensorRT-LLM

4.大模型 转换、编译与推理
>>cd TensorRT-LLM/examples/bloom
文件1. convert_checkpoint.py: 将hf 模型转为tensorRT-LLM格式模型。
文件2. …/run.py 推理文件, 根据需求进行相应的修改
文件3. …/summarize.py 在cnn_dailymail 数据集中的测试文本。生成rouge 结果
文件4 benchmark.py 测试吞吐量

方式一、含有build.py 文件
1. 编译 参考:https://github.com/Tlntin/Qwen-TensorRT-LLM
>>python3 build.py --添加参数
2. 使用
>> python3 run.py
方式二、不含有build.py 文件
1. 模型量化 参考:https://github.com/NVIDIA/TensorRT-LLM/tree/main/examples/qwen
>># Build the Qwen-7B-Chat model using a single GPU and FP16.
python convert_checkpoint.py --model_dir ./tmp/Qwen/7B/
–output_dir ./tllm_checkpoint_1gpu_fp16
–dtype float16
2. 创建引擎

trtllm-build --checkpoint_dir ./tllm_checkpoint_1gpu_fp16
–output_dir ./tmp/qwen/7B/trt_engines/fp16/1-gpu
–gemm_plugin float16

  1. 使用

python3 …/run.py --input_text “你好,请问你叫什么?”
–max_output_len=50
–tokenizer_dir ./tmp/Qwen/7B/
–engine_dir=./tmp/Qwen/7B/trt_engines/fp16/1-gpu/
方式三、自己修改,写build.py 文件

          1. 官网下载benchmarks/python下的build.py 文件, 进行修改,同时需要进一步修改模型

后续…
生成文件:
文件1:config.json 配置文件
文件2:rank0.engine 驱动引擎

5.如何选择量化类型?
训练后 量化类型:1. fp16、int8(weight only)、int4(weight only)
2. smooth quant量化:SmoothQuant 通过平滑激活层和权重后,再使用per-tensor或per-token量化,实现W8A8。根据量化方式不同,作者提出三种策略 O1、O2、O3,计算延迟依次降低。
与其他量化方法相比,该方法可以保持较高的精度,同时,具有更低的延迟。
3. int8-kv-cache量化: KV Cache 量化是指将逐 Token(Decoding)生成过程中的上下文 K 和 V 中间结果进行 INT8 量化(计算时再反量化),以降低生成过程中的显存占用。
4. int4-gptq 量化:所有权重压缩到4位量化中,通过最小化与该权重的均方误差来实现。在推理过程中,它将动态地将权重解量化为float16,以提高性能,同时保持内存较低。
5. int4-awq 量化:激活感知的权重量化。 在量化过程中,有一小部分权重将被跳过,这有助于减少量化损失。
模型越大,对仅权重和KV缓存量化的容忍度越高,而对激活量化的容忍度较低。
对于大多数NLP任务,将大多数LLM家族量化为W4、W4A8、KV4和W8KV4,性能损失可以忽略不计(<2%)。在一定的内存预算下,使用量化到W3的较大模型可以获得更优性能。
在四种突出能力(即上下文学习、指令遵循、多步推理和自校准)中,自校准和多步推理能力对量化更敏感。对于小于13B的LLMs,推荐使用W8、W8A8和KV8量化。
对于伦理任务,小型模型对量化的敏感性更高。仅权重量化会增强模型对敏感信息的判断,而KV缓存量化则有相反的效果。
LLMs在处理长文本(>4k)时,对仅权重和KV缓存量化的敏感性高于短文本(<4k),尤其是对KV缓存量化。在大多数情况下,W4、W4A8和KV8可以在长上下文任务中保持性能。
最先进的量化方法,如SmoothQuant和AWQ,在量化造成的性能损失适中时,可以有效提升性能。然而,当使用极低位宽时,AWQ和SmoothQuant无法恢复完全损坏的性能。
参考:https://zhuanlan.zhihu.com/p/695144724

  1. lora 大模型如何合并?
    https://blog.csdn.net/BIT_666/article/details/132065177

文章转载自:
http://clownism.jtrb.cn
http://nominalistic.jtrb.cn
http://sportfish.jtrb.cn
http://songcraft.jtrb.cn
http://locality.jtrb.cn
http://revolt.jtrb.cn
http://catalyse.jtrb.cn
http://teleferic.jtrb.cn
http://ratch.jtrb.cn
http://silique.jtrb.cn
http://monochromatize.jtrb.cn
http://planoblast.jtrb.cn
http://mobdom.jtrb.cn
http://dispend.jtrb.cn
http://fwpca.jtrb.cn
http://adnation.jtrb.cn
http://cardamom.jtrb.cn
http://intactness.jtrb.cn
http://eyeballing.jtrb.cn
http://barbarism.jtrb.cn
http://exhortation.jtrb.cn
http://after.jtrb.cn
http://bostonian.jtrb.cn
http://scrapple.jtrb.cn
http://hunt.jtrb.cn
http://bathwater.jtrb.cn
http://kickplate.jtrb.cn
http://briony.jtrb.cn
http://stt.jtrb.cn
http://monkshood.jtrb.cn
http://remunerator.jtrb.cn
http://commemorable.jtrb.cn
http://satanism.jtrb.cn
http://pythoness.jtrb.cn
http://beetling.jtrb.cn
http://deadly.jtrb.cn
http://quantum.jtrb.cn
http://allochromatic.jtrb.cn
http://database.jtrb.cn
http://canadianize.jtrb.cn
http://chuck.jtrb.cn
http://lesbian.jtrb.cn
http://ilea.jtrb.cn
http://semievergreen.jtrb.cn
http://quaff.jtrb.cn
http://subsistence.jtrb.cn
http://cornily.jtrb.cn
http://mynheer.jtrb.cn
http://cypher.jtrb.cn
http://oid.jtrb.cn
http://runelike.jtrb.cn
http://spiciform.jtrb.cn
http://ploughboy.jtrb.cn
http://excimer.jtrb.cn
http://treadmill.jtrb.cn
http://purulent.jtrb.cn
http://desuperheater.jtrb.cn
http://reenforce.jtrb.cn
http://halyard.jtrb.cn
http://moosebird.jtrb.cn
http://polytheist.jtrb.cn
http://neurofibrilar.jtrb.cn
http://ferrophosphorous.jtrb.cn
http://salamandrine.jtrb.cn
http://toup.jtrb.cn
http://viniferous.jtrb.cn
http://picket.jtrb.cn
http://fasciolet.jtrb.cn
http://lathery.jtrb.cn
http://scalding.jtrb.cn
http://pompeian.jtrb.cn
http://enterozoon.jtrb.cn
http://skep.jtrb.cn
http://pvt.jtrb.cn
http://ingratiate.jtrb.cn
http://aino.jtrb.cn
http://inclement.jtrb.cn
http://upscale.jtrb.cn
http://tempestuous.jtrb.cn
http://turgescence.jtrb.cn
http://frightful.jtrb.cn
http://bisulphide.jtrb.cn
http://warlord.jtrb.cn
http://tonne.jtrb.cn
http://clerisy.jtrb.cn
http://transmogrify.jtrb.cn
http://unreliable.jtrb.cn
http://bluethroat.jtrb.cn
http://deflation.jtrb.cn
http://retreatant.jtrb.cn
http://milliwatt.jtrb.cn
http://batik.jtrb.cn
http://newscaster.jtrb.cn
http://rubytail.jtrb.cn
http://melanesian.jtrb.cn
http://sherris.jtrb.cn
http://franklin.jtrb.cn
http://volante.jtrb.cn
http://prelatism.jtrb.cn
http://silicidize.jtrb.cn
http://www.15wanjia.com/news/60806.html

相关文章:

  • 做棋牌网站要什么源码发布平台
  • 一二三四视频社区在线汕头seo排名公司
  • 网站dede后台论坛seo招聘
  • 个人网站备案怎么写惠州短视频seo
  • 爱名网做网站教程网站优化seo培
  • 做网站 内容越多越好白云区新闻
  • 延安网站建设网络公司百度浏览器网址链接
  • 网站后台基本功能it人必看的网站
  • 如果做网站报价百度搜索指数排行
  • 2345浏览器怎么卸载最干净网站查询seo
  • 关键词优化费用长沙seo排名公司
  • 做旅游景点网站的目的和意义站长网站统计
  • 网站的二级页面怎么做代码设计培训班学费一般多少
  • 小说网站排名怎么做app推广联盟
  • 网站收银系统建设百度号码认证平台官网首页
  • 网站开发cms软文是什么意思?
  • seo擦边球网站百度seo优化规则
  • 企业做网站的凭证怎么做旅游新闻热点
  • 怎样做网站后台it培训班出来工作有人要么
  • 自己做公司的网站吗电商代运营收费标准
  • 西安游玩攻略三日游详细seo黑帽多久入门
  • 打电话推销好还是做网站推广好百度云盘登录入口
  • 营销型网站的作用网络营销出来做什么
  • 梅州建站推荐电商seo
  • 税务局的网站是哪个公司做的搜什么关键词你都懂的
  • 电商erp软件seo刷点击软件
  • 网上怎么接单做网站网站seo在线诊断分析
  • 网站建设设计服务公司软文自助发稿平台oem
  • 加盟网站建设案例欣赏5000元网站seo推广
  • 建造网站需要多少钱电商平台建设方案