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

[Bug]: Outlines json guided decoding #353

Open
puppetm4st3r opened this issue Mar 22, 2024 · 8 comments
Open

[Bug]: Outlines json guided decoding #353

puppetm4st3r opened this issue Mar 22, 2024 · 8 comments
Labels
bug Something isn't working

Comments

@puppetm4st3r
Copy link

puppetm4st3r commented Mar 22, 2024

EDIT: I found the problem, it is described in the last comment

Your current environment

PyTorch version: N/A
Is debug build: N/A
CUDA used to build PyTorch: N/A
ROCM used to build PyTorch: N/A
OS: Ubuntu 22.04.3 LTS (x86_64)
GCC version: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
Clang version: 14.0.0-1ubuntu1.1
CMake version: Could not collect 
Libc version: glibc-2.35
Python version: 3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0] (64-bit runtime)
Python platform: Linux-6.2.0-39-generic-x86_64-with-glibc2.35
Is CUDA available: N/A
CUDA runtime version: Could not collect 
CUDA_MODULE_LOADING set to: N/A
GPU models and configuration: 
GPU 0: NVIDIA GeForce RTX 4090
GPU 1: NVIDIA GeForce RTX 3090

Nvidia driver version: 535.129.03
cuDNN version: Could not collect 
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: N/A
CPU:
Architecture:                       x86_64
CPU op-mode(s):                     32-bit, 64-bit
Address sizes:                      48 bits physical, 48 bits virtual
Byte Order:                         Little Endian
CPU(s):                             24
On-line CPU(s) list:                0-23
Vendor ID:                          AuthenticAMD
Model name:                         AMD Ryzen 9 7900X 12-Core Processor
CPU family:                         25
Model:                              97
Thread(s) per core:                 2
Core(s) per socket:                 12
Socket(s):                          1
Stepping:                           2
Frequency boost:                    enabled
CPU max MHz:                        5650,0972
CPU min MHz:                        3000,0000
BogoMIPS:                           9381.67
Flags:                              fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good amd_lbr_v2 nopl nonstop_tsc cpuid extd_apicid aperfmperf rapl pni pclmulqdq monitor ssse3 fma cx16 sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx f16c rdrand lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt tce topoext perfctr_core perfctr_nb bpext perfctr_llc mwaitx cpb cat_l3 cdp_l3 hw_pstate ssbd mba perfmon_v2 ibrs ibpb stibp vmmcall fsgsbase bmi1 avx2 smep bmi2 erms invpcid cqm rdt_a avx512f avx512dq rdseed adx smap avx512ifma clflushopt clwb avx512cd sha_ni avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local avx512_bf16 clzero irperf xsaveerptr rdpru wbnoinvd cppc arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold avic v_vmsave_vmload vgif x2avic v_spec_ctrl avx512vbmi umip pku ospke avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg avx512_vpopcntdq rdpid overflow_recov succor smca fsrm flush_l1d
Virtualization:                     AMD-V
L1d cache:                          384 KiB (12 instances)
L1i cache:                          384 KiB (12 instances)
L2 cache:                           12 MiB (12 instances)
L3 cache:                           64 MiB (2 instances)
NUMA node(s):                       1
NUMA node0 CPU(s):                  0-23
Vulnerability Gather data sampling: Not affected
Vulnerability Itlb multihit:        Not affected
Vulnerability L1tf:                 Not affected
Vulnerability Mds:                  Not affected
Vulnerability Meltdown:             Not affected
Vulnerability Mmio stale data:      Not affected
Vulnerability Retbleed:             Not affected
Vulnerability Spec rstack overflow: Mitigation; safe RET, no microcode
Vulnerability Spec store bypass:    Mitigation; Speculative Store Bypass disabled via prctl
Vulnerability Spectre v1:           Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2:           Mitigation; Retpolines, IBPB conditional, IBRS_FW, STIBP always-on, RSB filling, PBRSB-eIBRS Not affected
Vulnerability Srbds:                Not affected
Vulnerability Tsx async abort:      Not affected
Versions of relevant libraries:
[pip3] No relevant packages 
[conda] Could not collect ROCM Version: Could not collect 
Aphrodite Version: N/A
Aphrodite Build Flags:
CUDA Archs: Not Set; ROCm: Disabled

🐛 Describe the bug

When trying to generate guided output (with a pydantic json schema) its throws an exception of "/app/aphrodite-engine/.cache/" not found and for some reason the engine has not privileges to create that directory. I entered to the container and created the directory by my self. Tryed again and now got an strange exception of SQLite3

Token indices sequence length is longer than the specified maximum sequence length for this model (2023 > 1024). Running this sequence through the model will result in indexing errors
/usr/local/lib/python3.10/dist-packages/outlines/fsm/fsm.py:35: UserWarning: The `RegexFSM` interface is deprecated and will be removed on 2024-06-01. Please use `RegexGuide` instead.
.....
Have to truncate the stack (its too long to post here)
.....

ERROR:        await app(scope, receive, sender)
ERROR:      File "/usr/local/lib/python3.10/dist-packages/starlette/routing.py",
line 758, in __call__
ERROR:        await self.middleware_stack(scope, receive, send)
ERROR:      File "/usr/local/lib/python3.10/dist-packages/starlette/routing.py",
line 778, in app
ERROR:        await route.handle(scope, receive, send)
ERROR:      File "/usr/local/lib/python3.10/dist-packages/starlette/routing.py",
line 299, in handle
ERROR:        await self.app(scope, receive, send)
ERROR:      File "/usr/local/lib/python3.10/dist-packages/starlette/routing.py",
line 79, in app
ERROR:        await wrap_app_handling_exceptions(app, request)(scope, receive, 
send)
ERROR:      File 
"/usr/local/lib/python3.10/dist-packages/starlette/_exception_handler.py", line 
64, in wrapped_app
ERROR:        raise exc
ERROR:      File 
"/usr/local/lib/python3.10/dist-packages/starlette/_exception_handler.py", line 
53, in wrapped_app
ERROR:        await app(scope, receive, sender)
ERROR:      File "/usr/local/lib/python3.10/dist-packages/starlette/routing.py",
line 74, in app
ERROR:        response = await func(request)
ERROR:      File "/usr/local/lib/python3.10/dist-packages/fastapi/routing.py", 
line 278, in app
ERROR:        raw_response = await run_endpoint_function(
ERROR:      File "/usr/local/lib/python3.10/dist-packages/fastapi/routing.py", 
line 191, in run_endpoint_function
ERROR:        return await dependant.call(**values)
ERROR:      File 
"/app/aphrodite-engine/aphrodite/endpoints/openai/api_server.py", line 265, in 
create_chat_completion
ERROR:        generator = await openai_serving_chat.create_chat_completion(
ERROR:      File 
"/app/aphrodite-engine/aphrodite/endpoints/openai/serving_chat.py", line 68, in 
create_chat_completion
ERROR:        await get_guided_decoding_logits_processor(
ERROR:      File 
"/app/aphrodite-engine/aphrodite/modeling/outlines_decoding.py", line 49, in 
get_guided_decoding_logits_processor
ERROR:        result = await loop.run_in_executor(global_thread_pool,
ERROR:      File "/usr/lib/python3.10/concurrent/futures/thread.py", line 58, in
run
ERROR:        result = self.fn(*self.args, **self.kwargs)
ERROR:      File 
"/app/aphrodite-engine/aphrodite/modeling/outlines_decoding.py", line 100, in 
_get_cached_logits_processor
ERROR:        return JSONLogitsProcessor(guide, tokenizer)
ERROR:      File 
"/app/aphrodite-engine/aphrodite/modeling/outlines_logits_processors.py", line 
130, in __init__
ERROR:        super().__init__(regex_string, tokenizer)
ERROR:      File 
"/app/aphrodite-engine/aphrodite/modeling/outlines_logits_processors.py", line 
40, in __init__
ERROR:        fsm = RegexFSM(regex_string, tokenizer)
ERROR:      File "/usr/local/lib/python3.10/dist-packages/outlines/fsm/fsm.py", 
line 40, in __init__
ERROR:        super().__init__(regex_string, tokenizer)
ERROR:      File 
"/usr/local/lib/python3.10/dist-packages/outlines/fsm/guide.py", line 110, in 
__init__
ERROR:        def create_states_mapping(
ERROR:      File "/usr/local/lib/python3.10/dist-packages/outlines/caching.py", 
line 62, in decorator
ERROR:        memory = get_cache()
ERROR:      File "/usr/local/lib/python3.10/dist-packages/outlines/caching.py", 
line 29, in get_cache
ERROR:        memory = Cache(cache_dir, eviction_policy="none", cull_limit=0)
ERROR:      File "/usr/local/lib/python3.10/dist-packages/diskcache/core.py", 
line 456, in __init__
ERROR:        sql = self._sql_retry
ERROR:      File "/usr/local/lib/python3.10/dist-packages/diskcache/core.py", 
line 652, in _sql_retry
ERROR:        sql = self._sql
ERROR:      File "/usr/local/lib/python3.10/dist-packages/diskcache/core.py", 
line 648, in _sql
ERROR:        return self._con.execute
ERROR:      File "/usr/local/lib/python3.10/dist-packages/diskcache/core.py", 
line 623, in _con
ERROR:        con = self._local.con = sqlite3.connect(
ERROR:    sqlite3.OperationalError: unable to open database file
INFO:     172.18.0.4:37858 - "POST /v1/chat/completions HTTP/1.1" 500
ERROR:    Exception in ASGI application
ERROR:      + Exception Group Traceback (most recent call last):
ERROR:      |   File 
"/usr/local/lib/python3.10/dist-packages/starlette/_utils.py", line 87, in 
collapse_excgroups
ERROR:      |     yield
ERROR:      |   File 
"/usr/local/lib/python3.10/dist-packages/starlette/middleware/base.py", line 
190, in __call__
ERROR:      |     async with anyio.create_task_group() as task_group:
ERROR:      |   File 
"/usr/local/lib/python3.10/dist-packages/anyio/_backends/_asyncio.py", line 678,
in __aexit__
ERROR:      |     raise BaseExceptionGroup(
ERROR:      | exceptiongroup.ExceptionGroup: unhandled errors in a TaskGroup (1 
sub-exception)
ERROR:      +-+---------------- 1 ----------------
ERROR:        | Traceback (most recent call last):
ERROR:        |   File 
"/usr/local/lib/python3.10/dist-packages/uvicorn/protocols/http/h11_impl.py", 
line 408, in run_asgi
ERROR:        |     result = await app(  # type: ignore[func-returns-value]
ERROR:        |   File 
"/usr/local/lib/python3.10/dist-packages/uvicorn/middleware/proxy_headers.py", 
line 69, in __call__
ERROR:        |     return await self.app(scope, receive, send)
ERROR:        |   File 
"/usr/local/lib/python3.10/dist-packages/fastapi/applications.py", line 1054, in
__call__
ERROR:        |     await super().__call__(scope, receive, send)
ERROR:        |   File 
"/usr/local/lib/python3.10/dist-packages/starlette/applications.py", line 123, 
in __call__
ERROR:        |     await self.middleware_stack(scope, receive, send)
ERROR:        |   File 
"/usr/local/lib/python3.10/dist-packages/starlette/middleware/errors.py", line 
186, in __call__
ERROR:        |     raise exc
ERROR:        |   File 
"/usr/local/lib/python3.10/dist-packages/starlette/middleware/errors.py", line 
164, in __call__
ERROR:        |     await self.app(scope, receive, _send)
ERROR:        |   File 
"/usr/local/lib/python3.10/dist-packages/starlette/middleware/base.py", line 
189, in __call__
ERROR:        |     with collapse_excgroups():
ERROR:        |   File "/usr/lib/python3.10/contextlib.py", line 153, in 
__exit__
ERROR:        |     self.gen.throw(typ, value, traceback)
ERROR:        |   File 
"/usr/local/lib/python3.10/dist-packages/starlette/_utils.py", line 93, in 
collapse_excgroups
ERROR:        |     raise exc
ERROR:        |   File 
"/usr/local/lib/python3.10/dist-packages/starlette/middleware/base.py", line 
191, in __call__
ERROR:        |     response = await self.dispatch_func(request, call_next)
ERROR:        |   File 
"/app/aphrodite-engine/aphrodite/endpoints/openai/api_server.py", line 578, in 
authentication
ERROR:        |     return await call_next(request)
ERROR:        |   File 
"/usr/local/lib/python3.10/dist-packages/starlette/middleware/base.py", line 
165, in call_next
ERROR:        |     raise app_exc
ERROR:        |   File 
"/usr/local/lib/python3.10/dist-packages/starlette/middleware/base.py", line 
151, in coro
ERROR:        |     await self.app(scope, receive_or_disconnect, send_no_error)
ERROR:        |   File 
"/usr/local/lib/python3.10/dist-packages/starlette/middleware/cors.py", line 83,
in __call__
ERROR:        |     await self.app(scope, receive, send)
ERROR:        |   File 
"/usr/local/lib/python3.10/dist-packages/starlette/middleware/exceptions.py", 
line 62, in __call__
ERROR:        |     await wrap_app_handling_exceptions(self.app, conn)(scope, 
receive, send)
ERROR:        |   File 
"/usr/local/lib/python3.10/dist-packages/starlette/_exception_handler.py", line 
64, in wrapped_app
ERROR:        |     raise exc
ERROR:        |   File 
"/usr/local/lib/python3.10/dist-packages/starlette/_exception_handler.py", line 
53, in wrapped_app
ERROR:        |     await app(scope, receive, sender)
ERROR:        |   File 
"/usr/local/lib/python3.10/dist-packages/starlette/routing.py", line 758, in 
__call__
ERROR:        |     await self.middleware_stack(scope, receive, send)
ERROR:        |   File 
"/usr/local/lib/python3.10/dist-packages/starlette/routing.py", line 778, in app
ERROR:        |     await route.handle(scope, receive, send)
ERROR:        |   File 
"/usr/local/lib/python3.10/dist-packages/starlette/routing.py", line 299, in 
handle
ERROR:        |     await self.app(scope, receive, send)
ERROR:        |   File 
"/usr/local/lib/python3.10/dist-packages/starlette/routing.py", line 79, in app
ERROR:        |     await wrap_app_handling_exceptions(app, request)(scope, 
receive, send)
ERROR:        |   File 
"/usr/local/lib/python3.10/dist-packages/starlette/_exception_handler.py", line 
64, in wrapped_app
ERROR:        |     raise exc
ERROR:        |   File 
"/usr/local/lib/python3.10/dist-packages/starlette/_exception_handler.py", line 
53, in wrapped_app
ERROR:        |     await app(scope, receive, sender)
ERROR:        |   File 
"/usr/local/lib/python3.10/dist-packages/starlette/routing.py", line 74, in app
ERROR:        |     response = await func(request)
ERROR:        |   File 
"/usr/local/lib/python3.10/dist-packages/fastapi/routing.py", line 278, in app
ERROR:        |     raw_response = await run_endpoint_function(
ERROR:        |   File 
"/usr/local/lib/python3.10/dist-packages/fastapi/routing.py", line 191, in 
run_endpoint_function
ERROR:        |     return await dependant.call(**values)
ERROR:        |   File 
"/app/aphrodite-engine/aphrodite/endpoints/openai/api_server.py", line 265, in 
create_chat_completion
ERROR:        |     generator = await 
openai_serving_chat.create_chat_completion(
ERROR:        |   File 
"/app/aphrodite-engine/aphrodite/endpoints/openai/serving_chat.py", line 68, in 
create_chat_completion
ERROR:        |     await get_guided_decoding_logits_processor(
ERROR:        |   File 
"/app/aphrodite-engine/aphrodite/modeling/outlines_decoding.py", line 49, in 
get_guided_decoding_logits_processor
ERROR:        |     result = await loop.run_in_executor(global_thread_pool,
ERROR:        |   File "/usr/lib/python3.10/concurrent/futures/thread.py", line 
58, in run
ERROR:        |     result = self.fn(*self.args, **self.kwargs)
ERROR:        |   File 
"/app/aphrodite-engine/aphrodite/modeling/outlines_decoding.py", line 100, in 
_get_cached_logits_processor
ERROR:        |     return JSONLogitsProcessor(guide, tokenizer)
ERROR:        |   File 
"/app/aphrodite-engine/aphrodite/modeling/outlines_logits_processors.py", line 
130, in __init__
ERROR:        |     super().__init__(regex_string, tokenizer)
ERROR:        |   File 
"/app/aphrodite-engine/aphrodite/modeling/outlines_logits_processors.py", line 
40, in __init__
ERROR:        |     fsm = RegexFSM(regex_string, tokenizer)
ERROR:        |   File 
"/usr/local/lib/python3.10/dist-packages/outlines/fsm/fsm.py", line 40, in 
__init__
ERROR:        |     super().__init__(regex_string, tokenizer)
ERROR:        |   File 
"/usr/local/lib/python3.10/dist-packages/outlines/fsm/guide.py", line 110, in 
__init__
ERROR:        |     def create_states_mapping(
ERROR:        |   File 
"/usr/local/lib/python3.10/dist-packages/outlines/caching.py", line 62, in 
decorator
ERROR:        |     memory = get_cache()
ERROR:        |   File 
"/usr/local/lib/python3.10/dist-packages/outlines/caching.py", line 29, in 
get_cache
ERROR:        |     memory = Cache(cache_dir, eviction_policy="none", 
cull_limit=0)
ERROR:        |   File 
"/usr/local/lib/python3.10/dist-packages/diskcache/core.py", line 456, in 
__init__
ERROR:        |     sql = self._sql_retry
ERROR:        |   File 
"/usr/local/lib/python3.10/dist-packages/diskcache/core.py", line 652, in 
_sql_retry
ERROR:        |     sql = self._sql
ERROR:        |   File 
"/usr/local/lib/python3.10/dist-packages/diskcache/core.py", line 648, in _sql
ERROR:        |     return self._con.execute
ERROR:        |   File 
"/usr/local/lib/python3.10/dist-packages/diskcache/core.py", line 623, in _con
ERROR:        |     con = self._local.con = sqlite3.connect(
ERROR:        | sqlite3.OperationalError: unable to open database file
ERROR:        +------------------------------------
ERROR:    
ERROR:    During handling of the above exception, another exception occurred:
ERROR:    
ERROR:    Traceback (most recent call last):
ERROR:      File 
"/usr/local/lib/python3.10/dist-packages/uvicorn/protocols/http/h11_impl.py", 
line 408, in run_asgi
ERROR:        result = await app(  # type: ignore[func-returns-value]
ERROR:      File 
"/usr/local/lib/python3.10/dist-packages/uvicorn/middleware/proxy_headers.py", 
line 69, in __call__
ERROR:        return await self.app(scope, receive, send)
ERROR:      File 
"/usr/local/lib/python3.10/dist-packages/fastapi/applications.py", line 1054, in
__call__
ERROR:        await super().__call__(scope, receive, send)
ERROR:      File 
"/usr/local/lib/python3.10/dist-packages/starlette/applications.py", line 123, 
in __call__
ERROR:        await self.middleware_stack(scope, receive, send)
ERROR:      File 
"/usr/local/lib/python3.10/dist-packages/starlette/middleware/errors.py", line 
186, in __call__
ERROR:        raise exc
ERROR:      File 
"/usr/local/lib/python3.10/dist-packages/starlette/middleware/errors.py", line 
164, in __call__
ERROR:        await self.app(scope, receive, _send)
ERROR:      File 
"/usr/local/lib/python3.10/dist-packages/starlette/middleware/base.py", line 
189, in __call__
ERROR:        with collapse_excgroups():
ERROR:      File "/usr/lib/python3.10/contextlib.py", line 153, in __exit__
ERROR:        self.gen.throw(typ, value, traceback)
ERROR:      File "/usr/local/lib/python3.10/dist-packages/starlette/_utils.py", 
line 93, in collapse_excgroups
ERROR:        raise exc
ERROR:      File 
"/usr/local/lib/python3.10/dist-packages/starlette/middleware/base.py", line 
191, in __call__
ERROR:        response = await self.dispatch_func(request, call_next)
ERROR:      File 
"/app/aphrodite-engine/aphrodite/endpoints/openai/api_server.py", line 578, in 
authentication
ERROR:        return await call_next(request)
ERROR:      File 
"/usr/local/lib/python3.10/dist-packages/starlette/middleware/base.py", line 
165, in call_next
ERROR:        raise app_exc
ERROR:      File 
"/usr/local/lib/python3.10/dist-packages/starlette/middleware/base.py", line 
151, in coro
ERROR:        await self.app(scope, receive_or_disconnect, send_no_error)
ERROR:      File 
"/usr/local/lib/python3.10/dist-packages/starlette/middleware/cors.py", line 83,
in __call__
ERROR:        await self.app(scope, receive, send)
ERROR:      File 
"/usr/local/lib/python3.10/dist-packages/starlette/middleware/exceptions.py", 
line 62, in __call__
ERROR:        await wrap_app_handling_exceptions(self.app, conn)(scope, receive,
send)
ERROR:      File 
"/usr/local/lib/python3.10/dist-packages/starlette/_exception_handler.py", line 
64, in wrapped_app
ERROR:        raise exc
ERROR:      File 
"/usr/local/lib/python3.10/dist-packages/starlette/_exception_handler.py", line 
53, in wrapped_app
ERROR:        await app(scope, receive, sender)
ERROR:      File "/usr/local/lib/python3.10/dist-packages/starlette/routing.py",
line 758, in __call__
ERROR:        await self.middleware_stack(scope, receive, send)
ERROR:      File "/usr/local/lib/python3.10/dist-packages/starlette/routing.py",
line 778, in app
ERROR:        await route.handle(scope, receive, send)
ERROR:      File "/usr/local/lib/python3.10/dist-packages/starlette/routing.py",
line 299, in handle
ERROR:        await self.app(scope, receive, send)
ERROR:      File "/usr/local/lib/python3.10/dist-packages/starlette/routing.py",
line 79, in app
ERROR:        await wrap_app_handling_exceptions(app, request)(scope, receive, 
send)
ERROR:      File 
"/usr/local/lib/python3.10/dist-packages/starlette/_exception_handler.py", line 
64, in wrapped_app
ERROR:        raise exc
ERROR:      File 
"/usr/local/lib/python3.10/dist-packages/starlette/_exception_handler.py", line 
53, in wrapped_app
ERROR:        await app(scope, receive, sender)
ERROR:      File "/usr/local/lib/python3.10/dist-packages/starlette/routing.py",
line 74, in app
ERROR:        response = await func(request)
ERROR:      File "/usr/local/lib/python3.10/dist-packages/fastapi/routing.py", 
line 278, in app
ERROR:        raw_response = await run_endpoint_function(
ERROR:      File "/usr/local/lib/python3.10/dist-packages/fastapi/routing.py", 
line 191, in run_endpoint_function
ERROR:        return await dependant.call(**values)
ERROR:      File 
"/app/aphrodite-engine/aphrodite/endpoints/openai/api_server.py", line 265, in 
create_chat_completion
ERROR:        generator = await openai_serving_chat.create_chat_completion(
ERROR:      File 
"/app/aphrodite-engine/aphrodite/endpoints/openai/serving_chat.py", line 68, in 
create_chat_completion
ERROR:        await get_guided_decoding_logits_processor(
ERROR:      File 
"/app/aphrodite-engine/aphrodite/modeling/outlines_decoding.py", line 49, in 
get_guided_decoding_logits_processor
ERROR:        result = await loop.run_in_executor(global_thread_pool,
ERROR:      File "/usr/lib/python3.10/concurrent/futures/thread.py", line 58, in
run
ERROR:        result = self.fn(*self.args, **self.kwargs)
ERROR:      File 
"/app/aphrodite-engine/aphrodite/modeling/outlines_decoding.py", line 100, in 
_get_cached_logits_processor
ERROR:        return JSONLogitsProcessor(guide, tokenizer)
ERROR:      File 
"/app/aphrodite-engine/aphrodite/modeling/outlines_logits_processors.py", line 
130, in __init__
ERROR:        super().__init__(regex_string, tokenizer)
ERROR:      File 
"/app/aphrodite-engine/aphrodite/modeling/outlines_logits_processors.py", line 
40, in __init__
ERROR:        fsm = RegexFSM(regex_string, tokenizer)
ERROR:      File "/usr/local/lib/python3.10/dist-packages/outlines/fsm/fsm.py", 
line 40, in __init__
ERROR:        super().__init__(regex_string, tokenizer)
ERROR:      File 
"/usr/local/lib/python3.10/dist-packages/outlines/fsm/guide.py", line 110, in 
__init__
ERROR:        def create_states_mapping(
ERROR:      File "/usr/local/lib/python3.10/dist-packages/outlines/caching.py", 
line 62, in decorator
ERROR:        memory = get_cache()
ERROR:      File "/usr/local/lib/python3.10/dist-packages/outlines/caching.py", 
line 29, in get_cache
ERROR:        memory = Cache(cache_dir, eviction_policy="none", cull_limit=0)
ERROR:      File "/usr/local/lib/python3.10/dist-packages/diskcache/core.py", 
line 456, in __init__
ERROR:        sql = self._sql_retry
ERROR:      File "/usr/local/lib/python3.10/dist-packages/diskcache/core.py", 
line 652, in _sql_retry
ERROR:        sql = self._sql
ERROR:      File "/usr/local/lib/python3.10/dist-packages/diskcache/core.py", 
line 648, in _sql
ERROR:        return self._con.execute
ERROR:      File "/usr/local/lib/python3.10/dist-packages/diskcache/core.py", 
line 623, in _con
ERROR:        con = self._local.con = sqlite3.connect(
ERROR:    sqlite3.OperationalError: unable to open database file
INFO:     172.18.0.4:45014 - "POST /v1/chat/completions HTTP/1.1" 500
ERROR:    Exception in ASGI application
ERROR:      + Exception Group Traceback (most recent call last):
ERROR:      |   File 
"/usr/local/lib/python3.10/dist-packages/starlette/_utils.py", line 87, in 
collapse_excgroups
ERROR:      |     yield
ERROR:      |   File 
"/usr/local/lib/python3.10/dist-packages/starlette/middleware/base.py", line 
190, in __call__
ERROR:      |     async with anyio.create_task_group() as task_group:
ERROR:      |   File 
"/usr/local/lib/python3.10/dist-packages/anyio/_backends/_asyncio.py", line 678,
in __aexit__
ERROR:      |     raise BaseExceptionGroup(
ERROR:      | exceptiongroup.ExceptionGroup: unhandled errors in a TaskGroup (1 
sub-exception)
ERROR:      +-+---------------- 1 ----------------
ERROR:        | Traceback (most recent call last):
ERROR:        |   File 
"/usr/local/lib/python3.10/dist-packages/uvicorn/protocols/http/h11_impl.py", 
line 408, in run_asgi
ERROR:        |     result = await app(  # type: ignore[func-returns-value]
ERROR:        |   File 
"/usr/local/lib/python3.10/dist-packages/uvicorn/middleware/proxy_headers.py", 
line 69, in __call__
ERROR:        |     return await self.app(scope, receive, send)
ERROR:        |   File 
"/usr/local/lib/python3.10/dist-packages/fastapi/applications.py", line 1054, in
__call__
ERROR:        |     await super().__call__(scope, receive, send)
ERROR:        |   File 
"/usr/local/lib/python3.10/dist-packages/starlette/applications.py", line 123, 
in __call__
ERROR:        |     await self.middleware_stack(scope, receive, send)
ERROR:        |   File 
"/usr/local/lib/python3.10/dist-packages/starlette/middleware/errors.py", line 
186, in __call__
ERROR:        |     raise exc
ERROR:        |   File 
"/usr/local/lib/python3.10/dist-packages/starlette/middleware/errors.py", line 
164, in __call__
ERROR:        |     await self.app(scope, receive, _send)
ERROR:        |   File 
"/usr/local/lib/python3.10/dist-packages/starlette/middleware/base.py", line 
189, in __call__
ERROR:        |     with collapse_excgroups():
ERROR:        |   File "/usr/lib/python3.10/contextlib.py", line 153, in 
__exit__
ERROR:        |     self.gen.throw(typ, value, traceback)
ERROR:        |   File 
"/usr/local/lib/python3.10/dist-packages/starlette/_utils.py", line 93, in 
collapse_excgroups
ERROR:        |     raise exc
ERROR:        |   File 
"/usr/local/lib/python3.10/dist-packages/starlette/middleware/base.py", line 
191, in __call__
ERROR:        |     response = await self.dispatch_func(request, call_next)
ERROR:        |   File 
"/app/aphrodite-engine/aphrodite/endpoints/openai/api_server.py", line 578, in 
authentication
ERROR:        |     return await call_next(request)
ERROR:        |   File 
"/usr/local/lib/python3.10/dist-packages/starlette/middleware/base.py", line 
165, in call_next
ERROR:        |     raise app_exc
ERROR:        |   File 
"/usr/local/lib/python3.10/dist-packages/starlette/middleware/base.py", line 
151, in coro
ERROR:        |     await self.app(scope, receive_or_disconnect, send_no_error)
ERROR:        |   File 
"/usr/local/lib/python3.10/dist-packages/starlette/middleware/cors.py", line 83,
in __call__
ERROR:        |     await self.app(scope, receive, send)
ERROR:        |   File 
"/usr/local/lib/python3.10/dist-packages/starlette/middleware/exceptions.py", 
line 62, in __call__
ERROR:        |     await wrap_app_handling_exceptions(self.app, conn)(scope, 
receive, send)
ERROR:        |   File 
"/usr/local/lib/python3.10/dist-packages/starlette/_exception_handler.py", line 
64, in wrapped_app
ERROR:        |     raise exc
ERROR:        |   File 
"/usr/local/lib/python3.10/dist-packages/starlette/_exception_handler.py", line 
53, in wrapped_app
ERROR:        |     await app(scope, receive, sender)
ERROR:        |   File 
"/usr/local/lib/python3.10/dist-packages/starlette/routing.py", line 758, in 
__call__
ERROR:        |     await self.middleware_stack(scope, receive, send)
ERROR:        |   File 
"/usr/local/lib/python3.10/dist-packages/starlette/routing.py", line 778, in app
ERROR:        |     await route.handle(scope, receive, send)
ERROR:        |   File 
"/usr/local/lib/python3.10/dist-packages/starlette/routing.py", line 299, in 
handle
ERROR:        |     await self.app(scope, receive, send)
ERROR:        |   File 
"/usr/local/lib/python3.10/dist-packages/starlette/routing.py", line 79, in app
ERROR:        |     await wrap_app_handling_exceptions(app, request)(scope, 
receive, send)
ERROR:        |   File 
"/usr/local/lib/python3.10/dist-packages/starlette/_exception_handler.py", line 
64, in wrapped_app
ERROR:        |     raise exc
ERROR:        |   File 
"/usr/local/lib/python3.10/dist-packages/starlette/_exception_handler.py", line 
53, in wrapped_app
ERROR:        |     await app(scope, receive, sender)
ERROR:        |   File 
"/usr/local/lib/python3.10/dist-packages/starlette/routing.py", line 74, in app
ERROR:        |     response = await func(request)
ERROR:        |   File 
"/usr/local/lib/python3.10/dist-packages/fastapi/routing.py", line 278, in app
ERROR:        |     raw_response = await run_endpoint_function(
ERROR:        |   File 
"/usr/local/lib/python3.10/dist-packages/fastapi/routing.py", line 191, in 
run_endpoint_function
ERROR:        |     return await dependant.call(**values)
ERROR:        |   File 
"/app/aphrodite-engine/aphrodite/endpoints/openai/api_server.py", line 265, in 
create_chat_completion
ERROR:        |     generator = await 
openai_serving_chat.create_chat_completion(
ERROR:        |   File 
"/app/aphrodite-engine/aphrodite/endpoints/openai/serving_chat.py", line 68, in 
create_chat_completion
ERROR:        |     await get_guided_decoding_logits_processor(
ERROR:        |   File 
"/app/aphrodite-engine/aphrodite/modeling/outlines_decoding.py", line 49, in 
get_guided_decoding_logits_processor
ERROR:        |     result = await loop.run_in_executor(global_thread_pool,
ERROR:        |   File "/usr/lib/python3.10/concurrent/futures/thread.py", line 
58, in run
ERROR:        |     result = self.fn(*self.args, **self.kwargs)
ERROR:        |   File 
"/app/aphrodite-engine/aphrodite/modeling/outlines_decoding.py", line 100, in 
_get_cached_logits_processor
ERROR:        |     return JSONLogitsProcessor(guide, tokenizer)
ERROR:        |   File 
"/app/aphrodite-engine/aphrodite/modeling/outlines_logits_processors.py", line 
130, in __init__
ERROR:        |     super().__init__(regex_string, tokenizer)
ERROR:        |   File 
"/app/aphrodite-engine/aphrodite/modeling/outlines_logits_processors.py", line 
40, in __init__
ERROR:        |     fsm = RegexFSM(regex_string, tokenizer)
ERROR:        |   File 
"/usr/local/lib/python3.10/dist-packages/outlines/fsm/fsm.py", line 40, in 
__init__
ERROR:        |     super().__init__(regex_string, tokenizer)
ERROR:        |   File 
"/usr/local/lib/python3.10/dist-packages/outlines/fsm/guide.py", line 110, in 
__init__
ERROR:        |     def create_states_mapping(
ERROR:        |   File 
"/usr/local/lib/python3.10/dist-packages/outlines/caching.py", line 62, in 
decorator
ERROR:        |     memory = get_cache()
ERROR:        |   File 
"/usr/local/lib/python3.10/dist-packages/outlines/caching.py", line 29, in 
get_cache
ERROR:        |     memory = Cache(cache_dir, eviction_policy="none", 
cull_limit=0)
ERROR:        |   File 
"/usr/local/lib/python3.10/dist-packages/diskcache/core.py", line 456, in 
__init__
ERROR:        |     sql = self._sql_retry
ERROR:        |   File 
"/usr/local/lib/python3.10/dist-packages/diskcache/core.py", line 652, in 
_sql_retry
ERROR:        |     sql = self._sql
ERROR:        |   File 
"/usr/local/lib/python3.10/dist-packages/diskcache/core.py", line 648, in _sql
ERROR:        |     return self._con.execute
ERROR:        |   File 
"/usr/local/lib/python3.10/dist-packages/diskcache/core.py", line 623, in _con
ERROR:        |     con = self._local.con = sqlite3.connect(
ERROR:        | sqlite3.OperationalError: unable to open database file
ERROR:        +------------------------------------
ERROR:    
ERROR:    During handling of the above exception, another exception occurred:
ERROR:    
ERROR:    Traceback (most recent call last):
ERROR:      File 
"/usr/local/lib/python3.10/dist-packages/uvicorn/protocols/http/h11_impl.py", 
line 408, in run_asgi
ERROR:        result = await app(  # type: ignore[func-returns-value]
ERROR:      File 
"/usr/local/lib/python3.10/dist-packages/uvicorn/middleware/proxy_headers.py", 
line 69, in __call__
ERROR:        return await self.app(scope, receive, send)
ERROR:      File 
"/usr/local/lib/python3.10/dist-packages/fastapi/applications.py", line 1054, in
__call__
ERROR:        await super().__call__(scope, receive, send)
ERROR:      File 
"/usr/local/lib/python3.10/dist-packages/starlette/applications.py", line 123, 
in __call__
ERROR:        await self.middleware_stack(scope, receive, send)
ERROR:      File 
"/usr/local/lib/python3.10/dist-packages/starlette/middleware/errors.py", line 
186, in __call__
ERROR:        raise exc
ERROR:      File 
"/usr/local/lib/python3.10/dist-packages/starlette/middleware/errors.py", line 
164, in __call__
ERROR:        await self.app(scope, receive, _send)
ERROR:      File 
"/usr/local/lib/python3.10/dist-packages/starlette/middleware/base.py", line 
189, in __call__
ERROR:        with collapse_excgroups():
ERROR:      File "/usr/lib/python3.10/contextlib.py", line 153, in __exit__
ERROR:        self.gen.throw(typ, value, traceback)
ERROR:      File "/usr/local/lib/python3.10/dist-packages/starlette/_utils.py", 
line 93, in collapse_excgroups
ERROR:        raise exc
ERROR:      File 
"/usr/local/lib/python3.10/dist-packages/starlette/middleware/base.py", line 
191, in __call__
ERROR:        response = await self.dispatch_func(request, call_next)
ERROR:      File 
"/app/aphrodite-engine/aphrodite/endpoints/openai/api_server.py", line 578, in 
authentication
ERROR:        return await call_next(request)
ERROR:      File 
"/usr/local/lib/python3.10/dist-packages/starlette/middleware/base.py", line 
165, in call_next
ERROR:        raise app_exc
ERROR:      File 
"/usr/local/lib/python3.10/dist-packages/starlette/middleware/base.py", line 
151, in coro
ERROR:        await self.app(scope, receive_or_disconnect, send_no_error)
ERROR:      File 
"/usr/local/lib/python3.10/dist-packages/starlette/middleware/cors.py", line 83,
in __call__
ERROR:        await self.app(scope, receive, send)
ERROR:      File 
"/usr/local/lib/python3.10/dist-packages/starlette/middleware/exceptions.py", 
line 62, in __call__
ERROR:        await wrap_app_handling_exceptions(self.app, conn)(scope, receive,
send)
ERROR:      File 
"/usr/local/lib/python3.10/dist-packages/starlette/_exception_handler.py", line 
64, in wrapped_app
ERROR:        raise exc
ERROR:      File 
"/usr/local/lib/python3.10/dist-packages/starlette/_exception_handler.py", line 
53, in wrapped_app
ERROR:        await app(scope, receive, sender)
ERROR:      File "/usr/local/lib/python3.10/dist-packages/starlette/routing.py",
line 758, in __call__
ERROR:        await self.middleware_stack(scope, receive, send)
ERROR:      File "/usr/local/lib/python3.10/dist-packages/starlette/routing.py",
line 778, in app
ERROR:        await route.handle(scope, receive, send)
ERROR:      File "/usr/local/lib/python3.10/dist-packages/starlette/routing.py",
line 299, in handle
ERROR:        await self.app(scope, receive, send)
ERROR:      File "/usr/local/lib/python3.10/dist-packages/starlette/routing.py",
line 79, in app
ERROR:        await wrap_app_handling_exceptions(app, request)(scope, receive, 
send)
ERROR:      File 
"/usr/local/lib/python3.10/dist-packages/starlette/_exception_handler.py", line 
64, in wrapped_app
ERROR:        raise exc
ERROR:      File 
"/usr/local/lib/python3.10/dist-packages/starlette/_exception_handler.py", line 
53, in wrapped_app
ERROR:        await app(scope, receive, sender)
ERROR:      File "/usr/local/lib/python3.10/dist-packages/starlette/routing.py",
line 74, in app
ERROR:        response = await func(request)
ERROR:      File "/usr/local/lib/python3.10/dist-packages/fastapi/routing.py", 
line 278, in app
ERROR:        raw_response = await run_endpoint_function(
ERROR:      File "/usr/local/lib/python3.10/dist-packages/fastapi/routing.py", 
line 191, in run_endpoint_function
ERROR:        return await dependant.call(**values)
ERROR:      File 
"/app/aphrodite-engine/aphrodite/endpoints/openai/api_server.py", line 265, in 
create_chat_completion
ERROR:        generator = await openai_serving_chat.create_chat_completion(
ERROR:      File 
"/app/aphrodite-engine/aphrodite/endpoints/openai/serving_chat.py", line 68, in 
create_chat_completion
ERROR:        await get_guided_decoding_logits_processor(
ERROR:      File 
"/app/aphrodite-engine/aphrodite/modeling/outlines_decoding.py", line 49, in 
get_guided_decoding_logits_processor
ERROR:        result = await loop.run_in_executor(global_thread_pool,
ERROR:      File "/usr/lib/python3.10/concurrent/futures/thread.py", line 58, in
run
ERROR:        result = self.fn(*self.args, **self.kwargs)
ERROR:      File 
"/app/aphrodite-engine/aphrodite/modeling/outlines_decoding.py", line 100, in 
_get_cached_logits_processor
ERROR:        return JSONLogitsProcessor(guide, tokenizer)
ERROR:      File 
"/app/aphrodite-engine/aphrodite/modeling/outlines_logits_processors.py", line 
130, in __init__
ERROR:        super().__init__(regex_string, tokenizer)
ERROR:      File 
"/app/aphrodite-engine/aphrodite/modeling/outlines_logits_processors.py", line 
40, in __init__
ERROR:        fsm = RegexFSM(regex_string, tokenizer)
ERROR:      File "/usr/local/lib/python3.10/dist-packages/outlines/fsm/fsm.py", 
line 40, in __init__
ERROR:        super().__init__(regex_string, tokenizer)
ERROR:      File 
"/usr/local/lib/python3.10/dist-packages/outlines/fsm/guide.py", line 110, in 
__init__
ERROR:        def create_states_mapping(
ERROR:      File "/usr/local/lib/python3.10/dist-packages/outlines/caching.py", 
line 62, in decorator
ERROR:        memory = get_cache()
ERROR:      File "/usr/local/lib/python3.10/dist-packages/outlines/caching.py", 
line 29, in get_cache
ERROR:        memory = Cache(cache_dir, eviction_policy="none", cull_limit=0)
ERROR:      File "/usr/local/lib/python3.10/dist-packages/diskcache/core.py", 
line 456, in __init__
ERROR:        sql = self._sql_retry
ERROR:      File "/usr/local/lib/python3.10/dist-packages/diskcache/core.py", 
line 652, in _sql_retry
ERROR:        sql = self._sql
ERROR:      File "/usr/local/lib/python3.10/dist-packages/diskcache/core.py", 
line 648, in _sql
ERROR:        return self._con.execute
ERROR:      File "/usr/local/lib/python3.10/dist-packages/diskcache/core.py", 
line 623, in _con
ERROR:        con = self._local.con = sqlite3.connect(
ERROR:    sqlite3.OperationalError: unable to open database file

Also get this message: Token indices sequence length is longer than the specified maximum sequence length for this model (2023 > 1024) but i have configured the environment to 12k length

engine run parameters:

+ exec python3 -m aphrodite.endpoints.openai.api_server --host 0.0.0.0 --port 7860 --download-dir /data/hub --model LoneStriker/Smaug-34B-v0.1-GPTQ --dtype float16 --kv-cache-dtype fp8_e5m2 --max-model-len 12000 --tensor-parallel-size 2 --gpu-memory-utilization .97 --enforce-eager --disable-log-stats --api-keys 123 --block-size 8 --max-paddings 512 --port 3000 --swap-space 10 --chat-template /home/workspace/chat_templates/gorilla_v2__fc.jinja --served-model-name dolf --max-context-len-to-capture 512 --max-num-batched-tokens 32000 --max-num-seqs 62 --quantization gptq

used json schema:

{"description": "Useful to return the text summarization task", "properties": {"summary": {"description": "The resulting summary of the provided text.", "title": "Summary", "type": "string"}}, "required": ["summary"], "title": "result", "type": "object"}

using the oficial open ai client with:

chat_completion = client.chat.completions.create(
        temperature=0.1,
        model="dolf",
        messages=messages,
        tool_choice="auto",
        max_tokens=500,
        extra_body= { 'guided_json': json_schema }
    )
@puppetm4st3r puppetm4st3r added the bug Something isn't working label Mar 22, 2024
@puppetm4st3r puppetm4st3r changed the title [Bug]: Outlines decoding [Bug]: Outlines json guided decoding Mar 22, 2024
@puppetm4st3r
Copy link
Author

it's a privilege issue, fixed running chmod 777 -R * inside /app/aphrodite-engine/.cache

@puppetm4st3r
Copy link
Author

puppetm4st3r commented Mar 22, 2024

if useful for someone with the same issue, workarround:

docker exec -u root "container_name" -R 777 /app/aphrodite-engine/.cache

@puppetm4st3r
Copy link
Author

please 🙏, it's a simple bug but adds a lot of value, it practically kill all the previous effort of json guided decoding @AlpinDale 🙏 and in every production release we have to enter inside the container to fix it =(

@AlpinDale
Copy link
Member

Hi sorry, I totally missed this issue! Can you run the docker in privileged mode?

@puppetm4st3r
Copy link
Author

thats a good idea, I cannot run permanently in that mode, but I can handle that for a while, thanks!

@AlpinDale
Copy link
Member

We already resolved a similar issue related to triton - it should be fixed in the latest docker. Have you tried it?

@puppetm4st3r
Copy link
Author

puppetm4st3r commented May 27, 2024

i'm trying the last official image, still has the problem, and now I got another problem with moes with the last version, have create the other issue. (sorry for reporting so many bugs, I use a lot your engine)

@alexandreteles
Copy link

The problem indeed still exists. One solution to this is to mount a host folder with -v /my/local/folder:/app/aphrodite-engine/.cache with the added benefit of keeping the cache during container reboots.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants