revert: 移除所有 torch.compile(四战全败),回到稳定版 58.49
torch.compile 全模式验证: - reduce-overhead: 199s (+126%) - default 全模型: 118s (+34%) - default Expert: 108.6s (+23%) - dynamic=True: 102.6s (+17%) MoE 动态路由 + 可变序列长度,与任何 JIT 编译不兼容
This commit is contained in:
@@ -504,14 +504,6 @@ def load_model(ckpt_path, device='cuda:0'):
|
||||
print(f"[WARNING] Checkpoint {ckpt_path} not found, using random weights")
|
||||
|
||||
model.to(dev)
|
||||
|
||||
# === torch.compile + dynamic=True:告知编译器形状可变,避免重编译 ===
|
||||
try:
|
||||
model = torch.compile(model, dynamic=True)
|
||||
print(f"[INFO] torch.compile applied (dynamic=True)")
|
||||
except Exception as e:
|
||||
print(f"[WARNING] torch.compile failed ({e}), using original model")
|
||||
|
||||
model.eval()
|
||||
print(f"[INFO] Model ready. Device: {dev}")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user