-
-
Notifications
You must be signed in to change notification settings - Fork 10.3k
[Docs] Fix warnings in mkdocs build
#23649
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
ee34fb6
docs: type hints of lightning_attn
Zerohertz 4e192ab
docs: deprecated kwargs and type hints in linear layer
Zerohertz 227ac57
docs: type hint in lightning_attn
Zerohertz e75b327
docs: docstring in differential_flash_attn
Zerohertz f1ebf42
docs: type hint in async_llm_engine
Zerohertz c697ce4
docs: docstring in xformers
Zerohertz 94261d8
docs: docstring indent in backend utils
Zerohertz 581a89d
docs: type hint in entrypoints llm
Zerohertz bd10f66
fix: import typing.Optional
Zerohertz 7aa2dcb
docs: docstring and type hint in backends flash_attn
Zerohertz 8ffeccf
docs: docstring in rocm_flash_attn
Zerohertz 31974c9
fix: kwargs type hints (object -> Any, for CI)
Zerohertz 1b35fbb
docs: docstring in sequence
Zerohertz 7d710fb
docs: type hint in minimax_tool_parser
Zerohertz cfdeb48
docs: docstring indent in outputs
Zerohertz 0af1e1c
docs: cross-references in api index
Zerohertz a3743e9
docs: docstring in block_manager
Zerohertz 6d4b1a7
`object` -> `Any`
hmellor 87058c2
Move private attr docstrings to public property methods
hmellor db59d4d
Merge branch 'main' into docs/mkdocs-warnings
hmellor File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -147,18 +147,7 @@ class SequenceDataDelta( | |
|
||
class SequenceData(msgspec.Struct, | ||
omit_defaults=True): # type: ignore[call-arg] | ||
"""Data associated with a sequence. | ||
|
||
Args: | ||
prompt_token_ids: The token IDs of the prompt. | ||
output_token_ids: The token IDs of the output. Set to an empty list if | ||
None. | ||
|
||
Attributes: | ||
prompt_token_ids: The token IDs of the prompt. | ||
output_token_ids: The token IDs of the output. | ||
cumulative_logprob: The cumulative log probability of the output. | ||
Comment on lines
-158
to
-160
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I moved these to their respective |
||
""" | ||
"""Data associated with a sequence.""" | ||
# NOTE: we cannot use Union[list, array] because msgspec cannot support | ||
# union of 2 list types. | ||
_prompt_token_ids: array | ||
|
@@ -256,10 +245,12 @@ def _update_cached_all_token_embeds(self): | |
|
||
@property | ||
def cumulative_logprob(self) -> float: | ||
"""The cumulative log probability of the output.""" | ||
return self._cumulative_logprob | ||
|
||
@property | ||
def prompt_token_ids(self) -> tuple[int, ...]: | ||
"""The token IDs of the prompt.""" | ||
return self._prompt_token_ids_tuple | ||
|
||
@prompt_token_ids.setter | ||
|
@@ -277,6 +268,7 @@ def prompt_token_ids_array(self) -> array: | |
|
||
@property | ||
def output_token_ids(self) -> tuple[int, ...]: | ||
"""The token IDs of the output.""" | ||
return tuple(self._output_token_ids) | ||
|
||
@output_token_ids.setter | ||
|
@@ -940,7 +932,7 @@ class SequenceGroupMetadata( | |
omit_defaults=True): # type: ignore[call-arg] | ||
"""Metadata for a sequence group. Used to create `AttentionMetadata`. | ||
|
||
Args: | ||
Attributes: | ||
request_id: The ID of the request. | ||
is_prompt: Whether the request is at prompt stage. | ||
seq_data: The sequence data. (Seq id -> sequence data) | ||
|
@@ -950,14 +942,14 @@ class SequenceGroupMetadata( | |
do_sample: True if sampling is required. Sampling is not required when | ||
e.g., prefill is chunked, and the current iteration only computes | ||
query tokens for prefill, we don't need sampling. | ||
token_chunk_size: The number of tokens to be processed (per sequence). | ||
None if chunking is not required. | ||
pooling_params: Pooling parameters. | ||
lora_request: LoRA request. | ||
computed_block_nums: The block numbers that are already computed, | ||
used in prefix caching. | ||
state: Internal state tied to this sequence group. | ||
token_type_ids: Token type IDs. | ||
multi_modal_data: Multi modal data. | ||
mm_processor_kwargs: Multimodal input processor / mapper overrides. | ||
multi_modal_placeholders: Multi modal placeholders. | ||
encoder_seq_data: Optional sequence data for encoder prompt | ||
(SequenceGroup.encoder_seq). Should be None | ||
unless you are working with an encoder/decoder | ||
|
@@ -1043,12 +1035,13 @@ class SequenceOutput( | |
array_like=True): # type: ignore[call-arg] | ||
"""The model output associated with a sequence. | ||
|
||
Args: | ||
Attributes: | ||
parent_seq_id: The ID of the parent sequence (for forking in beam | ||
search). | ||
output_token: The output token ID. | ||
logprobs: The logprobs of the output token. | ||
(Token id -> logP(x_i+1 | x_0, ..., x_i)) | ||
output_embed: Optional output embedding tensor. | ||
""" | ||
parent_seq_id: int | ||
output_token: int | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I initially used
object
for the**kwargs
type hint, as I had seen it used in most other codes.However, this caused issues with
mypy
, so I changed it toAny
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like you did the right thing. According to https://peps.python.org/pep-0484/#arbitrary-argument-lists-and-default-argument-values you should type hint the type of the expected values of the contents of
**kwargs
. Since we use**kwargs
to pass arbitrary keyword arguments,Any
is an apprioriate choice.