Llama3-Tutorial之LMDeploy高效部署Llama3实践

Llama3-Tutorial之LMDeploy高效部署Llama3实践

Llama 3 近期重磅发布,发布了 8B 和 70B 参数量的模型,lmdeploy团队对 Llama 3 部署进行了光速支持!!!

书生·浦语和机智流社区同学光速投稿了 LMDeploy 高效量化部署 Llama 3,欢迎 Star。

https://github.com/internLM/LMDeploy

参考: https://github.com/SmartFlowAI/Llama3-Tutorial

本文将分为以下几个部分来介绍,如何使用LMDeploy来部署Llama3

  • 环境,模型准备
  • LMDeploy chat
  • LMDeploy模型量化(lite)
  • LMDeploy服务(serve)
  • 扩展部分

1. 环境和模型准备

1.1 环境配置

# 如果你是InternStudio 可以直接使用
# studio-conda -t lmdeploy -o pytorch-2.1.2
# 初始化环境
conda create -n lmdeploy python=3.10
conda activate lmdeploy
conda install pytorch==2.1.2 torchvision==0.16.2 torchaudio==2.1.2 pytorch-cuda=12.1 -c pytorch -c nvidia

安装lmdeploy最新版:

pip install -U lmdeploy[all]

1.2 llama3下载

# 创建文件夹
mkdir -p ~/model
cd ~/model

# 从OpenXLab中获取权重(开发机中不需要使用此步)
# 安装 git-lfs 依赖

# 如果下面命令报错则使用 apt install git git-lfs -y
conda install git-lfs
git-lfs install
#下载模型 (InternStudio 中不建议执行这一步)
git clone https://code.openxlab.org.cn/MrCat/Llama-3-8B-Instruct.git Meta-Llama-3-8B-Instruct


或者软链接 InternStudio 中的模型:
ln -s /root/share/new_models/meta-llama/Meta-Llama-3-8B-Instruct ~/model/Meta-Llama-3-8B-Instruct

2. LMDeploy Chat CLI 工具

conda activate lmdeploy
lmdeploy chat /root/model/Meta-Llama-3-8B-Instruct

3. LMDeploy模型量化(lite)

本部分内容主要介绍如何对模型进行量化。主要包括 KV8量化和W4A16量化。

3.1 设置最大KV Cache缓存大小

模型在运行时,占用的显存可大致分为三部分:模型参数本身占用的显存、KV Cache占用的显存,以及中间运算结果占用的显存。LMDeploy的KV Cache管理器可以通过设置--cache-max-entry-count参数,控制KV缓存占用剩余显存的最大比例。默认的比例为0.8。

下面通过几个例子,来看一下调整--cache-max-entry-count参数的效果。首先保持不加该参数(默认0.8),运行 Llama3-8b 模型。

lmdeploy chat /root/model/Meta-Llama-3-8B-Instruct/

(base) root@intern-studio-50014188:~# studio-smi 
Running studio-smi by vgpu-smi
Mon May 06 09:58:19 2024
+------------------------------------------------------------------------------+
| VGPU-SMI 1.7.13       Driver Version: 535.54.03     CUDA Version: 12.2       |
+-------------------------------------------+----------------------------------+
| GPU  Name                Bus-Id           |        Memory-Usage     GPU-Util |
|===========================================+==================================|
|   0  NVIDIA A100-SXM...  00000000:13:00.0 | 23112MiB / 24566MiB    0% /  30% |
+-------------------------------------------+----------------------------------+

lmdeploy chat /root/model/Meta-Llama-3-8B-Instruct/ --cache-max-entry-count 0.5

(base) root@intern-studio-50014188:~# studio-smi 
Running studio-smi by vgpu-smi
Mon May 06 09:59:20 2024
+------------------------------------------------------------------------------+
| VGPU-SMI 1.7.13       Driver Version: 535.54.03     CUDA Version: 12.2       |
+-------------------------------------------+----------------------------------+
| GPU  Name                Bus-Id           |        Memory-Usage     GPU-Util |
|===========================================+==================================|
|   0  NVIDIA A100-SXM...  00000000:13:00.0 | 20488MiB / 24566MiB    0% /  30% |
+-------------------------------------------+----------------------------------+

lmdeploy chat /root/model/Meta-Llama-3-8B-Instruct/ --cache-max-entry-count 0.01

(base) root@intern-studio-50014188:~# studio-smi 
Running studio-smi by vgpu-smi
Mon May 06 09:57:27 2024
+------------------------------------------------------------------------------+
| VGPU-SMI 1.7.13       Driver Version: 535.54.03     CUDA Version: 12.2       |
+-------------------------------------------+----------------------------------+
| GPU  Name                Bus-Id           |        Memory-Usage     GPU-Util |
|===========================================+==================================|
|   0  NVIDIA A100-SXM...  00000000:13:00.0 | 16208MiB / 24566MiB    0% /  30% |
+-------------------------------------------+----------------------------------+

可以看出,降低KV Cache,可以降低显存资源的占用,代价是会降低模型推理速度。

3.2 使用W4A16量化

仅需执行一条命令,就可以完成模型量化工作。

lmdeploy lite auto_awq \
   /root/model/Meta-Llama-3-8B-Instruct \
  --calib-dataset 'ptb' \
  --calib-samples 128 \
  --calib-seqlen 1024 \
  --w-bits 4 \
  --w-group-size 128 \
  --work-dir /root/model/Meta-Llama-3-8B-Instruct_4bit

使用Chat功能运行W4A16量化后的模型:

lmdeploy chat /root/model/Meta-Llama-3-8B-Instruct_4bit --model-format awq

此时显存占用:

# studio-smi 
Running studio-smi by vgpu-smi
Mon May 06 10:23:26 2024
+------------------------------------------------------------------------------+
| VGPU-SMI 1.7.13       Driver Version: 535.54.03     CUDA Version: 12.2       |
+-------------------------------------------+----------------------------------+
| GPU  Name                Bus-Id           |        Memory-Usage     GPU-Util |
|===========================================+==================================|
|   0  NVIDIA A100-SXM...  00000000:13:00.0 | 21174MiB / 24566MiB    0% /  30% |
+-------------------------------------------+----------------------------------+

将KV Cache比例再次调为0.01,查看显存占用情况:

lmdeploy chat /root/model/Meta-Llama-3-8B-Instruct_4bit --model-format awq --cache-max-entry-count 0.01

此时显存占用:

# studio-smi 
Running studio-smi by vgpu-smi
Mon May 06 10:26:02 2024
+------------------------------------------------------------------------------+
| VGPU-SMI 1.7.13       Driver Version: 535.54.03     CUDA Version: 12.2       |
+-------------------------------------------+----------------------------------+
| GPU  Name                Bus-Id           |        Memory-Usage     GPU-Util |
|===========================================+==================================|
|   0  NVIDIA A100-SXM...  00000000:13:00.0 |  6582MiB / 24566MiB    0% /  30% |
+-------------------------------------------+----------------------------------+

显存占用变为6738MB,明显降低。

3.3 在线量化 KV

自 v0.4.0 起,LMDeploy KV 量化方式有原来的离线改为在线。并且,支持两种数值精度 int4、int8。量化方式为 per-head per-token 的非对称量化。它具备以下优势:

  • 量化不需要校准数据集
  • kv int8 量化精度几乎无损,kv int4 量化精度在可接受范围之内
  • 推理高效,在 llama2-7b 上加入 int8/int4 kv 量化,RPS 相较于 fp16 分别提升近 30% 和 40%
  • 支持 volta 架构(sm70)及以上的所有显卡型号:V100、20系列、T4、30系列、40系列、A10、A100 等等 通过 LMDeploy 应用 kv 量化非常简单,只需要设定 quant_policy 参数。LMDeploy 规定 qant_policy=4表示 kv int4 量化,quant_policy=8 表示 kv int8 量化。

4. LMDeploy服务(server)

在前面的章节,我们都是在本地直接推理大模型,这种方式成为本地部署。在生产环境下,我们有时会将大模型封装为 API 接口服务,供客户端访问。

4.1 启动API服务器

通过以下命令启动API服务器,推理Meta-Llama-3-8B-Instruct模型:

lmdeploy serve api_server \
    /root/model/Meta-Llama-3-8B-Instruct \
    --model-format hf \
    --quant-policy 0 \
    --server-name 0.0.0.0 \
    --server-port 23333 \
    --tp 1

其中,model-format、quant-policy这些参数是与第三章中量化推理模型一致的;server-name和server-port表示API服务器的服务IP与服务端口;tp参数表示并行数量(GPU数量)。 通过运行以上指令,我们成功启动了API服务器,请勿关闭该窗口,后面我们要新建客户端连接该服务。你也可以直接打开http://{host}:23333查看接口的具体使用说明。这一步由于Server在远程服务器上,需要配置ssh端口转发。

方法一:

vscode配置端口转发。

alt

方法二:

在你本地打开一个cmd窗口,输入命令如下:

ssh -CNg -L 23333:127.0.0.1:23333 root@ssh.intern-ai.org.cn -p 你的ssh端口号

然后打开本地浏览器,访问http://127.0.0.1:23333

fast-api
fast-api

4.2 命令行客户端连接API服务器

上一节中在终端里新开了一个API服务器,要新建一个命令行客户端去连接API服务器。首先通过VS Code新建一个终端:

# 激活conda环境
(base) root@intern-studio-50014188:~# conda activate lmdeploy
# 启动api客户端连接API服务器
(lmdeploy) root@intern-studio-50014188:~# lmdeploy serve api_client http://localhost:23333
# chat测试
double enter to end input >>> Hello!  # 双击回车键发送

Hello there! It's nice to meet you! Is there something I can help you with, or would you like to chat for a bit? I'm here to listen and assist you with any questions or topics you'd like to discuss.
double enter to end input >>> 

4.3 网页客户端连接API服务器

关闭刚刚的VSCode终端,但服务器端的终端不要关闭。 运行之前确保自己的gradio版本低于4.0.0。

pip install gradio==3.50.2

新建一个VSCode终端,激活conda环境。

conda activate lmdeploy

使用Gradio作为前端,启动网页客户端。

lmdeploy serve gradio http://localhost:23333 \
    --server-name 0.0.0.0 \
    --server-port 6006

同理配置端口转发:

alt

打开浏览器,访问地址http://127.0.0.1:6006 然后就可以与模型进行对话了!

alt

拓展部分

5. 推理速度

使用 LMDeploy 在 A100(80G)推理 Llama3,每秒请求处理数(RPS)高达 25,是 vLLM 推理效率的 1.8+ 倍。

  • 克隆仓库
cd ~
git clone https://github.com/InternLM/lmdeploy.git
  • 下载测试数据
cd /root/lmdeploy
wget https://hf-mirror.com/datasets/anon8231489123/ShareGPT_Vicuna_unfiltered/resolve/main/ShareGPT_V3_unfiltered_cleaned_split.json
  • 执行 benchmark 命令(如果你的显存较小,可以调低 --cache-max-entry-count)

本文测试,使用30%的A100资源(24G显存),将cache-max-entry-count设置为0.2:

# 激活conda环境
conda activate lmdeploy
# 运行benchmark测试
python benchmark/profile_throughput.py \
    ShareGPT_V3_unfiltered_cleaned_split.json \
    /root/model/Meta-Llama-3-8B-Instruct \
    --cache-max-entry-count 0.2 \
    --concurrency 256 \
    --model-format hf \
    --quant-policy 0 \
    --num-prompts 10000

...

[llama]
model_name = llama3
tensor_para_size = 1
head_num = 32
kv_head_num = 8
vocab_size = 128256
num_layer = 32
inter_size = 14336
norm_eps = 1e-05
attn_bias = 0
start_id = 128000
end_id = 128001
session_len = 4096
weight_type = bf16
rotary_embedding = 128
rope_theta = 500000.0
size_per_head = 128
group_size = 0
max_batch_size = 256
max_context_token_num = 1
step_length = 1
cache_max_entry_count = 0.2
cache_block_seq_len = 64
cache_chunk_size = -1
num_tokens_per_iter = 8192
max_prefill_iters = 1
extra_tokens_per_iter = 0
use_context_fmha = 1
quant_policy = 0
max_position_embeddings = 8192
rope_scaling_factor = 0.0
use_dynamic_ntk = 0
use_logn_attn = 0
lora_policy = 
lora_r = 0
lora_scale = 0.0

测试过程较长(2h以上),测试结果如下:

concurrency: 256
elapsed_time: 8759.642s

first token latency(s)(min, max, ave): 1.593, 298.350, 208.213
per-token latency(s) percentile(50, 75, 95, 99): [0.029, 0.033, 0.154, 0.694]

number of prompt tokens: 2238364
number of completion tokens: 2005448
token throughput (completion token): 228.942 token/s
token throughput (prompt + completion token): 484.473 token/s
RPS (request per second): 1.142 req/s
RPM (request per minute): 68.496 req/min

6. 使用LMDeploy运行视觉多模态大模型 Llava-Llama-3

6.1 安装依赖

(lmdeploy) root@intern-studio-50014188:~/lmdeploy# pip install git+https://github.com/haotian-liu/LLaVA.git

6.2 运行模型

运行vi /root/pipeline_llava.py,复制如下代码到文件中:

from lmdeploy import pipeline, ChatTemplateConfig
from lmdeploy.vl import load_image
pipe = pipeline('xtuner/llava-llama-3-8b-v1_1-hf',
                chat_template_config=ChatTemplateConfig(model_name='llama3'))

image = load_image('https://raw.githubusercontent.com/open-mmlab/mmdeploy/main/tests/data/tiger.jpeg')
response = pipe(('describe this image', image))
print(response.text)

上图中的图片如下:

alt

运行上面的python文件,结果为:

(lmdeploy) root@intern-studio-50014188:~/lmdeploy# python ~/pipeline_llava.py 
.gitattributes: 1.52kB [00:00, 9.95MB/s]                                                                                          
config.json: 1.01kB [00:00, 6.49MB/s]                                                                                             
README.md: 4.50kB [00:00, 27.3MB/s]                                                                                               
generation_config.json: 100%|████████████████████████████████████████████████████████████████████| 121/121 [00:00<00:00, 1.45MB/s]
model-00002-of-00009.safetensors: 100%|██████████████████████████████████████████████████████| 1.90G/1.90G [05:40<00:00, 5.57MB/s]
model-00006-of-00009.safetensors: 100%|██████████████████████████████████████████████████████| 1.95G/1.95G [05:53<00:00, 5.51MB/s]
model.safetensors.index.json: 73.2kB [00:00, 218MB/s]███████████████████████████████████████▌| 1.93G/1.95G [05:54<00:02, 5.78MB/s]
preprocessor_config.json: 780B [00:00, 5.84MB/s]                                                                                  
special_tokens_map.json: 100%|███████████████████████████████████████████████████████████████████| 301/301 [00:00<00:00, 2.75MB/s]
model-00004-of-00009.safetensors: 100%|██████████████████████████████████████████████████████| 1.95G/1.95G [05:57<00:00, 5.45MB/s]
tokenizer_config.json: 51.0kB [00:00, 201MB/s]███████████████████████████████████████████████| 1.95G/1.95G [05:57<00:00, 6.17MB/s]
tokenizer.json: 9.08MB [00:01, 6.44MB/s]██████████████████████████████████████████████████▏  | 1.88G/1.98G [05:56<00:15, 6.50MB/s]
model-00001-of-00009.safetensors: 100%|██████████████████████████████████████████████████████| 1.97G/1.97G [06:01<00:00, 5.46MB/s]
model-00008-of-00009.safetensors: 100%|██████████████████████████████████████████████████████| 2.00G/2.00G [06:02<00:00, 5.52MB/s]
model-00003-of-00009.safetensors: 100%|██████████████████████████████████████████████████████| 1.98G/1.98G [06:12<00:00, 5.31MB/s]
model-00005-of-00009.safetensors: 100%|██████████████████████████████████████████████████████| 1.98G/1.98G [06:14<00:00, 5.29MB/s]
model-00007-of-00009.safetensors: 100%|██████████████████████████████████████████████████████| 1.98G/1.98G [06:23<00:00, 5.16MB/s]
model-00009-of-00009.safetensors: 100%|██████████████████████████████████████████████████████| 1.05G/1.05G [02:58<00:00, 5.90MB/s]
Fetching 18 files: 100%|██████████████████████████████████████████████████████████████████████████| 18/18 [08:41<00:00, 28.99s/it]
preprocessor_config.json: 100%|██████████████████████████████████████████████████████████████████| 316/316 [00:00<00:00, 1.74MB/s]
config.json: 4.76kB [00:00, 30.7MB/s]                                                                                             
pytorch_model.bin: 100%|█████████████████████████████████████████████████████████████████████| 1.71G/1.71G [05:20<00:00, 5.34MB/s]
Loading checkpoint shards: 100%|████████████████████████████████████████████████████████████████████| 9/9 [00:06<00:00,  1.46it/s]
/root/.conda/envs/lmdeploy/lib/python3.10/site-packages/huggingface_hub/file_download.py:1132: FutureWarning: `resume_download` is deprecated and will be removed in version 1.0.0. Downloads always resume when possible. If you want to force a new download, use `force_download=True`.
  warnings.warn(
Special tokens have been added in the vocabulary, make sure the associated word embeddings are fine-tuned or trained.
Special tokens have been added in the vocabulary, make sure the associated word embeddings are fine-tuned or trained.
[WARNING] gemm_config.in is not found; using default GEMM algo                                                                    
In the image, a majestic tiger is captured in a moment of tranquility. The tiger, with its distinctive orange and black stripes, is lying on its side on a lush, green grassy field. Its head is slightly tilted to the left, and it gazes directly into the camera, almost as if it's aware of its photograph being taken. The tiger's body is fully stretched out on the grass, and its front paws are slightly raised, perhaps in a relaxed manner. The background of the image is blurred, but it gives the impression of a forest or wooded area, providing a natural habitat for this magnificent creature. The image does not contain any text or other discernible objects. The tiger is the sole focus of this image, and its position and gaze give it a commanding presence. The colors, object types, and actions in this image have been described as accurately as possible based on the given image.

本文由 mdnice 多平台发布

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mfbz.cn/a/596141.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

对于子数组问题的动态规划

前言 先讲讲我对于这个问题的理解吧 当谈到解决子数组问题时&#xff0c;动态规划(DP)是一个强大的工具&#xff0c;它在处理各种算法挑战时发挥着重要作用。动态规划是一种思想&#xff0c;它通过将问题分解成更小的子问题并以一种递归的方式解决它们&#xff0c;然后利用这些…

【华为】IPSec VPN手动配置

【华为】IPSec VPN手动配置 拓扑配置ISP - 2AR1NAT - Easy IPIPSec VPN AR3NATIPsec VPN PC检验 配置文档AR1AR2 拓扑 配置 配置步骤 1、配置IP地址&#xff0c;ISP 路由器用 Lo0 模拟互联网 2、漳州和福州两个出口路由器配置默认路由指向ISP路由器 3、进行 IPsec VPN配置&…

Redission分布式锁 watch dog 看门狗机制

为了避免Redis实现的分布式锁超时&#xff0c;Redisson中引入了watch dog的机制&#xff0c;他可以帮助我们在Redisson实例被关闭前&#xff0c;不断的延长锁的有效期。 自动续租&#xff1a;当一个Redisson客户端实例获取到一个分布式锁时&#xff0c;如果没有指定锁的超时时…

笔记86:关于【#ifndef + #define + #endif】的用法

当你在编写一个头文件&#xff08;例如 pid_controller.h&#xff09;时&#xff0c;你可能会在多个源文件中包含它&#xff0c;以便在这些源文件中使用该头文件定义的函数、类或其他声明。如果你在多个源文件中都包含了同一个头文件&#xff0c;那么当你将整个工程统一编译&am…

银行卡实名认证API接口快速对接

银行卡实名认证API接口又叫银行卡核验类API接口、银行卡验证类API接口、银联核验类API接口,根据入参字段不同&#xff0c;分银行卡二要素验证API接口&#xff0c;银行卡三要素验证API接口&#xff0c;银行卡四要素验证API接口。其中&#xff0c;银行卡二要素验证API接口是验证开…

锂电池SOH估计 | Matlab实现基于ALO-SVR模型的锂电池SOH估计

目录 预测效果基本介绍程序设计参考资料 预测效果 基本介绍 锂电池SOH估计 | Matlab实现基于ALO-SVR模型的锂电池SOH估计 蚁狮优化支持向量机锂电池健康状态SOH估计&#xff1b; 具体流程如下&#xff1b; 1、分析锂离子电池老化数据集&#xff0c;从中选取具有代表电池性能衰减…

【自用】了解移动存储卡的基本信息

前言 本文是看B站视频做的一个简单笔记&#xff0c;方便日后自己快速回顾&#xff0c;内容主要介绍了存储卡基本参数&#xff0c;了解卡面上的数字、图标代表的含义。对于日后如何挑选判断一张存储卡的好坏、判别一张存储卡是否合格有一定帮助。 视频参考链接&#xff1a;【硬…

深入剖析Tomcat(六) Tomcat各组件的生命周期控制

Catalina中有很多组件&#xff0c;像上一章提到的四种容器&#xff0c;载入器&#xff0c;映射器等都是一种组件。每个组件在对外提供服务之前都需要有个启动过程&#xff1b;组件在销毁之前&#xff0c;也需要有个关闭过程&#xff1b;例如servlet容器关闭时&#xff0c;需要调…

OpenNJet应用引擎——云原生时代的Web服务新选择

文章目录 OpenNJet应用引擎——云原生时代的Web服务新选择引言&#xff1a;数字化转型的推动力&#xff1a;OpenNJet应用引擎为什么选择OpenNJet&#xff1f; OpenNJet的核心优势1. 云原生功能增强2. 安全加固3. 代码重构与性能优化4. 动态加载机制5. 多样化的产品形态6. 易于集…

产业空间集聚DO指数计算

1.前言 创始人 :Duranton and Overman&#xff08;2005&#xff09; 目前应用较多的产业集聚度量指数主要基于两类&#xff0c;一是根据不同空间地理单元中产业经济规模的均衡性进行构造&#xff0c;如空间基尼系数与EG指数&#xff1b;二是基于微观企业地理位置信息形成的产业…

嵌入式系统应用-拓展-FLASH之操作 SFUD (Serial Flash Universal Driver)之KEIL应用

这里已经假设SFUD代码已经移植到工程下面成功了&#xff0c;如果读者对SFUD移植还不了解。可以参考笔者这篇文章&#xff1a;SFUD (Serial Flash Universal Driver)之KEIL移植 这里主要介绍测试和应用 1 硬件设计 这里采用windbond 的W25Q32这款芯片用于SFUD测试。 W25Q32是…

LLM⊗KG范式下的知识图谱问答实现框架思想阅读

分享一张有趣的图&#xff0c;意思是在分类场景下&#xff0c;使用大模型和fasttext的效果&#xff0c;评论也很逗。 这其实背后的逻辑是&#xff0c;在类别众多的分类场景下&#xff0c;尤其是在标注数据量不缺的情况下&#xff0c;大模型的收益是否能够比有监督模型的收益更多…

[渗透利器]全能工具=信息收集->漏洞扫描->EXP调用

前言 hxd开发的工具&#xff0c;大致模块有&#xff08;信息收集&#xff0c;漏洞扫描&#xff0c;暴力破解&#xff0c;POC/EXP&#xff0c;常用编码&#xff09; 工具使用 下载后解压 安装环境 pip install -r requirements.txt 注意&#xff0c;该工具继承了两种不同的使…

HTML_CSS学习:定位

一、相对定位 相关代码&#xff1a; <!DOCTYPE html> <html lang"en"> <head><meta charset"UTF-8"><title>相对定位</title><style>.outer{width: 500px;background-color: #999ff0;border: 1px solid #000;p…

OpenHarmony实战开发-上传文件

Web组件支持前端页面选择文件上传功能&#xff0c;应用开发者可以使用onShowFileSelector()接口来处理前端页面文件上传的请求。 下面的示例中&#xff0c;当用户在前端页面点击文件上传按钮&#xff0c;应用侧在onShowFileSelector()接口中收到文件上传请求&#xff0c;在此接…

不考408的985,不想考408的有福了!吉林大学计算机考研考情分析

吉林大学&#xff08;Jilin University&#xff09;简称吉大&#xff0c;位于吉林长春&#xff0c;始建于1946年&#xff0c;是中华人民共和国教育部直属的综合性全国重点大学&#xff0c;国家“双一流”、“211工程”、“985工程”、“2011计划”重点建设的著名学府&#xff0…

我是如何带团队从0到1做了AI中台

经历心得 我从18年初就开始带这小团队开始做项目&#xff0c;比如最初的数字广东的协同办公项目&#xff0c;以及粤信签小程序等&#xff0c;所以&#xff0c;在团队管理&#xff0c;人员安排&#xff0c;工作分工&#xff0c;项目拆解等方面都有一定的经验。 19年中旬&#…

基于TL431和CSA的恒压与负压输出

Hello uu们,51去那里玩了呀?该收心回来上班了,嘿嘿! 为什么会有这个命题,因为我的手头只有这些东西如何去实现呢?让我们一起来看电路图吧.电路图如下图1所示 图1:CSA恒压输出电路 图1中,R1给U2提供偏置,Q1给R1提供电流,当U1-VOUT输出大于2.5V时候,U2内部的三极管CE导通,使得…

Kalign 3:大型数据集的多序列比对

之前一直用的是muscle&#xff0c;看到一个文章使用了Kalign&#xff0c;尝试一下吧 安装 wget -c https://github.com/TimoLassmann/kalign/archive/refs/tags/v3.4.0.tar.gz tar -zxvf v3.4.0.tar.gz cd kalign-3.4.0 mkdir build cd build cmake .. make make test su…

JVM之内存分配的详细解析

内存分配 两种方式 不分配内存的对象无法进行其他操作&#xff0c;JVM 为对象分配内存的过程&#xff1a;首先计算对象占用空间大小&#xff0c;接着在堆中划分一块内存给新对象 如果内存规整&#xff0c;使用指针碰撞&#xff08;Bump The Pointer&#xff09;。所有用过的内…