Deep Learning
文章平均质量分 85
记录学习DL的过程
阿正的梦工坊
岁月不饶人,我亦未曾饶过岁月
展开
-
如何在模型训练时避免计算 Padding Token 的 Loss
根据 transformers 文档,如果没有显式指定 label_pad_token_id,它通常会默认使用 -100,因为这是 CrossEntropyLoss 的 ignore_index 默认值。原创 2024-12-03 14:06:12 · 840 阅读 · 0 评论 -
Meta-Llama-3-8B-Instruct 模型的混合精度训练显存需求:AdamW优化器(中英双语)
In-Depth Analysis of Memory Requirements for Mixed Precision Training of Meta-Llama-3-8B-Instruct Model原创 2024-12-01 14:47:50 · 1338 阅读 · 0 评论 -
为什么混合精度训练中优化器参数仍然以 FP32 存储?LLaMA 2 7B 模型在混合精度下的显存需求
混合精度训练通过 BF16 格式大幅减少显存需求,但关键的优化器参数(权重更新副本、一阶动量、二阶动量)仍然以 FP32 存储,保证数值稳定性和训练精度原创 2024-12-01 14:34:07 · 829 阅读 · 0 评论 -
如何计算训练中的 Steps 数量:基于DeepSpeed实际训练配置的详细解析
In deep learning model training, a "step" refers to a single update of the model's parameters after processing a batch of training samples.原创 2024-12-01 12:36:19 · 716 阅读 · 0 评论 -
使用 LLaMA 进行文本生成任务的 SFT(监督微调)训练
监督微调(Supervised Fine-Tuning, SFT)是指在一个已经经过预训练的大规模语言模型的基础上,使用标注数据进行进一步的训练,使其在某个特定任务上表现得更好。原创 2024-12-01 11:31:52 · 661 阅读 · 0 评论 -
监督微调SFT(Supervised Fine-Tuning)简介
在 SFT训练中,我们通常会使用有标签的训练数据进行微调。原创 2024-12-01 11:31:25 · 913 阅读 · 0 评论 -
多维高斯分布(Multivariate Gaussian Distribution)以及协方差矩阵:解析与应用
协方差矩阵的值:决定了马氏距离的尺度和方向敏感性。分布形状的建模:通过调整协方差矩阵,可以控制分布的拉伸和旋转,以更精确地拟合数据。原创 2024-11-30 15:11:17 · 1105 阅读 · 0 评论 -
NLP中的主题模型:LDA(Latent Dirichlet Allocation, 潜在狄利克雷分配)
主题模型是一种用于发现文档集合中潜在主题的概率生成模型。其中,LDA(Latent Dirichlet Allocation, 潜在狄利克雷分配)是最著名的主题模型之一。在 LDA 中,狄利克雷分布起到了核心作用,用于建模文档-主题分布和主题-单词分布。原创 2024-11-30 13:37:26 · 1161 阅读 · 0 评论 -
bfloat16(BF16)和 float16(FP16)有什么区别?中英双语解释
BF16 offers a larger numerical range and is specifically optimized for deep learning tasks that require handling large gradients and weights.原创 2024-11-29 16:46:17 · 959 阅读 · 0 评论 -
数据并行、模型并行与张量并行:深度学习中的并行计算策略(中英双语)
Data Parallelism, Model Parallelism, and Tensor Parallelism: Parallel Computing Strategies in Deep Learning原创 2024-11-29 15:33:59 · 902 阅读 · 0 评论 -
DeepSpeed 的 hybrid_engine 参数详解:中英双语
By enabling and configuring the hybrid computation engine, DeepSpeed can intelligently manage memory and computation across multiple devices, improving efficiency and reducing training time.原创 2024-11-29 15:12:17 · 969 阅读 · 0 评论 -
深入了解 DeepSpeed 的 nebula_config 参数:中英双语介绍
This parameter allows users to manage and optimize the storage and version control of training states, facilitating efficient data storage and recovery during model training.原创 2024-11-29 15:03:08 · 1123 阅读 · 0 评论 -
DeepSpeed框架配置解析:一份详细的日志分析
这些配置项涵盖了内存优化、自动调优、混合精度、分布式训练等多个方面,以及模型训练的其他细节方面,包括压缩、梯度处理、优化器配置、数据效率、流水线并行等原创 2024-11-29 14:17:28 · 813 阅读 · 0 评论 -
如何在 DeepSpeed 中开启梯度检查点(gradient checkpointing):中英双语介绍
Gradient checkpointing in DeepSpeed is a technique designed to reduce memory usage when training large models by storing only a subset of intermediate activations during the forward pass.原创 2024-11-29 13:48:50 · 804 阅读 · 0 评论 -
梯度检查点技术(Gradient Checkpointing)详细介绍:中英双语
By discarding intermediate activations and recomputing them when needed, gradient checkpointing reduces memory usage, making it feasible to train large models on memory-limited hardware.原创 2024-11-29 13:42:06 · 921 阅读 · 0 评论 -
大模型训练train_micro_batch_size_per_gpu 开得小,gradient_accumulation_steps 开得也小会怎样?
为了避免显存不足,可以通过减少 微批次大小 和 梯度累积步数、使用 混合精度训练、或应用 梯度检查点 等技术来优化显存的使用。原创 2024-11-29 13:30:15 · 874 阅读 · 0 评论 -
什么是分布式梯度累积(Distributed Gradient Accumulation)?gradient_accumulation_steps参数如何设置?
Distributed gradient accumulation helps overcome memory limitations by allowing us to simulate larger batch sizes while using smaller mini-batches.原创 2024-11-29 13:18:01 · 693 阅读 · 0 评论 -
DeepSpeed配置文件reduce_bucket_size参数详解:中英双语
reduce_bucket_size is an essential parameter in DeepSpeed's ZeRO Stage 2 optimization, controlling the size of the buckets during gradient reduction.原创 2024-11-29 13:09:00 · 690 阅读 · 0 评论 -
梯度规约(gradient reduction)是什么?中英双语解释
By understanding the mechanics of gradient reduction and the impact of contiguous memory, we can optimize distributed training setups and improve model training efficiency across multiple devices.原创 2024-11-29 12:51:04 · 585 阅读 · 0 评论 -
如何从 Hugging Face 数据集中随机采样数据并保存为新的 Arrow 文件
dataset_info.json文件记得更改原创 2024-11-29 12:36:20 · 937 阅读 · 0 评论 -
理解Parquet文件和Arrow格式:从Hugging Face数据集的角度出发
Understanding Parquet Files and Arrow Format: A Guide with Hugging Face Datasets原创 2024-11-29 12:12:54 · 978 阅读 · 0 评论 -
DeepSpeed 配置文件(DeepSpeed Configuration Files)详解:中英文解释
DeepSpeed’s configuration is highly flexible, but tuning requires balancing memory efficiency and computational speed.原创 2024-11-27 22:08:58 · 1276 阅读 · 0 评论 -
英伟达GPU通信用的NCCL库是什么?中英双语介绍
NCCL (NVIDIA Collective Communications Library) is a high-performance communication library developed by NVIDIA.原创 2024-11-27 21:40:53 · 1064 阅读 · 0 评论 -
中英双语介绍DeepSpeed 的 ZeRO 优化
DeepSpeed introduces the ZeRO (Zero Redundancy Optimizer) optimization technique, a groundbreaking solution to reduce memory usage and improve efficiency during training.原创 2024-11-27 21:17:14 · 925 阅读 · 0 评论 -
KL散度改写为一个可用于优化的形式
KL散度(Kullback-Leibler Divergence)可衡量两个概率分布之间差异原创 2024-11-27 15:34:03 · 913 阅读 · 0 评论 -
open-instruct框架使用记录:只使用huggingface数据集的小部分进行训练,如何修改dataset_info.json文件
训模型的经验原创 2024-11-27 12:17:15 · 1231 阅读 · 0 评论 -
大模型论文中出现的held-out evaluations是什么?
By using a held-out set, we ensure that the evaluation results are reliable and not influenced by overfitting to the training or development data.原创 2024-11-25 15:50:19 · 882 阅读 · 0 评论 -
机器学习中数据集Upsampling和Downsampling是什么意思?中英文介绍
upsampling and downsampling refer to adjusting the number of samples in a dataset原创 2024-11-25 15:16:51 · 736 阅读 · 0 评论 -
大模型论文中用的词artifact的中文是什么?
是成果的意思,可以指学术成果,产出。原创 2024-11-25 14:47:34 · 615 阅读 · 0 评论 -
PPO里面利用Reference模型和KL散度来防止Actor模型训歪:为什么出现log_prob?
PPO四个模型里面的Reference模型原创 2024-11-20 14:45:20 · 1059 阅读 · 0 评论 -
PyTorch用map函数进行tokenize之后,为什么需要remove_columns?
map函数的默认行为是将这些新生成的字段添加到原始数据集的每个样本上,同时保留原有的字段,除非你告诉它删除这些字段。原创 2024-09-26 19:32:36 · 616 阅读 · 0 评论 -
对条件语言模型(Conditional Language Model)的目标函数的理解
通过最大化对数似然估计来学习参数\($\Phi$\),从而使模型能够根据给定的输入序列\(x\)来生成输出序列\(y\)原创 2024-09-23 17:48:21 · 735 阅读 · 0 评论 -
Pytorch如何获取BERT模型最后一层隐藏状态的CLS的embedding?
We used the final layer hidden state of each sentence’s [CLS] token as its embedding原创 2024-08-21 12:44:26 · 1364 阅读 · 0 评论 -
Coursera吴恩达深度学习专项课程01: Neural Networks and Deep Learning 学习笔记 Week 04 (完结)
第四周的quiz和编程作业。第一门课结束原创 2024-05-11 20:48:25 · 907 阅读 · 0 评论 -
Coursera吴恩达深度学习专项课程01: Neural Networks and Deep Learning 学习笔记 Week 03
第三周的quiz和编程作业原创 2024-05-11 20:32:26 · 1036 阅读 · 0 评论 -
Coursera吴恩达深度学习专项课程01: Neural Networks and Deep Learning 学习笔记 Week 02
第二周的quiz和编程作业原创 2024-05-11 20:16:19 · 1253 阅读 · 0 评论 -
Coursera吴恩达深度学习专项课程01: Neural Networks and Deep Learning 学习笔记 Week 01
第一周的字幕,quiz原创 2024-05-11 19:57:19 · 1283 阅读 · 0 评论 -
Huggingface遇到OSError: We couldn‘t connect to ‘https://huggingface.co‘ to load this file解决方法
手动下载并上传原创 2023-09-17 14:50:09 · 20289 阅读 · 9 评论 -
Huggingface遇到 Couldn‘t reach xxx on the Hub (ConnectionError)解决方法
下载数据集到本地,手动上传到服务器原创 2023-09-16 16:16:19 · 14299 阅读 · 11 评论 -
what(): NCCL Error 1: unhandled cuda error解决方法
torch,cudatoolkit和cuda驱动版本要适配原创 2023-08-30 15:10:28 · 3080 阅读 · 0 评论
分享