PygmalionAI / aphrodite-engine

PygmalionAI's large-scale inference engine
https://pygmalion.chat
GNU Affero General Public License v3.0
606 stars 78 forks source link

[Installation]: No module named 'aphrodite._C' #400

Closed DuckY-Y closed 1 month ago

DuckY-Y commented 1 month ago

Your current environment

PyTorch version: 2.2.0+cu121
Is debug build: False
CUDA used to build PyTorch: 12.1
ROCM used to build PyTorch: N/A
OS: Ubuntu 22.04.4 LTS (x86_64)
GCC version: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
Clang version: Could not collect
CMake version: version 3.22.1
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-5.15.0-102-generic-x86_64-with-glibc2.35
Is CUDA available: True
CUDA runtime version: 11.5.119
CUDA_MODULE_LOADING set to: LAZY
GPU models and configuration:
GPU 0: Tesla P40
GPU 1: Tesla P100-PCIE-16GB

Nvidia driver version: 535.161.07
cuDNN version: Could not collect
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: True
CPU:
Architecture:                       x86_64
CPU op-mode(s):                     32-bit, 64-bit
Address sizes:                      46 bits physical, 48 bits virtual
Byte Order:                         Little Endian
CPU(s):                             20
On-line CPU(s) list:                0-19
Vendor ID:                          GenuineIntel
Model name:                         Intel(R) Xeon(R) CPU E5-2650 v3 @ 2.30GHz
CPU family:                         6
Model:                              63
Thread(s) per core:                 2
Core(s) per socket:                 10
Socket(s):                          1
Stepping:                           2
CPU max MHz:                        2300.0000
CPU min MHz:                        1200.0000
BogoMIPS:                           4589.23
Flags:                              fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm cpuid_fault epb invpcid_single pti intel_ppin ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid cqm xsaveopt cqm_llc cqm_occup_llc dtherm arat pln pts md_clear flush_l1d
Virtualization:                     VT-x
L1d cache:                          320 KiB (10 instances)
L1i cache:                          320 KiB (10 instances)
L2 cache:                           2.5 MiB (10 instances)
L3 cache:                           25 MiB (1 instance)
NUMA node(s):                       1
NUMA node0 CPU(s):                  0-19
Vulnerability Gather data sampling: Not affected
Vulnerability Itlb multihit:        KVM: Mitigation: VMX disabled
Vulnerability L1tf:                 Mitigation; PTE Inversion; VMX conditional cache flushes, SMT vulnerable
Vulnerability Mds:                  Mitigation; Clear CPU buffers; SMT vulnerable
Vulnerability Meltdown:             Mitigation; PTI
Vulnerability Mmio stale data:      Mitigation; Clear CPU buffers; SMT vulnerable
Vulnerability Retbleed:             Not affected
Vulnerability Spec rstack overflow: Not affected
Vulnerability Spec store bypass:    Mitigation; Speculative Store Bypass disabled via prctl and seccomp
Vulnerability Spectre v1:           Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2:           Mitigation; Retpolines, IBPB conditional, IBRS_FW, STIBP conditional, RSB filling, PBRSB-eIBRS Not affected
Vulnerability Srbds:                Not affected
Vulnerability Tsx async abort:      Not affected
Versions of relevant libraries:
[pip3] mypy-extensions==1.0.0
[pip3] numpy==1.26.4
[pip3] onnxruntime-gpu==1.17.1
[pip3] torch==2.2.0
[pip3] triton==2.2.0
[conda] Could not collect ROCM Version: Could not collect
Aphrodite Version: 0.5.2
Aphrodite Build Flags:
CUDA Archs: Not Set; ROCm: Disabled

Crash report:

Traceback (most recent call last):
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/home/tesh/aphrodite-engine/aphrodite/endpoints/openai/api_server.py", line 33, in <module>
    from aphrodite.endpoints.openai.serving_chat import OpenAIServingChat
  File "/home/tesh/aphrodite-engine/aphrodite/endpoints/openai/serving_chat.py", line 16, in <module>
    from aphrodite.modeling.outlines_decoding import (
  File "/home/tesh/aphrodite-engine/aphrodite/modeling/__init__.py", line 2, in <module>
    from aphrodite.modeling.loader import get_model
  File "/home/tesh/aphrodite-engine/aphrodite/modeling/loader.py", line 13, in <module>
    from aphrodite.modeling.hf_downloader import (
  File "/home/tesh/aphrodite-engine/aphrodite/modeling/hf_downloader.py", line 21, in <module>
    from aphrodite.modeling.layers.quantization import (get_quantization_config,
  File "/home/tesh/aphrodite-engine/aphrodite/modeling/layers/quantization/__init__.py", line 4, in <module>
    from aphrodite.modeling.layers.quantization.aqlm import AQLMConfig
  File "/home/tesh/aphrodite-engine/aphrodite/modeling/layers/quantization/aqlm.py", line 12, in <module>
    from aphrodite._C import ops
ModuleNotFoundError: No module named 'aphrodite._C'

it still gives the same error when appending -q guff

How did you install Aphrodite?

pip install aphrodite-engine

python3 -m aphrodite.endpoints.openai.api_server --model ~/models/kunoichi-7b.Q4_K_M.gguf
DuckY-Y commented 1 month ago

alright I was executing the command inside the repo, moved outside and now this error:

Traceback (most recent call last):
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/home/tesh/.local/lib/python3.10/site-packages/aphrodite/endpoints/openai/api_server.py", line 31, in <module>
    from aphrodite.endpoints.openai.serving_chat import OpenAIServingChat
  File "/home/tesh/.local/lib/python3.10/site-packages/aphrodite/endpoints/openai/serving_chat.py", line 16, in <module>
    from aphrodite.modeling.outlines_decoding import (
  File "/home/tesh/.local/lib/python3.10/site-packages/aphrodite/modeling/outlines_decoding.py", line 15, in <module>
    from aphrodite.modeling.outlines_logits_processors import (
  File "/home/tesh/.local/lib/python3.10/site-packages/aphrodite/modeling/outlines_logits_processors.py", line 24, in <module>
    from outlines.fsm.fsm import RegexFSM
  File "/home/tesh/.local/lib/python3.10/site-packages/outlines/__init__.py", line 2, in <module>
    import outlines.generate
  File "/home/tesh/.local/lib/python3.10/site-packages/outlines/generate/__init__.py", line 2, in <module>
    from .cfg import cfg
  File "/home/tesh/.local/lib/python3.10/site-packages/outlines/generate/cfg.py", line 5, in <module>
    from outlines.models import OpenAI
  File "/home/tesh/.local/lib/python3.10/site-packages/outlines/models/__init__.py", line 11, in <module>
    from .llamacpp import LlamaCpp, llamacpp
  File "/home/tesh/.local/lib/python3.10/site-packages/outlines/models/llamacpp.py", line 5, in <module>
    from outlines.integrations.llamacpp import (  # noqa: F401
  File "/home/tesh/.local/lib/python3.10/site-packages/outlines/integrations/llamacpp.py", line 37, in <module>
    from outlines.fsm.json_schema import build_regex_from_schema
  File "/home/tesh/.local/lib/python3.10/site-packages/outlines/fsm/json_schema.py", line 6, in <module>
    from jsonschema.protocols import Validator
ModuleNotFoundError: No module named 'jsonschema.protocols'
DuckY-Y commented 1 month ago

alright, turns out the package I had was outdated and that was enough to thow the error, after updating I got the error that the model or directory is not in the specified path even though it is. I ran the line inside the directory with ./ and that seemed to make it work, but:

WARNING:  gguf quantization is not fully optimized yet. The speed can be slower than non-quantized models.
INFO:     Initializing the Aphrodite Engine (v0.5.1) with the following config:
INFO:     Model = './kunoichi-7b.Q4_K_M.gguf'
INFO:     DataType = torch.float16
INFO:     Model Load Format = auto
INFO:     Number of GPUs = 1
INFO:     Disable Custom All-Reduce = False
INFO:     Quantization Format = gguf
INFO:     Context Length = 8192
INFO:     Enforce Eager Mode = False
INFO:     KV Cache Data Type = auto
INFO:     KV Cache Params Path = None
INFO:     Device = cuda
You are using the default legacy behaviour of the <class 'transformers.models.llama.tokenization_llama.LlamaTokenizer'>. This is expected, and simply means that the `legacy` (previous) behavior will be used so nothing changes for you. If you want to use the new behaviour, set `legacy=False`. This should only be set if you understand what it means, and thoroughly read the reason why this was added as explained in https://github.com/huggingface/transformers/pull/24565
Traceback (most recent call last):
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/home/tesh/.local/lib/python3.10/site-packages/aphrodite/endpoints/openai/api_server.py", line 563, in <module>
    engine = AsyncAphrodite.from_engine_args(engine_args)
  File "/home/tesh/.local/lib/python3.10/site-packages/aphrodite/engine/async_aphrodite.py", line 676, in from_engine_args
    engine = cls(parallel_config.worker_use_ray,
  File "/home/tesh/.local/lib/python3.10/site-packages/aphrodite/engine/async_aphrodite.py", line 341, in __init__
    self.engine = self._init_engine(*args, **kwargs)
  File "/home/tesh/.local/lib/python3.10/site-packages/aphrodite/engine/async_aphrodite.py", line 410, in _init_engine
    return engine_class(*args, **kwargs)
  File "/home/tesh/.local/lib/python3.10/site-packages/aphrodite/engine/aphrodite_engine.py", line 115, in __init__
    self._init_workers()
  File "/home/tesh/.local/lib/python3.10/site-packages/aphrodite/engine/aphrodite_engine.py", line 157, in _init_workers
    self._run_workers("load_model")
  File "/home/tesh/.local/lib/python3.10/site-packages/aphrodite/engine/aphrodite_engine.py", line 1028, in _run_workers
    driver_worker_output = getattr(self.driver_worker,
  File "/home/tesh/.local/lib/python3.10/site-packages/aphrodite/task_handler/worker.py", line 112, in load_model
    self.model_runner.load_model()
  File "/home/tesh/.local/lib/python3.10/site-packages/aphrodite/task_handler/model_runner.py", line 121, in load_model
    self.model = get_model(self.model_config, self.device_config,
  File "/home/tesh/.local/lib/python3.10/site-packages/aphrodite/modeling/loader.py", line 56, in get_model
    raise ValueError(
ValueError: The quantization method gguf is not supported for the current GPU. Minimum capability: 61. Current capability: 60.

I watched it go live on my p100 and not my gpu 0, is there a specific reason as to why it went for that gpu?