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]: LoRA broken when TP>1 #460

Open
kubernetes-bad opened this issue May 8, 2024 · 0 comments
Open

[Bug]: LoRA broken when TP>1 #460

kubernetes-bad opened this issue May 8, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@kubernetes-bad
Copy link

kubernetes-bad commented May 8, 2024

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

Following error is reported when started with --tensor-parallel-size 2:

File "/app/aphrodite-engine/aphrodite/lora/layers.py", line 791, in forward
     output_parallel = self.apply_weights(input_parallel)
   File "/app/aphrodite-engine/aphrodite/lora/layers.py", line 759, in apply_weights
     _apply_lora(
   File "/app/aphrodite-engine/aphrodite/lora/layers.py", line 80, in _apply_lora
     add_lora(output, x, lora_a_stacked, lora_b_stacked, indices, 0, 1.0)
   File "/app/aphrodite-engine/aphrodite/lora/punica.py", line 93, in add_lora
     punica_kernels.dispatch_bgmv(buffer, x, wa_t_all, indicies, layer_idx, 1.0)
 RuntimeError: CHECK_EQ(w.size(3), h_in) failed. 4096 vs 2048

Error is not happening when starting with --tensor-parallel-size 1 (there's another issue though! #461)

Command to start aphrodite engine:

python3 -u -m aphrodite.endpoints.openai.api_server \
  --host 0.0.0.0 \
  --port 7860 \
  --model kubernetes-bad/chargen-v2 \
  --tensor-parallel-size 2 \
  --gpu-memory-utilization 1 --max-model-len 8192 \
  --dtype bfloat16 \
  --enable-lora --lora-modules lora-vision=/app/models/loras/lora-vision lora-vision-41=/app/models/loras/lora-vision-41 \
  --max-lora-rank 64 \
  --trust-remote-code
@kubernetes-bad kubernetes-bad added the bug Something isn't working label May 8, 2024
@AlpinDale AlpinDale mentioned this issue May 9, 2024
1 task
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

1 participant