From 4594a3dd6c6e57d384bbfa7ade90d613d17fc06c Mon Sep 17 00:00:00 2001 From: Xiangyu Tian <109123695+xiangyuT@users.noreply.github.com> Date: Thu, 18 Jul 2024 13:39:34 +0800 Subject: [PATCH] LLM: Fix DummyLayer.weight device in Pipeline Parallel (#11612) --- python/llm/src/ipex_llm/transformers/pipeline_parallel.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/llm/src/ipex_llm/transformers/pipeline_parallel.py b/python/llm/src/ipex_llm/transformers/pipeline_parallel.py index 0812a12a..bbe04f12 100644 --- a/python/llm/src/ipex_llm/transformers/pipeline_parallel.py +++ b/python/llm/src/ipex_llm/transformers/pipeline_parallel.py @@ -53,7 +53,7 @@ class DummyLayer(nn.Module): super().__init__() # to avoid AttributeError in https://github.com/intel-analytics/ipex-llm/blob/main/ # python/llm/src/ipex_llm/transformers/models/llama.py#L2076 - self.weight = torch.randn(1,) + self.weight = nn.Parameter(torch.empty(0,), requires_grad=False) def forward(self, x): return x