Skip to content

Fix some potential bugs#168

Merged
tastelikefeet merged 3 commits intomodelscope:mainfrom
tastelikefeet:fix/0418-3
Apr 18, 2026
Merged

Fix some potential bugs#168
tastelikefeet merged 3 commits intomodelscope:mainfrom
tastelikefeet:fix/0418-3

Conversation

@tastelikefeet
Copy link
Copy Markdown
Collaborator

(cherry picked from commit 4a51f5a)

PR type

  • Bug Fix
  • New Feature
  • Document Updates
  • More Models or Datasets Support

PR information

Write the detail information belongs to this PR.

Experiment results

Paste your experiment result here(if needed).

(cherry picked from commit 4a51f5a)
Copy link
Copy Markdown
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 introduces input validation for sampling parameters, modifies the retry sampler to return instead of raising exceptions, and adds a try-finally block for resource cleanup in the vLLM engine. Feedback suggests that the change in the retry sampler could lead to deadlocks in distributed training and should be reverted. Additionally, the cleanup logic in the vLLM engine should be expanded to cover all resource allocations to prevent potential leaks.

Comment thread src/twinkle/dataloader/retry_sampler.py Outdated
Comment thread src/twinkle/sampler/vllm_sampler/vllm_engine.py Outdated
@tastelikefeet
Copy link
Copy Markdown
Collaborator Author

/gemini review

Copy link
Copy Markdown
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 introduces validation logic for sampling parameters and enhances resource management in the VLLM engine by wrapping weight streaming in a try-finally block. Feedback focuses on improving the robustness of these changes: specifically, handling NaN values in parameter validation, ensuring background tasks are explicitly cancelled during cleanup to prevent deadlocks, and expanding the try block to encompass all resource allocations to avoid potential leaks if initialization fails.

Comment thread src/twinkle/sampler/vllm_sampler/vllm_engine.py
Comment thread src/twinkle/data_format/sampling.py
Comment thread src/twinkle/data_format/sampling.py
Comment thread src/twinkle/sampler/vllm_sampler/vllm_engine.py
@tastelikefeet tastelikefeet merged commit 7cc7d45 into modelscope:main Apr 18, 2026
1 of 3 checks passed
tastelikefeet added a commit that referenced this pull request Apr 18, 2026
(cherry picked from commit 7cc7d45)
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