SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2406.02500 · 2024

Towards Efficient Mixture of Experts: A Holistic Study of Compression Techniques

arXiv · PDF · Open in the Atlas

Code that ran

We lifted 11 functions out of this paper's own repositories and ran 5 of them in a sandbox. "Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results.

RepositoryRoleRan
daizedong/unified-moe-compression canonical 5 of 11
FunctionStatusWhere it lives
check_sparsity_from_state_dict Ran daizedong/unified-moe-compression/src/llmtuner/compression/prune/utils.py
code served (permissive licence) · get_code("7b483277d903ceb1")
fill_missing_values_for_non_moe_layers Ran daizedong/unified-moe-compression/src/llmtuner/compression/prune/expert_drop.py
code served (permissive licence) · get_code("f7e6b2633db22c17")
find_modules Ran daizedong/unified-moe-compression/src/llmtuner/compression/prune/utils.py
code served (permissive licence) · get_code("6031b360d9fd7f04")
find_moe_expert_linears Ran daizedong/unified-moe-compression/src/llmtuner/compression/prune/utils.py
code served (permissive licence) · get_code("d857212c7c79f1fe")
load_json Ran daizedong/unified-moe-compression/src/llmtuner/compression/prune/io.py
code served (permissive licence) · get_code("8db0c1b19aba233f")
apply_moe_weights Not yet run daizedong/unified-moe-compression/AutoAWQ/awq/modules/fused/moe.py
code served (permissive licence) · get_code("858343dca0bec6c6")
fused_topk Not yet run daizedong/unified-moe-compression/AutoAWQ/awq/modules/fused/moe.py
code served (permissive licence) · get_code("a1324de2a7fd6559")
moe_align_block_size Not yet run daizedong/unified-moe-compression/AutoAWQ/awq/modules/fused/moe.py
code served (permissive licence) · get_code("68b3f990b0ec61d6")
prune_magnitude Not yet run daizedong/unified-moe-compression/src/llmtuner/compression/prune/prune.py
code served (permissive licence) · get_code("bdface3275751bca")
prune_sparsegpt Not yet run daizedong/unified-moe-compression/src/llmtuner/compression/prune/prune.py
code served (permissive licence) · get_code("3c36697395392b37")
prune_wanda Not yet run daizedong/unified-moe-compression/src/llmtuner/compression/prune/prune.py
code served (permissive licence) · get_code("477c9e48c3c1bac2")

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Scaling large language models has driven remarkable advancements across various domains, yet the continual increase in model size presents significant challenges for real-world deployment. The Mixture of Experts (MoE) architecture offers a promising solution by dynamically selecting and activating only a subset of experts during inference, thus substantially reducing computational costs while preserving high performance. Despite these benefits, MoE introduces new inefficiencies, such as excessive parameters and communication overhead. In this work, we present a holistic study of compression techniques for Mixture of Experts to enhance both efficiency and scalability. While recent efforts have focused on Expert Trimming, which reduces the number of experts, these approaches still suffer from considerable communication and computational costs. To address this, we propose more aggressive strategies, such as Layer Drop, which removes entire MoE layers, and Block Drop, which eliminates transformer blocks. Surprisingly, these aggressive pruning techniques not only preserve model performance but also substantially improve computation and memory efficiency. Furthermore, beyond Expert Trimming, we also introduce Expert Slimming, which compresses individual experts to further boost performance and can be seamlessly integrated with Expert Trimming. Extensive experimental results demonstrate the effectiveness of our proposed methods-Layer Drop and Block Drop-along with the comprehensive recipe that integrates Expert Slimming and Expert Trimming, achieving a 6.05x speedup with 77.1% reduced memory usage while maintaining over 92% of performance on Mixtral-8x7B. Our code is released at https://github.com/CASE-Lab-UMD/Unified-MoE-Compression.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2406.02500")
get_code_for_paper("2406.02500")
have("2406.02500")

Connect an agent — have() is free.