Skip to content

Commit

Permalink
split gptbigcode forward (HabanaAI#194)
Browse files Browse the repository at this point in the history
  • Loading branch information
libinta authored Aug 19, 2024
1 parent 8185d76 commit f7dd91d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions vllm/model_executor/models/gpt_bigcode.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
VocabParallelEmbedding)
from vllm.model_executor.model_loader.weight_utils import default_weight_loader
from vllm.model_executor.sampling_metadata import SamplingMetadata
from vllm.platforms import current_platform
from vllm.sequence import IntermediateTensors, SamplerOutput

from .interfaces import SupportsLoRA
Expand Down Expand Up @@ -224,9 +225,14 @@ def forward(
position_embeds = self.wpe(position_ids)
hidden_states = inputs_embeds + position_embeds

if current_platform.is_hpu():
import habana_frameworks.torch as htorch
htorch.core.mark_step()
for i in range(len(self.h)):
layer = self.h[i]
hidden_states = layer(hidden_states, kv_caches[i], attn_metadata)
if current_platform.is_hpu():
htorch.core.mark_step()

hidden_states = self.ln_f(hidden_states)
return hidden_states
Expand Down

0 comments on commit f7dd91d

Please sign in to comment.