compile_regions 在根模块具有加速钩子时会运行未编译的模型
作者: yupengtang创建于 2026年9月13日更新于 2026年9月13日
When the root module carries an accelerate hook, the model returned by `compile_regions` never calls its compiled blocks. Nothing errors, the forward just runs the original uncompiled blocks, so regional compilation silently does nothing. The script counts calls to the `OptimizedModule` wrappers that `compile_regions` creates:
内容来源: huggingface/accelerate