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

[Feature] Set outlines and xgrammar as addtional dependency #2549

Open
2 tasks done
zhaochenyang20 opened this issue Dec 23, 2024 · 3 comments
Open
2 tasks done

[Feature] Set outlines and xgrammar as addtional dependency #2549

zhaochenyang20 opened this issue Dec 23, 2024 · 3 comments
Assignees
Labels
enhancement New feature or request grammar-backend

Comments

@zhaochenyang20
Copy link
Collaborator

Checklist

Motivation

I am trying to integrate SGLang and vllm into OpenRLHF. For the grammar backend, could we set it as additional requirements, i.e. import it when we use it? Like:

def __init__():
    if use_constrained_decoding:
        if grammar_backend == "xgrammar":
            import xgrammar
            xgrammar.function()
        if grammar_backend == "outlines":
            import outlines
            outlines.function()

This to avoid the version conflicts with vllm.

Related resources

No such.

@zhaochenyang20 zhaochenyang20 self-assigned this Dec 23, 2024
@zhaochenyang20
Copy link
Collaborator Author

ImportError: cannot import name 'build_regex_from_schema' from 'outlines.fsm.json_schema' (/opt/dlami/nvme/chenyang/miniconda3/envs/sglang/lib/python3.11/site-packages/outlines/fsm/json_schema.py)

0.1.11 outlines with sglang.

@zhaochenyang20
Copy link
Collaborator Author

zhaochenyang20 commented Dec 23, 2024

related to #2550

@shuaills
Copy link
Contributor

Currently, there is a compatibility issue when using vllm, sglang, and outlines together. While sglang and vllm 0.6.3.post1 work with torch 2.4, newer versions of vllm (0.6.4+) require torch 2.5. Additionally, outlines has version-specific dependencies that conflict with this setup, making it challenging to use all three libraries simultaneously in the same environment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request grammar-backend
Projects
None yet
Development

No branches or pull requests

2 participants