Skip to content

Conversation

@DarkLight1337
Copy link
Member

@DarkLight1337 DarkLight1337 commented Oct 27, 2025

Purpose

Part of #26900

  • vllm.utils.init_cached_hf_modules -> vllm.utils.import_utils.init_cached_hf_modules
  • vllm.utils.import_pynvml -> vllm.utils.import_utils.import_pynvml
  • vllm.utils.get_mp_context -> vllm.utils.system_utils.get_mp_context
  • vllm.utils.kill_process_tree -> vllm.utils.system_utils.kill_process_tree
  • vllm.utils.set_ulimit -> vllm.utils.system_utils.set_ulimit
  • vllm.utils.run_method -> vllm.v1.serial_utils.run_method
  • vllm.utils.check_use_alibi -> ModelConfig.uses_alibi
  • vllm.utils.enable_trace_function_call_for_thread -> VllmConfig.enable_trace_function_call_for_thread
  • vllm.utils.argparse_utils.StoreBoolean is no longer used so I removed it

Test Plan

Test Result


Essential Elements of an Effective PR Description Checklist
  • The purpose of the PR, such as "Fix some issue (link existing issues this PR will resolve)".
  • The test plan, such as providing test command.
  • The test results, such as pasting the results comparison before and after, or e2e results
  • (Optional) The necessary documentation update, such as updating supported_models.md and examples for a new model.
  • (Optional) Release notes update. If your change is user facing, please update the release notes draft in the Google Doc.

Signed-off-by: DarkLight1337 <[email protected]>
@DarkLight1337 DarkLight1337 added the ready ONLY add when PR is ready to merge/full CI is needed label Oct 27, 2025
@mergify mergify bot added frontend v1 tpu Related to Google TPUs labels Oct 27, 2025
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request focuses on cleaning up and reorganizing utility functions within the vLLM project. It involves moving functions from vllm.utils to more specific submodules like vllm.utils.import_utils and vllm.utils.system_utils, removing unused code, and making minor adjustments to improve code clarity and maintainability. I have identified a critical issue where a function is being moved without updating its call site within the same file. This needs to be addressed to ensure the code functions correctly after the changes.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

if vllm_config.model_config is not None:
# it can be None in tests
trust_remote_code = vllm_config.model_config.trust_remote_code
if trust_remote_code:
# note: lazy import to avoid importing torch before initializing
from vllm.utils import init_cached_hf_modules
init_cached_hf_modules()

P1 Badge Update init_cached_hf_modules import in worker wrapper

When trust_remote_code is enabled, the worker wrapper lazily executes from vllm.utils import init_cached_hf_modules. This helper was moved into vllm.utils.import_utils and is no longer exported from vllm.utils, so the import now raises ImportError and remote-code initialization fails. The lazy import should target the new module that defines init_cached_hf_modules.

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Signed-off-by: DarkLight1337 <[email protected]>
Signed-off-by: DarkLight1337 <[email protected]>
Signed-off-by: DarkLight1337 <[email protected]>
Signed-off-by: DarkLight1337 <[email protected]>
Signed-off-by: DarkLight1337 <[email protected]>
Signed-off-by: DarkLight1337 <[email protected]>
@mergify mergify bot added the ci/build label Oct 27, 2025
# Required for argparse hook only
-f https://download.pytorch.org/whl/cpu
cachetools
cloudpickle
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Strange that organising the utils would cause this to be required, is the mocking not working properly for this one?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Model executor (imported by docs) now imports serial_utils which in turn imports cloudpickle.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, these are relatively cheap to install, so it's not a big problem.

It'd be nice to figure out how to remove them in future.

Signed-off-by: DarkLight1337 <[email protected]>
@DarkLight1337 DarkLight1337 enabled auto-merge (squash) October 27, 2025 12:03
Signed-off-by: DarkLight1337 <[email protected]>
@DarkLight1337 DarkLight1337 merged commit 6ebffaf into vllm-project:main Oct 27, 2025
51 checks passed
@DarkLight1337 DarkLight1337 deleted the cleanup-utils branch October 27, 2025 15:30
ilmarkov pushed a commit to neuralmagic/vllm that referenced this pull request Nov 7, 2025
ZhengHongming888 pushed a commit to ZhengHongming888/vllm that referenced this pull request Nov 8, 2025
rtourgeman pushed a commit to rtourgeman/vllm that referenced this pull request Nov 10, 2025
wangxiyuan pushed a commit to vllm-project/vllm-ascend that referenced this pull request Nov 12, 2025
### What this PR does / why we need it?
adapt vllm-ascend main branch with vllm releases/v0.11.1

fix `forward context not set` in test_vlm.py caused by:
vllm-project/vllm#23207

fix import `cdiv round` failed caused by:
vllm-project/vllm#27188

fix import `init_cached_hf_modules` failed caused by:
vllm-project/vllm#27567

adapt triton kernel `fused_recurrent_gated_delta_rule_fwd_kernel` caused
by: vllm-project/vllm#27654
- remove unused code in sigmoid_gating.py
- `class FusedRecurrentFunction` , `fused_recurrent_gated_delta_rule`,
`fused_recurrent_gated_delta_rule_fwd`

### Does this PR introduce _any_ user-facing change?
No

### How was this patch tested?
CI 


- vLLM version: v0.11.0
- vLLM main:
vllm-project/vllm@83f478b

Signed-off-by: 22dimensions <[email protected]>
luolun pushed a commit to luolun/vllm-ascend that referenced this pull request Nov 19, 2025
### What this PR does / why we need it?
adapt vllm-ascend main branch with vllm releases/v0.11.1

fix `forward context not set` in test_vlm.py caused by:
vllm-project/vllm#23207

fix import `cdiv round` failed caused by:
vllm-project/vllm#27188

fix import `init_cached_hf_modules` failed caused by:
vllm-project/vllm#27567

adapt triton kernel `fused_recurrent_gated_delta_rule_fwd_kernel` caused
by: vllm-project/vllm#27654
- remove unused code in sigmoid_gating.py
- `class FusedRecurrentFunction` , `fused_recurrent_gated_delta_rule`,
`fused_recurrent_gated_delta_rule_fwd`

### Does this PR introduce _any_ user-facing change?
No

### How was this patch tested?
CI 


- vLLM version: v0.11.0
- vLLM main:
vllm-project/vllm@83f478b

Signed-off-by: 22dimensions <[email protected]>
Signed-off-by: luolun <[email protected]>
hwhaokun pushed a commit to hwhaokun/vllm-ascend that referenced this pull request Nov 19, 2025
### What this PR does / why we need it?
adapt vllm-ascend main branch with vllm releases/v0.11.1

fix `forward context not set` in test_vlm.py caused by:
vllm-project/vllm#23207

fix import `cdiv round` failed caused by:
vllm-project/vllm#27188

fix import `init_cached_hf_modules` failed caused by:
vllm-project/vllm#27567

adapt triton kernel `fused_recurrent_gated_delta_rule_fwd_kernel` caused
by: vllm-project/vllm#27654
- remove unused code in sigmoid_gating.py
- `class FusedRecurrentFunction` , `fused_recurrent_gated_delta_rule`,
`fused_recurrent_gated_delta_rule_fwd`

### Does this PR introduce _any_ user-facing change?
No

### How was this patch tested?
CI

- vLLM version: v0.11.0
- vLLM main:
vllm-project/vllm@83f478b

Signed-off-by: 22dimensions <[email protected]>
Signed-off-by: hwhaokun <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci/build frontend ready ONLY add when PR is ready to merge/full CI is needed tpu Related to Google TPUs v1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants