DeepSeek-V3/inference
Evan Wallace 40ec3a3f21 Optimization to Model Script
Appended Mixed Precision Training (FP16/BF16)
Generated Low-Rank Factorization (SVD) Functionality
Generated Attention Efficiency using Linformer
Reducing Memory & Computational Complexity using FlashAttention
Attached Functionality for Spare Matrices using Butterfly Matrices (Structured Linear Layers)
Generated Function for Low-Rank Approximations

Changes to the Transformer Class:
Efficient Initialization
Uses list comprehension for self.layers instead of a loop.
Consolidated distributed initialization logic.
Memory and Performance Enhancements
Avoids unnecessary operations on tensors.
Uses .shape instead of .size() for clarity.
Code Clarity and Maintainability
Removed redundant variables.
Used in-place operations where applicable.

Changes to the Gate Class:
Replaced linear(x, self.weight) with torch.matmul(x, self.weight.T):
More efficient for linear transformations.
Reduced Redundant Computations:
Avoided unnecessary reassignments.
Merged bias addition into a single step.
Optimized Group-Based Routing:
Used amax instead of unnecessary top-k and sum operations.
Applied in-place scatter operation for memory efficiency.
Simplified Expert Selection:
Directly applied topk for selecting top experts.
2025-01-30 21:52:56 -08:00
..
configs Release DeepSeek-V3 2024-12-26 19:01:57 +08:00
convert.py Enhance documentation and update .gitignore for model conversion scripts 2025-01-05 18:18:18 +00:00
fp8_cast_bf16.py Enhance documentation and update .gitignore for model conversion scripts 2025-01-05 18:18:18 +00:00
generate.py Enhance documentation and update .gitignore for model conversion scripts 2025-01-05 18:18:18 +00:00
kernel.py Enhance documentation and update .gitignore for model conversion scripts 2025-01-05 18:18:18 +00:00
model.py Optimization to Model Script 2025-01-30 21:52:56 -08:00
requirements.txt Release DeepSeek-V3 2024-12-26 19:01:57 +08:00