intel-analytics / ipex-llm

Accelerate local LLM inference and finetuning (LLaMA, Mistral, ChatGLM, Qwen, Baichuan, Mixtral, Gemma, Phi, MiniCPM, etc.) on Intel XPU (e.g., local PC with iGPU and NPU, discrete GPU such as Arc, Flex and Max); seamlessly integrate with llama.cpp, Ollama, HuggingFace, LangChain, LlamaIndex, GraphRAG, DeepSpeed, vLLM, FastChat, Axolotl, etc.
Apache License 2.0
6.61k stars 1.26k forks source link

codellama issue in bigdl-llm #10053

Closed jiafuzha closed 6 months ago

jiafuzha commented 8 months ago

In bigdl-llm 2.4, transformers version is 4.31. But codellama example needs 4.34.1. In bigdl-llm 2.5.0b20240130, transformers version is still 4.31. @gc-fu told me bigdl-llm 2.5.0b20240130 is compatible with transformers 4.36. As tested, codellama works well with transformers 4.35.0, but not 4.36. In 4.36, the generated just repeats the prompt.

  1. case 1

Prompt: "Once upon a time, " Output: "Once upon a time, Once upon a time, Once upon a time, Once upon a time, Once upon a time, Once upon a time, Once upon a time, Once upon a time, Once upon a time, Once upon a time, Once upon a time, Once upon a time, Once upon a time, Once upon a time"

  1. case 2 Prompt: "What is AI?" Output: "What is AI? What is AI? What is AI? What is AI? What is AI? What is AI? What is AI? What is AI? What is AI? What is AI? What is AI? What is AI? What is AI? What is AI?"
gc-fu commented 8 months ago

Hi, I am working on this and will try to reproduce the issue first.

May I ask what environment are you using? Can you list the output of lscpu or are you using XPU?

jiafuzha commented 8 months ago

It's SPR node. no XPU.

:~$ lscpu 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): 224 On-line CPU(s) list: 0-223 Vendor ID: GenuineIntel Model name: Intel(R) Xeon(R) Platinum 8480L CPU family: 6 Model: 143 Thread(s) per core: 2 Core(s) per socket: 56 Socket(s): 2 Stepping: 7 CPU max MHz: 3800.0000 CPU min MHz: 800.0000 BogoMIPS: 4000.00 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 pdpe 1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl 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 cat_l2 cdp_l3 invpcid_single intel_ppin cdp_l2 ssbd mba ibrs ibpb sti bp ibrs_enhanced fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid cqm rdt_a avx512f avx512dq rdseed adx smap avx512ifma clflushopt clwb intel_pt avx512cd sha_ni avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbmlocal split lock_detect avx_vnni avx512_bf16 wbnoinvd dtherm ida arat pln pts hwp hwp_act_window hwp_epp hwp_pkg_req avx512vbmi umip pku ospke wait pkg avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg tme avx512_vpopcntdq la57 rdpid bus_lock_detect cldemote movdiri movdir 64b enqcmd fsrm md_clear serialize tsxldtrk pconfig arch_lbr amx_bf16 avx512_fp16 amx_tile amx_int8 flush_l1d arch_capabilities Caches (sum of all): L1d: 5.3 MiB (112 instances) L1i: 3.5 MiB (112 instances) L2: 224 MiB (112 instances) L3: 210 MiB (2 instances) NUMA: NUMA node(s): 2 NUMA node0 CPU(s): 0-55,112-167 NUMA node1 CPU(s): 56-111,168-223 Vulnerabilities: Gather data sampling: Not affected Itlb multihit: Not affected L1tf: Not affected Mds: Not affected Meltdown: Not affected Mmio stale data: Not affected Retbleed: Not affected Spec rstack overflow: Not affected Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl and seccomp Spectre v1: Mitigation; usercopy/swapgs barriers and __user pointer sanitization Spectre v2: Mitigation; Enhanced IBRS, IBPB conditional, RSB filling, PBRSB-eIBRS SW sequence Srbds: Not affected Tsx async abort: Not affected

gc-fu commented 8 months ago

The transformer version 4.34.1 works normally for codellama as mentioned in our examples.

For transformer version 4.36, @jenniew can you have a look on this and fix this issue, thanks :smiley:

Updates will be listed in this issue once we fix the issue.

jenniew commented 8 months ago

On SPR I tested bigdl llm with codellama-7b-hf model on transformers 4.36.2. -------------------- Prompt -------------------- Once upon a time

-------------------- Output -------------------- Once upon a time Once upon a time, there was a king who had a daughter. She was very beautiful, and she was very smart. She was very good at math -------------------- Prompt -------------------- What is AI -------------------- Output -------------------- What is AI Artificial intelligence (AI) is the ability of a computer to learn and make decisions without being explicitly programmed. AI is a field The result seems OK. Can you try latest version of bigdl-llm and check if tokenizer/prompt is OK?
jenniew commented 8 months ago

I test on SPR with transformers 4.36.2 -------------------- Prompt -------------------- Once upon a time

-------------------- Output -------------------- Once upon a time Once upon a time, there was a king who had a daughter. She was very beautiful, and she was very smart. She was very good at math -------------------- Prompt -------------------- What is AI -------------------- Output -------------------- What is AI Artificial intelligence (AI) is the ability of a computer to learn and make decisions without being explicitly programmed. AI is a field It seems OK. Can you try the latest version of bigdl-llm and check if the tokenizer/prompt is OK?