瀏覽代碼

rollback, but leave a sanity check

justheuristic 3 年之前
父節點
當前提交
0ecf296947
共有 1 個文件被更改,包括 1 次插入0 次删除
  1. 1 0
      src/client/sequential_autograd.py

+ 1 - 0
src/client/sequential_autograd.py

@@ -191,6 +191,7 @@ async def sequential_backward(
 
     # For now, we do not support mixed dummy and grad prompts
     # Concat in num_layer dimension
+    assert not grad_prompts_reversed or len(grad_prompts_reversed) == len(prompts)
     grad_prompts = torch.cat(grad_prompts_reversed[::-1], dim=0) if grad_prompts_reversed else None
     return grad_outputs, grad_prompts