Skip to content

Fix circle reference which cause tpu_platform failed to import#1251

Merged
mrjunwan-lang merged 2 commits intomainfrom
jun-12-04
Dec 5, 2025
Merged

Fix circle reference which cause tpu_platform failed to import#1251
mrjunwan-lang merged 2 commits intomainfrom
jun-12-04

Conversation

@mrjunwan-lang
Copy link
Copy Markdown
Collaborator

Description

Fix circle reference which cause tpu_platform failed to import.

before the fix:
Traceback (most recent call last):
File "", line 1, in
File "/home/mrjunwan_google_com/tpu-inference/tpu_inference/platforms/init.py", line 2, in
from tpu_inference.platforms.tpu_platform import TpuPlatform
File "/home/mrjunwan_google_com/tpu-inference/tpu_inference/platforms/tpu_platform.py", line 11, in
from vllm.sampling_params import SamplingParams, SamplingType
File "/home/mrjunwan_google_com/vllm/vllm/sampling_params.py", line 15, in
from vllm.logits_process import LogitsProcessor
File "/home/mrjunwan_google_com/vllm/vllm/logits_process.py", line 8, in
from vllm.tokenizers import TokenizerLike
File "/home/mrjunwan_google_com/vllm/vllm/tokenizers/init.py", line 4, in
from .deepseekv32 import DeepseekV32Tokenizer
File "/home/mrjunwan_google_com/vllm/vllm/tokenizers/deepseekv32.py", line 9, in
from .hf import HfTokenizer, TokenizerLike
File "/home/mrjunwan_google_com/vllm/vllm/tokenizers/hf.py", line 10, in
from vllm.transformers_utils.config import get_sentence_transformer_tokenizer_config
File "/home/mrjunwan_google_com/vllm/vllm/transformers_utils/config.py", line 28, in
from vllm.config.utils import getattr_iter
File "/home/mrjunwan_google_com/vllm/vllm/config/init.py", line 17, in
from vllm.config.model import (
File "/home/mrjunwan_google_com/vllm/vllm/config/model.py", line 24, in
from vllm.transformers_utils.config import (
ImportError: cannot import name 'ConfigFormat' from partially initialized module 'vllm.transformers_utils.config' (most likely due to a circular import) (/home/mrjunwan_google_com/vllm/vllm/transformers_utils/config.py)

after the fix:
python examples/offline_inference.py
--model=Qwen/Qwen3-0.6B
--tensor_parallel_size=4
--data_parallel_size=1
--max_model_len=1024
run successfully

@mrjunwan-lang mrjunwan-lang requested review from kyuyeunk and removed request for sixiang-google December 5, 2025 01:12
@github-actions
Copy link
Copy Markdown

github-actions bot commented Dec 5, 2025

Description

Start with a short description of what the PR does and how this is a change from
the past.

The rest of the description includes relevant details and context, examples:

  • why is this change being made,
  • the problem being solved and any relevant context,
  • why this is a good solution,
  • some information about the specific implementation,
  • shortcomings of the solution and possible future improvements.

If the change fixes a bug or a Github issue, please include a link, e.g.,:
FIXES: b/123456
FIXES: #123456

Tests

Please describe how you tested this change, and include any instructions and/or
commands to reproduce.

Checklist

Before submitting this PR, please make sure:

  • I have performed a self-review of my code.
  • I have necessary comments in my code, particularly in hard-to-understand areas.
  • I have made or will make corresponding changes to any relevant documentation.

@mrjunwan-lang mrjunwan-lang requested a review from py4 December 5, 2025 01:12
@mrjunwan-lang mrjunwan-lang merged commit 6f47da6 into main Dec 5, 2025
5 checks passed
@mrjunwan-lang mrjunwan-lang deleted the jun-12-04 branch December 5, 2025 01:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants