Skip to content

Commit 05e5846

Browse files
committed
pre-commit
1 parent ffeb18f commit 05e5846

File tree

2 files changed

+16
-7
lines changed

2 files changed

+16
-7
lines changed

src/parallax/server/executor.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,6 @@ def _prepare_cuda_decode_batch(self, batched_requests: List[Request]) -> Dict[st
648648

649649
# Concatenate along sequence dimension to get (total_tokens, hidden_size)
650650
hidden_states = torch.cat(hidden_states_list, dim=0)
651-
pp_proxy_initial_tokens = hidden_states.shape[0]
652651

653652
# Create residual tensor with same shape
654653
residual = torch.zeros(

src/parallax/vllm/monkey_patch_utils/weight_loader.py

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ def set_vllm_pipeline_stage(is_first_stage: bool, is_last_stage: bool):
1818
global _is_first_stage, _is_last_stage
1919
_is_first_stage = is_first_stage
2020
_is_last_stage = is_last_stage
21-
logger.debug(f"Set vLLM pipeline stage: is_first_stage={_is_first_stage}, is_last_stage={_is_last_stage}")
21+
logger.debug(
22+
f"Set vLLM pipeline stage: is_first_stage={_is_first_stage}, is_last_stage={_is_last_stage}"
23+
)
2224

2325

2426
def apply_vllm_weight_loader_patch():
@@ -55,22 +57,30 @@ def patched_load_weights(self, model: Any, model_config: Any):
5557
if "model.embed_tokens.weight" in error_msg and uninitialized_weights:
5658
if not _is_first_stage:
5759
# Expected behavior for non-first pipeline stages
58-
logger.info("Skipping embed_tokens.weight initialization check on non-first pipeline stage")
60+
logger.info(
61+
"Skipping embed_tokens.weight initialization check on non-first pipeline stage"
62+
)
5963
else:
6064
# This is the first stage, embed_tokens should be initialized
61-
logger.error("embed_tokens.weight not initialized on first pipeline stage, this is an error")
65+
logger.error(
66+
"embed_tokens.weight not initialized on first pipeline stage, this is an error"
67+
)
6268
raise
6369

6470
# Case 2: lm_head.weight not found
6571
elif "lm_head.weight" in error_msg and uninitialized_weights:
6672
if not _is_last_stage:
6773
# Expected behavior for non-last pipeline stages
68-
logger.info("Skipping lm_head.weight initialization check on non-last pipeline stage")
74+
logger.info(
75+
"Skipping lm_head.weight initialization check on non-last pipeline stage"
76+
)
6977
else:
7078
# This is the last stage, lm_head should be initialized
71-
logger.error("lm_head.weight not initialized on last pipeline stage, this is an error")
79+
logger.error(
80+
"lm_head.weight not initialized on last pipeline stage, this is an error"
81+
)
7282
raise
73-
83+
7484
# Case 3: Other errors
7585
else:
7686
# Different error, re-raise

0 commit comments

Comments
 (0)