Skip to content
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

[misc] Compatibility Issue with Python 3.9 in FSDP Worker for LLaMA Model #268

Merged
merged 1 commit into from
Feb 14, 2025

Conversation

uygnef
Copy link
Contributor

@uygnef uygnef commented Feb 13, 2025

Fix: Compatibility Issue with Python 3.9 in FSDP Worker for LLaMA Model

When running the LLaMA model in the FSDP worker, an ImportError occurs due to the use of the Unpack type from the typing module. This type is only available in Python 3.11 and later, but the current environment uses Python 3.9, which does not support it.

Error Details:

File "/project/Logic-RL-main/verl/models/transformers/llama.py", line 17, in <module>
from typing import Optional, List, Union, Tuple, Unpack, Callable
ImportError: cannot import name 'Unpack' from 'typing' (/opt/miniconda3/envs/verl/lib/python3.9/typing.py)

Solution:
To resolve this issue, I added conditional imports to handle different Python versions. For Python versions lower than 3.11, the code now uses a fallback or alternative approach to avoid relying on Unpack.

@vermouth1992 vermouth1992 merged commit 7346ecf into volcengine:main Feb 14, 2025
12 checks passed
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.

2 participants