[Docs] Replace rst style double-backtick with md single-backtick (#27091)
Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
This commit is contained in:
@@ -27,7 +27,7 @@ __all__ = [
|
||||
|
||||
|
||||
def is_flashinfer_fp4_cutlass_moe_available() -> bool:
|
||||
"""Return ``True`` when FlashInfer CUTLASS NV-FP4 kernels can be used."""
|
||||
"""Return `True` when FlashInfer CUTLASS NV-FP4 kernels can be used."""
|
||||
return (
|
||||
envs.VLLM_USE_FLASHINFER_MOE_FP4
|
||||
and has_flashinfer_cutlass_fused_moe()
|
||||
|
||||
@@ -887,11 +887,11 @@ def requant_weight_ue8m0_inplace(
|
||||
UE8M0 (power-of-two) format expected by the new DeepGEMM kernels inplace.
|
||||
|
||||
Args:
|
||||
weight: Block-quantised weight tensor stored in ``torch.float8_e4m3fn``.
|
||||
Expected shape ``(..., M, K)``.
|
||||
weight_scale: Corresponding per-block scale tensor (``torch.float32``)
|
||||
with shape ``(..., M // block_size[0], K // block_size[1])``.
|
||||
block_size: 2-element iterable ``[block_m, block_k]`` describing the
|
||||
weight: Block-quantised weight tensor stored in `torch.float8_e4m3fn`.
|
||||
Expected shape `(..., M, K)`.
|
||||
weight_scale: Corresponding per-block scale tensor (`torch.float32`)
|
||||
with shape `(..., M // block_size[0], K // block_size[1])`.
|
||||
block_size: 2-element iterable `[block_m, block_k]` describing the
|
||||
block quantisation granularity.
|
||||
"""
|
||||
if weight.numel() == 0:
|
||||
|
||||
@@ -64,7 +64,7 @@ from .utils import (
|
||||
class OlmoAttention(nn.Module):
|
||||
"""
|
||||
This is the attention block where the output is computed as
|
||||
``Attention(LN(x))`` in ``MLP(LN(x + Attention(LN(x))))``
|
||||
`Attention(LN(x))` in `MLP(LN(x + Attention(LN(x))))`
|
||||
(plus another skip connection).
|
||||
"""
|
||||
|
||||
@@ -144,7 +144,7 @@ class OlmoAttention(nn.Module):
|
||||
class OlmoMLP(nn.Module):
|
||||
"""
|
||||
This is the MLP block where the output is computed as
|
||||
``MLP(LN(x))`` in ``MLP(LN(x + Attention(LN(x))))``
|
||||
`MLP(LN(x))` in `MLP(LN(x + Attention(LN(x))))`
|
||||
(plus another skip connection).
|
||||
"""
|
||||
|
||||
@@ -193,7 +193,7 @@ class OlmoMLP(nn.Module):
|
||||
class OlmoDecoderLayer(nn.Module):
|
||||
"""
|
||||
This is a typical transformer block where the output is
|
||||
computed as ``MLP(LN(x + Attention(LN(x))))``
|
||||
computed as `MLP(LN(x + Attention(LN(x))))`
|
||||
(plus another skip connection).
|
||||
"""
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ from vllm.transformers_utils.configs import Olmo3Config
|
||||
class Olmo2Attention(nn.Module):
|
||||
"""
|
||||
This is the attention block where the output is computed as
|
||||
``Attention(LN(x))`` in ``MLP(LN(x + Attention(LN(x))))``
|
||||
`Attention(LN(x))` in `MLP(LN(x + Attention(LN(x))))`
|
||||
(plus another skip connection).
|
||||
"""
|
||||
|
||||
@@ -190,7 +190,7 @@ class Olmo2Attention(nn.Module):
|
||||
class Olmo2MLP(nn.Module):
|
||||
"""
|
||||
This is the MLP block where the output is computed as
|
||||
``MLP(x)`` in ``LN(MLP(x + LN(Attention(x))))``
|
||||
`MLP(x)` in `LN(MLP(x + LN(Attention(x))))`
|
||||
(plus another skip connection).
|
||||
"""
|
||||
|
||||
@@ -235,7 +235,7 @@ class Olmo2MLP(nn.Module):
|
||||
class Olmo2DecoderLayer(nn.Module):
|
||||
"""
|
||||
This is a typical transformer block where the output is
|
||||
computed as ``MLP(LN(x + Attention(LN(x))))``
|
||||
computed as `MLP(LN(x + Attention(LN(x))))`
|
||||
(plus another skip connection).
|
||||
"""
|
||||
|
||||
|
||||
@@ -166,7 +166,7 @@ class VisualTokenizer(torch.nn.Module):
|
||||
# e.g., for hidden_stride=2, this leads to a token length reduction:
|
||||
# 1024 -> 256 for aimv2
|
||||
if self.config.hidden_stride > 1:
|
||||
# this `d` maybe different from the above `d``
|
||||
# this `d` maybe different from the above `d`
|
||||
n, L, d = features.shape
|
||||
sqrt_l = int(L**0.5)
|
||||
assert sqrt_l**2 == L, (
|
||||
|
||||
@@ -99,13 +99,13 @@ class AutoWeightsLoader:
|
||||
the weights only once.
|
||||
|
||||
The weight loading logic for individual modules can be overridden
|
||||
by defining a ``load_weights`` method.
|
||||
by defining a `load_weights` method.
|
||||
|
||||
Similarly, the weight loading logic for individual parameters can be
|
||||
overridden by defining a ``weight_loader`` method.
|
||||
overridden by defining a `weight_loader` method.
|
||||
|
||||
Detailed weight loading information can be viewed by setting the
|
||||
environment variable ``VLLM_LOGGING_LEVEL=DEBUG``.
|
||||
environment variable `VLLM_LOGGING_LEVEL=DEBUG`.
|
||||
"""
|
||||
|
||||
# Models trained using early version ColossalAI
|
||||
@@ -372,9 +372,9 @@ def flatten_bn(
|
||||
concat: bool = False,
|
||||
) -> list[torch.Tensor] | torch.Tensor:
|
||||
"""
|
||||
Flatten the ``B`` and ``N`` dimensions of batched multimodal inputs.
|
||||
Flatten the `B` and `N` dimensions of batched multimodal inputs.
|
||||
|
||||
The input tensor should have shape ``(B, N, ...)```.
|
||||
The input tensor should have shape `(B, N, ...)`.
|
||||
"""
|
||||
if isinstance(x, torch.Tensor):
|
||||
return x.flatten(0, 1)
|
||||
@@ -424,12 +424,12 @@ def _merge_multimodal_embeddings(
|
||||
is_multimodal: torch.Tensor,
|
||||
) -> torch.Tensor:
|
||||
"""
|
||||
Merge ``multimodal_embeddings`` into ``inputs_embeds`` by overwriting the
|
||||
positions in ``inputs_embeds`` corresponding to placeholder tokens in
|
||||
``input_ids``.
|
||||
Merge `multimodal_embeddings` into `inputs_embeds` by overwriting the
|
||||
positions in `inputs_embeds` corresponding to placeholder tokens in
|
||||
`input_ids`.
|
||||
|
||||
Note:
|
||||
This updates ``inputs_embeds`` in place.
|
||||
This updates `inputs_embeds` in place.
|
||||
"""
|
||||
if len(multimodal_embeddings) == 0:
|
||||
return inputs_embeds
|
||||
@@ -475,14 +475,14 @@ def merge_multimodal_embeddings(
|
||||
placeholder_token_id: int | list[int],
|
||||
) -> torch.Tensor:
|
||||
"""
|
||||
Merge ``multimodal_embeddings`` into ``inputs_embeds`` by overwriting the
|
||||
positions in ``inputs_embeds`` corresponding to placeholder tokens in
|
||||
``input_ids``.
|
||||
Merge `multimodal_embeddings` into `inputs_embeds` by overwriting the
|
||||
positions in `inputs_embeds` corresponding to placeholder tokens in
|
||||
`input_ids`.
|
||||
|
||||
``placeholder_token_id`` can be a list of token ids (e.g, token ids
|
||||
`placeholder_token_id` can be a list of token ids (e.g, token ids
|
||||
of img_start, img_break, and img_end tokens) when needed: This means
|
||||
the order of these tokens in the ``input_ids`` MUST MATCH the order of
|
||||
their embeddings in ``multimodal_embeddings`` since we need to
|
||||
the order of these tokens in the `input_ids` MUST MATCH the order of
|
||||
their embeddings in `multimodal_embeddings` since we need to
|
||||
slice-merge instead of individually scattering.
|
||||
|
||||
For example, if input_ids is "TTTTTSIIIBIIIBIIIETTT", where
|
||||
@@ -497,7 +497,7 @@ def merge_multimodal_embeddings(
|
||||
input_ids for a correct embedding merge.
|
||||
|
||||
Note:
|
||||
This updates ``inputs_embeds`` in place.
|
||||
This updates `inputs_embeds` in place.
|
||||
"""
|
||||
if isinstance(placeholder_token_id, list):
|
||||
is_multimodal = isin_list(input_ids, placeholder_token_id)
|
||||
|
||||
@@ -70,7 +70,7 @@ class BasevLLMParameter(Parameter):
|
||||
# NOTE(@ksayers) some models such as mamba_mixer2 override the
|
||||
# weight loader to support custom loading. In the future, model-specific
|
||||
# weight loading should be implemented via Model.load_weights. In the
|
||||
# meantime, support deleting and overriding `weight_loader`` attribute
|
||||
# meantime, support deleting and overriding `weight_loader` attribute
|
||||
if self._weight_loader is None:
|
||||
raise AttributeError(
|
||||
f"{self.__class__.__name__} weight_loader attribute has been deleted"
|
||||
|
||||
Reference in New Issue
Block a user