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 is massively slower after triton punica kernel upgrade #735

Open
Nero10578 opened this issue Sep 15, 2024 · 2 comments
Open
Labels
bug Something isn't working

Comments

@Nero10578
Copy link

Nero10578 commented Sep 15, 2024

Your current environment

Collecting environment information...
WARNING:  Failed to import from aphrodite._C with /home/owen/aphro-latest/aphrodite-engine/aphrodite/_C.abi3.so: undefined symbol: _ZN5torch3jit11parseSchemaERKSs
PyTorch version: 2.4.0+cu121
Is debug build: False
CUDA used to build PyTorch: 12.1
ROCM used to build PyTorch: N/A

OS: Ubuntu 22.04.5 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.11.9 (main, Apr 19 2024, 16:48:06) [GCC 11.2.0] (64-bit runtime)
Python platform: Linux-6.8.0-40-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 GeForce RTX 3090 Ti
GPU 1: NVIDIA GeForce RTX 3090 Ti

Nvidia driver version: 550.107.02
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):                               40
On-line CPU(s) list:                  0-39
Vendor ID:                            GenuineIntel
Model name:                           Intel(R) Xeon(R) CPU E5-2679 v4 @ 2.50GHz
CPU family:                           6
Model:                                79
Thread(s) per core:                   2
Core(s) per socket:                   20
Socket(s):                            1
Stepping:                             1
CPU max MHz:                          3300,0000
CPU min MHz:                          1200,0000
BogoMIPS:                             5049.61
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 3dnowprefetch cpuid_fault epb cat_l3 cdp_l3 pti intel_ppin ssbd ibrs ibpb stibp tpr_shadow flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm cqm rdt_a rdseed adx smap intel_pt xsaveopt cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local dtherm ida arat pln pts vnmi md_clear flush_l1d
Virtualization:                       VT-x
L1d cache:                            640 KiB (20 instances)
L1i cache:                            640 KiB (20 instances)
L2 cache:                             5 MiB (20 instances)
L3 cache:                             50 MiB (1 instance)
NUMA node(s):                         1
NUMA node0 CPU(s):                    0-39
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 Reg file data sampling: Not affected
Vulnerability Retbleed:               Not affected
Vulnerability Spec rstack overflow:   Not affected
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 conditional; RSB filling; PBRSB-eIBRS Not affected; BHI Not affected
Vulnerability Srbds:                  Not affected
Vulnerability Tsx async abort:        Mitigation; Clear CPU buffers; SMT vulnerable

Versions of relevant libraries:
[pip3] numpy==1.26.4
[pip3] nvidia-nccl-cu12==2.20.5
[pip3] pyzmq==26.2.0
[pip3] torch==2.4.0
[pip3] torchaudio==2.4.1
[pip3] torchvision==0.19.0
[pip3] transformers==4.44.1
[pip3] triton==3.0.0
[conda] blas                      1.0                         mkl  
[conda] ffmpeg                    4.3                  hf484d3e_0    pytorch
[conda] libjpeg-turbo             2.0.0                h9bf148f_0    pytorch
[conda] mkl                       2023.1.0         h213fc3f_46344  
[conda] mkl-service               2.4.0           py311h5eee18b_1  
[conda] mkl_fft                   1.3.10          py311h5eee18b_0  
[conda] mkl_random                1.2.7           py311ha02d727_0  
[conda] nccl                      2.21.5.1             ha515578_0  
[conda] numpy                     1.26.4                   pypi_0    pypi
[conda] nvidia-nccl-cu12          2.20.5                   pypi_0    pypi
[conda] pytorch-cuda              12.1                 ha16c6d3_5    pytorch
[conda] pytorch-mutex             1.0                        cuda    pytorch
[conda] pyzmq                     26.2.0                   pypi_0    pypi
[conda] torch                     2.4.0                    pypi_0    pypi
[conda] torchaudio                2.4.1               py311_cu121    pytorch
[conda] torchtriton               3.0.0                     py311    pytorch
[conda] torchvision               0.19.0                   pypi_0    pypi
[conda] transformers              4.44.1                   pypi_0    pypi
ROCM Version: Could not collect
Neuron SDK Version: N/A
Aphrodite Version: 0.6.1.post1
Aphrodite Build Flags:
CUDA Archs: Not Set; ROCm: Disabled; Neuron: Disabled
GPU Topology:
GPU0    GPU1    CPU Affinity    NUMA Affinity   GPU NUMA ID
GPU0     X      NV4     0-39    0               N/A
GPU1    NV4      X      0-39    0               N/A

Legend:

  X    = Self
  SYS  = Connection traversing PCIe as well as the SMP interconnect between NUMA nodes (e.g., QPI/UPI)
  NODE = Connection traversing PCIe as well as the interconnect between PCIe Host Bridges within a NUMA node
  PHB  = Connection traversing PCIe as well as a PCIe Host Bridge (typically the CPU)
  PXB  = Connection traversing multiple PCIe bridges (without traversing the PCIe Host Bridge)
  PIX  = Connection traversing at most a single PCIe bridge
  NV#  = Connection traversing a bonded set of # NVLinks

🐛 Describe the bug

After the triton punica kernel upgrade which is great for increasing the supported vocab size to allow Nemo to run, the speed of generation is massively slowed down.

Here is an example with Llama 3.1 8B BF16 with LORA

After Triton Punica kernel:

INFO:     Avg prompt throughput: 0.0 tokens/s, Avg generation throughput: 11.9 tokens/s, Running: 1 reqs, Swapped: 0 reqs, Pending: 0 reqs, GPU KV cache usage: 0.1%, CPU KV cache usage: 
0.0%.

Before Triton Punica Kernel:

INFO:     Avg prompt throughput: 0.0 tokens/s, Avg generation throughput: 22.4 tokens/s, Running: 1 reqs, Swapped: 0 reqs, Pending: 0 reqs, GPU KV cache usage: 0.1%, CPU KV cache usage: 
0.0%.
@Nero10578 Nero10578 added the bug Something isn't working label Sep 15, 2024
@AlpinDale
Copy link
Member

I've noticed the same, unfortunately. I've been looking into alternatives, probably bring back the old kernels as an optional method to use for lora ops, maybe toggled with env variables the same as attention backends.

The biggest issue we had with the old kernels were how inflexible and massive they were. They'd take longer than all other kernels combined to build, and the binary would take more storage, inflating the wheel size. They were also very strict about the shape sizes, so we had to compile a separate kernel for every data type combination, vocab size, and rank. I might need to bring them back but put the kernels in a separate repo and pull them as a dependency.

@Nero10578
Copy link
Author

Nero10578 commented Sep 15, 2024

I've noticed the same, unfortunately. I've been looking into alternatives, probably bring back the old kernels as an optional method to use for lora ops, maybe toggled with env variables the same as attention backends.

The biggest issue we had with the old kernels were how inflexible and massive they were. They'd take longer than all other kernels combined to build, and the binary would take more storage, inflating the wheel size. They were also very strict about the shape sizes, so we had to compile a separate kernel for every data type combination, vocab size, and rank. I might need to bring them back but put the kernels in a separate repo and pull them as a dependency.

Yea maybe make the old kernels an option since the new kernel is only the most benefit if you need higher rank/vocab size like the Nemo LORAs. The new triton kernels are just literally 1/2 the speed and barely utilize the GPU resources which is insanely bad. I don't think it's worth it if your loras work on the older punica kernels.

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

2 participants