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]: Can't load/compile Mixtral-8x7B-Instruct-v0.1 on TPU #10963

Closed
1 task done
hosseinsarshar opened this issue Dec 6, 2024 · 3 comments · Fixed by #11764
Closed
1 task done

[Bug]: Can't load/compile Mixtral-8x7B-Instruct-v0.1 on TPU #10963

hosseinsarshar opened this issue Dec 6, 2024 · 3 comments · Fixed by #11764
Labels
bug Something isn't working

Comments

@hosseinsarshar
Copy link

Your current environment

The output of `python collect_env.py`
Collecting environment information...
PyTorch version: 2.6.0.dev20241126+cpu
Is debug build: False
CUDA used to build PyTorch: None
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.31.1
Libc version: glibc-2.35

Python version: 3.10.15 (main, Oct  3 2024, 07:27:34) [GCC 11.2.0] (64-bit runtime)
Python platform: Linux-6.8.0-1015-gcp-x86_64-with-glibc2.35
Is CUDA available: False
CUDA runtime version: No CUDA
CUDA_MODULE_LOADING set to: N/A
GPU models and configuration: No CUDA
Nvidia driver version: No CUDA
cuDNN version: No CUDA
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:                        52 bits physical, 57 bits virtual
Byte Order:                           Little Endian
CPU(s):                               180
On-line CPU(s) list:                  0-179
Vendor ID:                            AuthenticAMD
Model name:                           AMD EPYC 9B14
CPU family:                           25
Model:                                17
Thread(s) per core:                   1
Core(s) per socket:                   90
Socket(s):                            2
Stepping:                             1
BogoMIPS:                             5199.99
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 nopl nonstop_tsc cpuid extd_apicid tsc_known_freq pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx f16c rdrand hypervisor lahf_lm cmp_legacy cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw topoext ssbd ibrs ibpb stibp vmmcall fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid avx512f avx512dq rdseed adx smap avx512ifma clflushopt clwb avx512cd sha_ni avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves avx512_bf16 clzero xsaveerptr wbnoinvd arat avx512vbmi umip avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg avx512_vpopcntdq rdpid fsrm
Hypervisor vendor:                    KVM
Virtualization type:                  full
L1d cache:                            5.6 MiB (180 instances)
L1i cache:                            5.6 MiB (180 instances)
L2 cache:                             180 MiB (180 instances)
L3 cache:                             768 MiB (24 instances)
NUMA node(s):                         2
NUMA node0 CPU(s):                    0-89
NUMA node1 CPU(s):                    90-179
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 Reg file data sampling: Not affected
Vulnerability Retbleed:               Not affected
Vulnerability Spec rstack overflow:   Mitigation; Safe RET
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 disabled; RSB filling; PBRSB-eIBRS Not affected; BHI Not affected
Vulnerability Srbds:                  Not affected
Vulnerability Tsx async abort:        Not affected

Versions of relevant libraries:
[pip3] numpy==1.26.4
[pip3] pyzmq==26.2.0
[pip3] torch==2.6.0.dev20241126+cpu
[pip3] torch-xla==2.6.0+git39e67b5
[pip3] torchvision==0.20.0.dev20241126+cpu
[pip3] transformers==4.46.3
[conda] numpy                     1.26.4                   pypi_0    pypi
[conda] pyzmq                     26.2.0                   pypi_0    pypi
[conda] torch                     2.6.0.dev20241126+cpu          pypi_0    pypi
[conda] torch-xla                 2.6.0+git39e67b5          pypi_0    pypi
[conda] torchvision               0.20.0.dev20241126+cpu          pypi_0    pypi
[conda] transformers              4.46.3                   pypi_0    pypi
ROCM Version: Could not collect
Neuron SDK Version: N/A
vLLM Version: 0.6.4.post2.dev207+ga4c4daf3
vLLM Build Flags:
CUDA Archs: Not Set; ROCm: Disabled; Neuron: Disabled
GPU Topology:
Could not collect

LD_LIBRARY_PATH=/home/hosseins/miniconda3/envs/vllm/lib/python3.10/site-packages/cv2/../../lib64:

Model Input Dumps

No response

🐛 Describe the bug

Can't load/compile Mixtral-8x7B-Instruct-v0.1 on TPU

I'm trying to run Mixtral-8x7B-Instruct-v0.1 on a TPU v6e-8 but it fails at the compilation phase - here is the launcher command:

vllm serve "mistralai/Mixtral-8x7B-Instruct-v0.1" --download_dir /dev/shm --num-scheduler-steps 4 --swap-space 16 --disable-log-requests --tensor_parallel_size=8 --max-model-len=2048

Here are the error logs - (I uploaded them as the trace is long):

Error-log-short.txt

Verbose error:
mixtral-error-log-verbose.txt

My setup:

pip list | grep torch
torch                             2.6.0.dev20241126+cpu
torch-xla                         2.6.0+git39e67b5
torchvision                       0.20.0.dev20241126+cpu

pip list | grep libtpu
libtpu_nightly                    0.1.dev20241122+nightly

pip list | grep jax
jax                               0.4.36.dev20241122
jaxlib                            0.4.36.dev20241122

Before submitting a new issue...

  • Make sure you already searched for relevant issues, and asked the chatbot living at the bottom right corner of the documentation page, which can answer lots of frequently asked questions.
@hosseinsarshar hosseinsarshar added the bug Something isn't working label Dec 6, 2024
@DarkLight1337 DarkLight1337 changed the title [Bug]: [Bug]: Can't load/compile Mixtral-8x7B-Instruct-v0.1 on TPU Dec 7, 2024
@avshalomman
Copy link
Contributor

changing x = x * topk_weights.unsqueeze_ to the non in-place version x = x * topk_weights.unsqueeze fixes compilation, but the results are bad.
@robertgshaw2-neuralmagic seems like the pallas moe implementation is broken, I'm taking a look but if there's anyone with more expertise that can also take a look it will probably be more effective.

@bvrockwell
Copy link
Contributor

cc @lsy323 (I don't know everyone's handle on github but will follow up on this!)

@hosseinsarshar
Copy link
Author

Thanks for the fix - I tested the fix to serve Mixtral-8x7B and it's working as expected.

$ vllm serve "mistralai/Mixtral-8x7B-Instruct-v0.1" --download_dir /dev/shm --num-scheduler-steps 4 --swap-space 16 --disable-log-requests --tensor_parallel_size=8 --max-model-len=2048 --tokenizer=mistralai/Mixtral-8x7B-Instruct-v0.1


$ python benchmarks/benchmark_serving.py \
    --backend vllm \
    --model "mistralai/Mixtral-8x7B-Instruct-v0.1"  \
    --dataset-name sharegpt \
    --dataset-path ~/data/ShareGPT_V3_unfiltered_cleaned_split.json  \
    --num-prompts 1000
INFO 01-14 00:57:14 __init__.py:179] Automatically detected platform tpu.
Namespace(backend='vllm', base_url=None, host='localhost', port=8000, endpoint='/v1/completions', dataset=None, dataset_name='sharegpt', dataset_path='/home/hosseins/data/ShareGPT_V3_unfiltered_cleaned_split.json', max_concurrency=None, model='mistralai/Mixtral-8x7B-Instruct-v0.1', tokenizer=None, best_of=1, use_beam_search=False, num_prompts=1000, logprobs=None, request_rate=inf, burstiness=1.0, seed=0, trust_remote_code=False, disable_tqdm=False, profile=False, save_result=False, metadata=None, result_dir=None, result_filename=None, ignore_eos=False, percentile_metrics='ttft,tpot,itl', metric_percentiles='99', goodput=None, sonnet_input_len=550, sonnet_output_len=150, sonnet_prefix_len=200, sharegpt_output_len=None, random_input_len=1024, random_output_len=128, random_range_ratio=1.0, random_prefix_len=0, hf_subset=None, hf_split=None, hf_output_len=None, tokenizer_mode='auto')
/home/hosseins/vllm-moe-fix/benchmarks/benchmark_serving.py:793: FutureWarning: It is strongly recommended to run mistral models with `--tokenizer-mode "mistral"` to ensure correct encoding and decoding.
  tokenizer = get_tokenizer(tokenizer_id,
Starting initial single prompt test run...
Initial test run completed. Starting main benchmark run...
Traffic request rate: inf
Burstiness factor: 1.0 (Poisson process)
Maximum request concurrency: None
100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1000/1000 [01:06<00:00, 15.09it/s]
============ Serving Benchmark Result ============
Successful requests:                     923       
Benchmark duration (s):                  66.29     
Total input tokens:                      212217    
Total generated tokens:                  34974     
Request throughput (req/s):              13.92     
Output token throughput (tok/s):         527.59    
Total Token throughput (tok/s):          3728.94   
---------------Time to First Token----------------
Mean TTFT (ms):                          19743.75  
Median TTFT (ms):                        18576.39  
P99 TTFT (ms):                           44316.19  
-----Time per Output Token (excl. 1st token)------
Mean TPOT (ms):                          5427.93   
Median TPOT (ms):                        1891.74   
P99 TPOT (ms):                           35799.81  
---------------Inter-token Latency----------------
Mean ITL (ms):                           139.99    
Median ITL (ms):                         21.28     
P99 ITL (ms):                            3105.49   
==================================================

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

Successfully merging a pull request may close this issue.

3 participants