PygmalionAI/aphrodite-engine

[Bug]: LoRA fails to load

kubernetes-bad opened this issue · 1 comments

Your current environment

root@6eb559dd0e72:/app/aphrodite-engine# python3 env.py
Collecting environment information...
PyTorch version: 2.2.1+cu121
Is debug build: False
CUDA used to build PyTorch: 12.1
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: Could not collect 
CMake version: version 3.29.2
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-105-generic-x86_64-with-glibc2.35
Is CUDA available: True
CUDA runtime version: 12.1.105
CUDA_MODULE_LOADING set to: LAZY
GPU models and configuration: GPU 0: NVIDIA RTX A4000
Nvidia driver version: 545.23.08
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):                             32
On-line CPU(s) list:                0-31
Vendor ID:                          GenuineIntel
Model name:                         Intel(R) Xeon(R) CPU E5-2630L v3 @ 1.80GHz
CPU family:                         6
Model:                              63
Thread(s) per core:                 2
Core(s) per socket:                 8
Socket(s):                          2
Stepping:                           2
CPU max MHz:                        2900.0000
CPU min MHz:                        1200.0000
BogoMIPS:                           3591.66
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 ida arat pln pts md_clear flush_l1d
Virtualization:                     VT-x
L1d cache:                          512 KiB (16 instances)
L1i cache:                          512 KiB (16 instances)
L2 cache:                           4 MiB (16 instances)
L3 cache:                           40 MiB (2 instances)
NUMA node(s):                       2
NUMA node0 CPU(s):                  0-7,16-23
NUMA node1 CPU(s):                  8-15,24-31
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] numpy==1.26.4
[pip3] torch==2.2.1
[pip3] triton==2.2.0
[conda] Could not collect ROCM Version: Could not collect 
Aphrodite Version: 0.5.2
Aphrodite Build Flags:
CUDA Archs: 8.6; ROCm: Disabled

🐛 Describe the bug

Happens right after the engine start - no request with lora specified is needed.

File "/app/aphrodite-engine/aphrodite/task_handler/model_runner.py", line 948, in profile_run
     self.execute_model(seqs, kv_caches)
   File "/usr/local/lib/python3.10/dist-packages/torch/utils/_contextlib.py", line 115, in decorate_context
     return func(*args, **kwargs)
   File "/app/aphrodite-engine/aphrodite/task_handler/model_runner.py", line 871, in execute_model
     logits = self.model.compute_logits(hidden_states, sampling_metadata)
   File "/app/aphrodite-engine/aphrodite/modeling/models/llama.py", line 441, in compute_logits
     logits = self.logits_processor(self.lm_head, hidden_states,
   File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1511, in _wrapped_call_impl
     return self._call_impl(*args, **kwargs)
   File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1520, in _call_impl
     return forward_call(*args, **kwargs)
   File "/app/aphrodite-engine/aphrodite/lora/layers.py", line 978, in forward
     return type(self.base_layer).forward(self, *args, **kwargs)
   File "/app/aphrodite-engine/aphrodite/modeling/layers/logits_processor.py", line 53, in forward
    logits = self._get_logits(hidden_states, lm_head, embedding_bias)
   File "/app/aphrodite-engine/aphrodite/lora/layers.py", line 933, in _get_logits
     logits = torch.matmul(hidden_states, embedding.t())
   File "/usr/local/lib/python3.10/dist-packages/torch/nn/modules/module.py", line 1688, in __getattr__
     raise AttributeError(f"'{type(self).__name__}' object has no attribute '{name}'")
 AttributeError: 'ParallelLMHead' object has no attribute 't'

Command used to start aphrodite:

python3 -u -m aphrodite.endpoints.openai.api_server \
  --model kubernetes-bad/chargen-v2 \
  --tensor-parallel-size 1 \
  --gpu-memory-utilization 1 \
  --max-model-len 8192 \
  --dtype bfloat16 \
  --enable-lora \
  --lora-modules lora-vision=/app/models/loras/lora-vision \
  --max-lora-rank 64 \
  --trust-remote-code

Can confirm it's fixed!