
ml-diffucoder
用扩散模型并行生成代码,替代传统逐字解码
项目预览
项目数据
项目介绍
Star 增长趋势
本站每日记录该项目 GitHub 星标变化,观测越久曲线越完整
数据来源:GitHub API 逐日快照 · 收录于 2026-09-14 · 当前星标 ★ 842
使用教程
ℹ 本教程由 AI 依据该项目 README 整理,个别步骤可能需要按你的环境微调。
环境要求
- NVIDIA GPU 40G 显存以上
- Python 3.11
安装与启动步骤
-
1建环境
扩散式代码生成模型,Python 3.11。
conda create -n diffucoder python=3.11 -y -c anaconda && conda activate diffucoder pip install vllm==0.8.4 setuptools -
2装加速与项目
flash-attn 要对版本。
pip install flash-attn==2.8.0.post1 --no-build-isolation pip install -e ".[code]" -
3准备数据
按难度抽子集,先跑 hard 验证。
python process_data.py --dataset_path "TIGER-Lab/AceCode-89K" --output_path "./acecode_hard.jsonl" --difficulty "hard" -
4训练/推理
run.sh 里是完整流程,先看脚本再跑。
bash run.sh
如何确认成功
生成代码能通过数据集自带的单元测试。
注意事项
- 它研究的是掩码扩散解码,与自回归模型的采样方式不同。
- vllm 版本锁死,升级会破坏推理路径。
核心亮点
- 提供完整的训练与推理代码,基于论文可复现,适合研究扩散式代码生成
- 针对代码场景改进采样策略,探索并行去噪生成,与主流自回归路线形成差异
- 由苹果开源,代码结构清晰,便于在 Python 环境中快速跑通实验
不足之处
- 属于早期研究项目,工程化与生产可用性有限,缺少大规模部署验证
- 文档和社区生态相对薄弱,模型权重与数据准备流程可能不够完善
适用场景
- 研究非自回归代码生成模型的学术实验
- 对比扩散模型与自回归模型在代码任务上的效果
- 在代码补全或生成场景中探索并行解码加速
替代项目
CodeGen、StarCoder
同类项目推荐
tmux-assistant-resurrect
开源
tmux 重启后,AI 编程会话自动接着聊
Persist and restore AI coding assistant sessions (Claude Code, OpenCode, Codex CLI, ···
aide
开源
在 VSCode 里一键搞定注释、转换、UI 转代码,批量处理文件
Conquer Any Code in VSCode: One-Click Comments, Conversions, UI-to-Code, and AI Batc···
CLIO
开源
在终端里用任意 AI 模型,高效搞定编码任务
An AI-assisted coding agent that runs in your terminal and supports many providers a···
agy-staff
开源
给 Claude Code 和 Codex 加个 Gemini 外援,随叫随到
Hire Google's Antigravity CLI (agy) as a fast Gemini staffer for Claude Code and Ope···
forall
开源
写规格,AI 生成代码并附机器可验证的证明
Forall (∀) is a coding harness from Astrio that helps developers build correct soft···
llm-vscode
开源
在 VSCode 里直接让大模型补全、解释和改代码
LLM powered development for VSCode
gentle-shell
开源
让 AI 代理按架构师规范写代码,测试审查全留痕
Gentle Shell is a Pi-native workspace for AI-assisted development, bringing parallel···
MobileVC
开源
手机远程接管电脑上的 AI 编程 CLI 会话
Turn your phone into the control center for an AI coding assistant CLI session (Clau···
gsd-for-cursor
开源
在 Cursor 里快速管任务,用命令行搞定待办,减少分心。
Cursor IDE adaptation of glittercowboy/get-shit-done