llm_interview_note icon indicating copy to clipboard operation
llm_interview_note copied to clipboard

主要记录大语言大模型(LLMs) 算法(应用)工程师相关的知识及面试题

Results 23 llm_interview_note issues
Sort by recently updated
recently updated
newest added

原文:Prefix LM的代表模型有UniLM、T5、GLM(清华滴~)

总结的很好,有一个小问题 ```python if attention_mask != None: attention_scores += attention_mask * -1e-9 ``` 这里这个值应该是-1e9

在attention的计算时的注意力拼接部分。output的维度是想从[batch_size, num_heads, seq_len, head_dim]变为[batch_size, seq_len, model_dim]。因此感觉transpose有误。应该从 ```python ## 对注意力输出进行拼接 output = ( output.transpose(-1, -2) .contiguous() .view(batch_size, -1, self.head_dim * self.num_heads) ) ``` 改为 ```python ## 对注意力输出进行拼接 output = ( output.transpose(-2,...

https://github.com/wdndev/llm_interview_note/blob/main/04.%E5%88%86%E5%B8%83%E5%BC%8F%E8%AE%AD%E7%BB%83/deepspeed%E4%BB%8B%E7%BB%8D/deepspeed%E4%BB%8B%E7%BB%8D.md ZeRO-Offload和ZeRO-Stage3是DeepSpeed中的不同的Zero-Redundancy Optimization技术,用于加速分布式训练,主要区别在资源占用和通信开销方面。 ZeRO-Offload将模型参数分片到不同的GPU上,通过交换节点间通信来降低显存占用,但需要进行额外的通信操作,因此可能会导致训练速度的下降。 **ZeRO-Stage3**将模型参数分布在CPU和GPU上,通过CPU去计算一部分梯度,从而减少显存占用,但也会带来一定的计算开销。