-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
[FlashInfer] Upgrade to 0.2.0 #11194
base: main
Are you sure you want to change the base?
Conversation
👋 Hi! Thank you for contributing to the vLLM project. Once the PR is approved and ready to go, your PR reviewer(s) can run CI to test the changes comprehensively before merging. To run CI, PR reviewers can do one of these:
🚀 |
Signed-off-by: Bowen Wang <[email protected]>
b739c11
to
269f965
Compare
Looking forward to the update! |
Signed-off-by: Bowen Wang <[email protected]>
Signed-off-by: Bowen Wang <[email protected]>
Signed-off-by: Bowen Wang <[email protected]>
Signed-off-by: Bowen Wang <[email protected]>
Signed-off-by: Bowen Wang <[email protected]>
Signed-off-by: Bowen Wang <[email protected]>
Signed-off-by: Bowen Wang <[email protected]>
… instance Signed-off-by: Bowen Wang <[email protected]>
Signed-off-by: Bowen Wang <[email protected]>
sm_scale: float | ||
|
||
|
||
def infer_global_hyperparameters(model: nn.Module) -> GlobalHyperparameters: |
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.
this function can collect all per_layer_parameter
, and only assert the results are the same.
@@ -495,6 +597,8 @@ def __init__(self, input_builder: "ModelInputForGPUBuilder"): | |||
self.sliding_window = input_builder.sliding_window | |||
self.block_size = input_builder.block_size |
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.
you can remember the vllm_config here by calling get_current_vllm_config()
# - `window_left` | ||
# - `logits_soft_cap` | ||
# - `sm_scale` | ||
model = self.runner.model |
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.
vllm_config.compilation_config.static_forward_context
is a dict of layer prefix to attention layer. you can collect sliding window, etc. from there. no need to iterate over model's submodule.
Signed-off-by: Bowen Wang <[email protected]>
@@ -178,6 +179,9 @@ def __init__(self, runner): | |||
self._decode_wrapper = None | |||
self._prefill_wrapper = None | |||
|
|||
# Global hyperparameters shared by all attention layers | |||
self.global_hyperparameters: Optional[PerLayerParameters] = None |
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.
remember the vllm_config
here?
vllm/worker/model_runner.py
Outdated
with set_current_vllm_config(self.vllm_config): | ||
# To make vLLM config available during | ||
# worker initialization | ||
attn_metadata = (self.attn_state. | ||
graph_capture_get_metadata_for_batch( | ||
batch_size, | ||
is_encoder_decoder_model=self. | ||
model_config.is_encoder_decoder, | ||
)) |
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.
then we don't need this change.
also need to update this line to pass the ci: Line 200 in f0ef372
|
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.
LGTM, thanks for the contribution!
Signed-off-by: Bowen Wang <[email protected]>
Signed-off-by: Bowen Wang <[email protected]>
Signed-off-by: Bowen Wang <[email protected]>
Signed-off-by: Bowen Wang <[email protected]>
Signed-off-by: youkaichao <[email protected]>
…o flashinfer-0.2 Signed-off-by: Bowen Wang <[email protected]>
Signed-off-by: Bowen Wang <[email protected]>
Signed-off-by: Bowen Wang <[email protected]>
Signed-off-by: Bowen Wang <[email protected]>
Signed-off-by: Bowen Wang <[email protected]>
Signed-off-by: Bowen Wang <[email protected]>
Signed-off-by: youkaichao <[email protected]>
Signed-off-by: youkaichao <[email protected]>
Signed-off-by: youkaichao <[email protected]>
Signed-off-by: youkaichao <[email protected]>
Signed-off-by: youkaichao <[email protected]>
Dockerfile
Outdated
# RUN --mount=type=cache,target=/root/.cache/pip \ | ||
# . /etc/environment && \ | ||
# if [ "$TARGETPLATFORM" != "linux/arm64" ]; then \ | ||
# python3 -m pip install https://github.com/flashinfer-ai/flashinfer/releases/download/v0.2.0.post1/flashinfer-0.2.0.post1+cu121torch2.4-cp${PYTHON_VERSION_STR}-cp${PYTHON_VERSION_STR}-linux_x86_64.whl; \ | ||
# fi |
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.
delete prior to landing?
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.
commented in bb44221 . we might need it soon, so I just comment it out right now.
Signed-off-by: youkaichao <[email protected]>
Signed-off-by: youkaichao <[email protected]>
Signed-off-by: Bowen Wang <[email protected]>
Signed-off-by: Bowen Wang <[email protected]>
Signed-off-by: Bowen Wang <[email protected]>
Signed-off-by: youkaichao <[email protected]>
This PR upgrades the FlashInfer attention backend to v0.2.0.