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

公明做网站的公司清远建设局网站

公明做网站的公司,清远建设局网站,分销平台网站建设,企业培训考试--multi_block_mode decoding phase, 推理1个新token, 平时:按照batch样本,按照head,将计算平均分给所有SM; batch_size*num_heads和SM数目相比较小时:有些SM会空闲;加了--multi_block_mode&…

--multi_block_mode

decoding phase, 推理1个新token,

平时:按照batch样本,按照head,将计算平均分给所有SM;

batch_size*num_heads和SM数目相比较小时:有些SM会空闲;加了--multi_block_mode,似乎是将input context再进行划分,原来1个SM干的活儿,分给多个SM来干,让所有SM都并行忙碌起来;

其他证据:

"we only use multi-block in generation phase (generating new token). In context phase, we have enough blocks to run in parallel and we don't need to use multi-block."
"take H100-SXM as an example, you have 132 SMs, and let us say the batch size is 1, num heads is 16, then normally we can split the sequence into (132/16 = 8) blocks to fully utilize all SMs, but if the sequence length is quite small like 1K, it might not worth 8 blocks per sequence (maybe fewer)."

支持llama格式和hf格式

llama格式,要使用--meta_ckpt_dir:

# Build LLaMA v3 70B TP=8 using Meta checkpoints directly.
python convert_checkpoint.py --meta_ckpt_dir ./tmp/llama/70B/ \--output_dir ./tllm_checkpoint_8gpu_tp8 \--dtype float16 \--tp_size 8

hf格式,使用--model_dir:

# Build LLaMA v3 70B using 4-way tensor parallelism and 2-way pipeline parallelism.
python convert_checkpoint.py --model_dir ./tmp/llama/70B/hf/ \--output_dir ./tllm_checkpoint_8gpu_tp4_pp2 \--dtype float16 \--tp_size 4 \--pp_size 2

推理显存占用分析

Total memory = (Model size + KV cache size + Activation memory) / Parallelism

where

  • The model size is the number of parameters * the size of data type.
  • The KV cache size is the total number of tokens * the size of KV cache data type * the number of layers * the KV hidden dimension
  • The activation memory is determined by TRT engine, which can be a few GBs regardless of the degree of parallelism used

For LLaMA v2 70B FP16 weights + FP8 KV cache, the model size is 70B parameters * 2 bytes = 140GB. The KV cache size is 32K tokens * 1 bytes * 80 layers * 2048 KV hidden dimension = 5GB per 32K tokens. We have 145GB spread across 8 GPUs. The end result is ~18GB per GPU plus some GBs of flat scratch/activation memory allocated by TRT engine and the TRT-LLM runtime.

Note that the KV hidden dimension is derived by the number of KV heads times hidden dimension of each head. LLaMA v2 70B has hidden dimension of 8192, and uses grouped-query attention where 8 key heads and 8 value heads are associated with 64 query heads. Each head has hidden dimension of 8192/64 = 128. So the hidden dimension for KV in total is 128 * 8 * 2 = 2048. (2是K和V)

The total number of tokens is determined by beam width, batch size, and maximum sequence length.

http://www.15wanjia.com/news/184604.html

相关文章:

  • 导航网站没有内页没有了android开发app
  • 网站建设人文环境湖南省重点建设项目办公室网站
  • 注册网站挣钱网站做跳转怎么做
  • 胶州市网站建设wordpress 更改中文
  • 金华网站建设优化技术什么是网络营网络营销的特点
  • 网站做推广需要到工信部备案吗杭州百度seo
  • 双公示网站专栏建设佛山企业网站制作哪家好
  • 晓风彩票网站建设软件工业软件的前十名龙头
  • 旅游网站建设策划书网站到期请续费
  • dede网站 异步生成天津网站开发工资水平
  • 眉山 网站开发案例学网页设计和网站建设
  • 企业网站建设可分为什么层次深圳线运营是网站建设
  • 台州企业网站搭建价格中国十大公司企业文化
  • 手机网站用户体验网站无内容 备案
  • 网站建设报价是多少软件公司起名
  • 网站开发公司上vue做网站前台
  • 如何在百度搜索到自己的网站简历模板网站有哪些
  • 网站后台和移动开发个人网站名称请
  • 免费素材网站可商用网站设置默认首页
  • 教育类的网站方案湖南seo优化推荐
  • 网络建站工作室wordpress教育网校
  • 目前最流行网站开发软件网络技术开发有限公司
  • wordpress海外建站网站添加子域名
  • 珠海网站建设哪家公司好企业网络安全
  • 广州网络营销网站建设事件营销
  • 如何建立自己的免费网站温州在线课堂
  • 网站如何做外链教程视频erp系统的主要功能
  • 网站注册便宜学校网站管理与建设办法
  • 西安注册公司多少钱seo如何提升排名收录
  • 网站建设与管理代码题建专业外贸网站