Unverified Commit ae002924 authored by Isotr0py's avatar Isotr0py Committed by GitHub
Browse files

[CI/Build] Fix and re-enable v1 PP test on CI (#25496)


Signed-off-by: default avatarIsotr0py <mozf@mail2.sysu.edu.cn>
parent 690f948e
...@@ -382,7 +382,6 @@ def test_tp_language_generation( ...@@ -382,7 +382,6 @@ def test_tp_language_generation(
test_options: PPTestOptions, test_options: PPTestOptions,
num_gpus_available, num_gpus_available,
): ):
pytest.skip("Skipping the test until V1 passes it.")
_compare_tp(model_id, _compare_tp(model_id,
parallel_setup, parallel_setup,
distributed_backend, distributed_backend,
...@@ -410,7 +409,6 @@ def test_tp_language_embedding( ...@@ -410,7 +409,6 @@ def test_tp_language_embedding(
test_options: PPTestOptions, test_options: PPTestOptions,
num_gpus_available, num_gpus_available,
): ):
pytest.skip("Skipping the test until V1 passes it.")
_compare_tp(model_id, _compare_tp(model_id,
parallel_setup, parallel_setup,
distributed_backend, distributed_backend,
...@@ -438,7 +436,6 @@ def test_tp_multimodal_generation( ...@@ -438,7 +436,6 @@ def test_tp_multimodal_generation(
test_options: PPTestOptions, test_options: PPTestOptions,
num_gpus_available, num_gpus_available,
): ):
pytest.skip("Skipping the test until V1 passes it.")
_compare_tp(model_id, _compare_tp(model_id,
parallel_setup, parallel_setup,
distributed_backend, distributed_backend,
......
...@@ -308,13 +308,11 @@ class GraniteModel(nn.Module): ...@@ -308,13 +308,11 @@ class GraniteModel(nn.Module):
hidden_states = inputs_embeds hidden_states = inputs_embeds
else: else:
hidden_states = self.get_input_embeddings(input_ids) hidden_states = self.get_input_embeddings(input_ids)
residual = None
hidden_states *= self.config.embedding_multiplier hidden_states *= self.config.embedding_multiplier
else: else:
assert intermediate_tensors is not None assert intermediate_tensors is not None
hidden_states = intermediate_tensors["hidden_states"] hidden_states = intermediate_tensors["hidden_states"]
residual = intermediate_tensors["residual"]
for layer in islice(self.layers, self.start_layer, self.end_layer): for layer in islice(self.layers, self.start_layer, self.end_layer):
hidden_states = layer(positions, hidden_states) hidden_states = layer(positions, hidden_states)
...@@ -322,7 +320,6 @@ class GraniteModel(nn.Module): ...@@ -322,7 +320,6 @@ class GraniteModel(nn.Module):
if not get_pp_group().is_last_rank: if not get_pp_group().is_last_rank:
return IntermediateTensors({ return IntermediateTensors({
"hidden_states": hidden_states, "hidden_states": hidden_states,
"residual": residual
}) })
hidden_states = self.norm(hidden_states) hidden_states = self.norm(hidden_states)
...@@ -475,10 +472,6 @@ class GraniteForCausalLM(nn.Module, SupportsLoRA, SupportsPP): ...@@ -475,10 +472,6 @@ class GraniteForCausalLM(nn.Module, SupportsLoRA, SupportsPP):
torch.zeros((batch_size, self.config.hidden_size), torch.zeros((batch_size, self.config.hidden_size),
dtype=dtype, dtype=dtype,
device=device), device=device),
"residual":
torch.zeros((batch_size, self.config.hidden_size),
dtype=dtype,
device=device),
}) })
def load_weights(self, weights: Iterable[tuple[str, def load_weights(self, weights: Iterable[tuple[str,
......
...@@ -298,17 +298,14 @@ class GraniteMoeModel(nn.Module): ...@@ -298,17 +298,14 @@ class GraniteMoeModel(nn.Module):
else: else:
hidden_states = self.get_input_embeddings(input_ids) hidden_states = self.get_input_embeddings(input_ids)
hidden_states *= self.embedding_multiplier hidden_states *= self.embedding_multiplier
residual = None
else: else:
assert intermediate_tensors is not None assert intermediate_tensors is not None
hidden_states = intermediate_tensors["hidden_states"] hidden_states = intermediate_tensors["hidden_states"]
residual = intermediate_tensors["residual"]
for layer in islice(self.layers, self.start_layer, self.end_layer): for layer in islice(self.layers, self.start_layer, self.end_layer):
hidden_states = layer(positions, hidden_states) hidden_states = layer(positions, hidden_states)
if not get_pp_group().is_last_rank: if not get_pp_group().is_last_rank:
return IntermediateTensors({ return IntermediateTensors({
"hidden_states": hidden_states, "hidden_states": hidden_states,
"residual": residual
}) })
hidden_states = self.norm(hidden_states) hidden_states = self.norm(hidden_states)
return hidden_states return hidden_states
...@@ -523,10 +520,6 @@ class GraniteMoeForCausalLM(nn.Module, SupportsLoRA, SupportsPP): ...@@ -523,10 +520,6 @@ class GraniteMoeForCausalLM(nn.Module, SupportsLoRA, SupportsPP):
torch.zeros((batch_size, self.config.hidden_size), torch.zeros((batch_size, self.config.hidden_size),
dtype=dtype, dtype=dtype,
device=device), device=device),
"residual":
torch.zeros((batch_size, self.config.hidden_size),
dtype=dtype,
device=device),
}) })
def load_weights(self, weights: Iterable[tuple[str, def load_weights(self, weights: Iterable[tuple[str,
......
...@@ -195,17 +195,14 @@ class GraniteMoeSharedModel(nn.Module): ...@@ -195,17 +195,14 @@ class GraniteMoeSharedModel(nn.Module):
else: else:
hidden_states = self.get_input_embeddings(input_ids) hidden_states = self.get_input_embeddings(input_ids)
hidden_states *= self.embedding_multiplier hidden_states *= self.embedding_multiplier
residual = None
else: else:
assert intermediate_tensors is not None assert intermediate_tensors is not None
hidden_states = intermediate_tensors["hidden_states"] hidden_states = intermediate_tensors["hidden_states"]
residual = intermediate_tensors["residual"]
for layer in islice(self.layers, self.start_layer, self.end_layer): for layer in islice(self.layers, self.start_layer, self.end_layer):
hidden_states = layer(positions, hidden_states) hidden_states = layer(positions, hidden_states)
if not get_pp_group().is_last_rank: if not get_pp_group().is_last_rank:
return IntermediateTensors({ return IntermediateTensors({
"hidden_states": hidden_states, "hidden_states": hidden_states,
"residual": residual
}) })
hidden_states = self.norm(hidden_states) hidden_states = self.norm(hidden_states)
return hidden_states return hidden_states
...@@ -323,10 +320,6 @@ class GraniteMoeSharedForCausalLM(nn.Module, SupportsLoRA, SupportsPP): ...@@ -323,10 +320,6 @@ class GraniteMoeSharedForCausalLM(nn.Module, SupportsLoRA, SupportsPP):
torch.zeros((batch_size, self.config.hidden_size), torch.zeros((batch_size, self.config.hidden_size),
dtype=dtype, dtype=dtype,
device=device), device=device),
"residual":
torch.zeros((batch_size, self.config.hidden_size),
dtype=dtype,
device=device),
}) })
def load_weights(self, weights: Iterable[tuple[str, def load_weights(self, weights: Iterable[tuple[str,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment