这个周末,我从零制作了一个扩散模型推理引擎(仅使用 C + CUDA),用来做实验并在本地运行文生图模型,无需使用 ComfyUI 等工具通常依赖的 100+ 个依赖包(Python、PyTorch 等)。 令我意外的是,整套东西运行得出奇地好,速度和精度都能与之匹敌。整个流程(文本编码器、去噪器、采样器等)以及运行时部分,都只靠 C 和 NVIDIA 自家的 GPU 代码运行。 虽然这主要是一次实验,但能做到这些还是让我大为震撼。未来一片光明 (:
看原文
This weekend I made a from scratch diffusion inference engine (C + CUDA only) to experiment and run text-to-image models locally without using 100+ package dependencies ComfyUI and others often rely on (Python, PyTorch etc.) To my surprise, the whole thing works surprisingly well, matching speed and accuracy. The entire pipeline (text encoder, denoiser, sampler, etc.) plus the runtime parts are running only on C and NVIDIA's own GPU code. While it was mostly an experiment, it's mind blowing to me what is possible. The future is looking bright (: