Misc fix for min_p_sampling, --cuda-graph-bs (#2761)
This commit is contained in:
@@ -117,6 +117,11 @@ class LogitsProcessor(nn.Module):
|
||||
self.final_logit_softcapping = getattr(
|
||||
self.config, "final_logit_softcapping", None
|
||||
)
|
||||
if (
|
||||
self.final_logit_softcapping is not None
|
||||
and self.final_logit_softcapping < 0
|
||||
):
|
||||
self.final_logit_softcapping = None
|
||||
|
||||
def forward(
|
||||
self,
|
||||
|
||||
@@ -1011,11 +1011,22 @@ def fused_experts_impl(
|
||||
out_hidden_states[begin_chunk_idx:end_chunk_idx],
|
||||
)
|
||||
else:
|
||||
torch.sum(
|
||||
intermediate_cache3.view(*intermediate_cache3.shape),
|
||||
dim=1,
|
||||
out=out_hidden_states[begin_chunk_idx:end_chunk_idx],
|
||||
)
|
||||
if topk_ids.shape[1] == 1:
|
||||
out_hidden_states[begin_chunk_idx:end_chunk_idx].copy_(
|
||||
intermediate_cache3[:, 0]
|
||||
)
|
||||
elif topk_ids.shape[1] == 2:
|
||||
torch.add(
|
||||
intermediate_cache3[:, 0],
|
||||
intermediate_cache3[:, 1],
|
||||
out=out_hidden_states[begin_chunk_idx:end_chunk_idx],
|
||||
).squeeze(dim=1)
|
||||
elif topk_ids.shape[1] > 2:
|
||||
torch.sum(
|
||||
intermediate_cache3.view(*intermediate_cache3.shape),
|
||||
dim=1,
|
||||
out=out_hidden_states[begin_chunk_idx:end_chunk_idx],
|
||||
)
|
||||
|
||||
return out_hidden_states
|
||||
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
# Adapted from https://raw.githubusercontent.com/vllm-project/vllm/v0.5.5/vllm/model_executor/layers/quantization/__init__.py
|
||||
|
||||
from typing import Callable, Dict, Optional, Type
|
||||
from typing import Dict, Type
|
||||
|
||||
import torch
|
||||
from vllm.model_executor.layers.quantization.aqlm import AQLMConfig
|
||||
from vllm.model_executor.layers.quantization.awq import AWQConfig
|
||||
from vllm.model_executor.layers.quantization.awq_marlin import AWQMarlinConfig
|
||||
|
||||
Reference in New Issue
Block a user