juncongmoo / chatllama Goto Github PK
View Code? Open in Web Editor NEWChatLLaMA ๐ข Open source implementation for LLaMA-based ChatGPT runnable in a single GPU. 15x faster training process than ChatGPT
ChatLLaMA ๐ข Open source implementation for LLaMA-based ChatGPT runnable in a single GPU. 15x faster training process than ChatGPT
Few days ago, they published the model to huggingface, which means there is no need to submit a form now.
https://huggingface.co/decapoda-research/llama-65b-hf
And the huggingface transformer is already implemented https://github.com/zphang/transformers/tree/llama_push, maybe it will be in the package formally in the near future.
I just wonder whether it is time consuming to support/change to this pipeline...
Another thing is about quantization, I found this repo and execute the benchmarks there, quite interesting. I am not an expert... Just as a reference https://github.com/qwopqwop200/GPTQ-for-LLaMa.
The following code uses the action logit value for the optimal action, and then diff against the log prob of the action from the last actor model iteration. Should we instead pick the action from old_actions
instead just max
, so that we are comparing the prob for the same action from two iterations?
# get action log prob
actions_prob = (
torch.softmax(actions_logits, dim=-1).max(dim=-1).values
)
Hi!
The license link given in the README just leads to a 404 page as it seems to have been moved/removed: https://github.com/nebuly-ai/nebullvm/blob/main/LICENSE
I try to train ACTOR model with default deepspeed architecture in LLaMA 7B model.
However, when my batch size is 1, the code is OK. It would crash with more than 2 batch size.
Its Error report:
/root/InstructUIE/run_llama/nebullvm/apps/accelerate/chatllama/chatllama/llama_model.py:29 โ โ 3 in forward โ โ โ โ 290 โ โ โ โ 291 โ โ bsz, seqlen, _ = x.shape โ โ 292 โ โ print(x.shape) โ โ โฑ 293 โ โ xq, xk, xv = self.wq(x), self.wk(x), self.wv(x) โ โ 294 โ โ โ โ 295 โ โ xq = xq.view(bsz, seqlen, self.n_local_heads, self.head_dim) โ โ 296 โ โ xk = xk.view(bsz, seqlen, self.n_local_heads, self.head_dim) โ โ โ โ /opt/conda/lib/python3.7/site-packages/torch/nn/modules/module.py:1194 in _call_impl โ โ โ โ 1191 โ โ # this function, and just call forward. โ โ 1192 โ โ if not (self._backward_hooks or self._forward_hooks or self._forward_pre_ho โ โ 1193 โ โ โ โ or _global_forward_hooks or _global_forward_pre_hooks): โ โ โฑ 1194 โ โ โ return forward_call(*input, **kwargs) โ โ 1195 โ โ # Do not call functions when jit is used โ โ 1196 โ โ full_backward_hooks, non_full_backward_hooks = [], [] โ โ 1197 โ โ if self._backward_hooks or _global_backward_hooks: โ โ โ โ /opt/conda/lib/python3.7/site-packages/torch/nn/modules/linear.py:114 in forward โ โ โ โ 111 โ โ โ init.uniform_(self.bias, -bound, bound) โ โ 112 โ โ โ 113 โ def forward(self, input: Tensor) -> Tensor: โ โ โฑ 114 โ โ return F.linear(input, self.weight, self.bias) โ โ 115 โ โ โ 116 โ def extra_repr(self) -> str: โ โ 117 โ โ return 'in_features={}, out_features={}, bias={}'.format( โ โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ RuntimeError: CUDA error: CUBLAS_STATUS_EXECUTION_FAILED when calling
cublasGemmEx( handle,
opa, opb, m, n, k, &falpha, a, CUDA_R_16BF, lda, b, CUDA_R_16BF, ldb, &fbeta, c, CUDA_R_16BF,
ldc, CUDA_R_32F, CUBLAS_GEMM_DFALT_TENSOR_OP) terminate called after throwing an instance of 'c10::Error' what(): CUDA error: device-side assert triggered CUDA kernel errors might be asynchronously reported at some other API call,so the stacktrace below might be incorrect. For debugging consider passing CUDA_LAUNCH_BLOCKING=1.
I checked the tensor shape and linear layer, its OK, but why?
Here is my deepspeed config file
{ "train_micro_batch_size_per_gpu": 2, "gradient_accumulation_steps": 64, "bfloat16": { "enabled": true }, "optimizer": { "type": "AdamW", "params": { "lr": 0.0001, "betas": [0.9, 0.999], "eps": 1e-8, "weight_decay": 0.1 } }, "zero_optimization": { "stage": 2, "offload_optimizer": { "device": "cpu", "pin_memory": true }, "offload_param": { "device": "cpu", "pin_memory": true }, "allgather_partitions": true, "allgather_bucket_size": 2e8, "overlap_comm": true, "reduce_scatter": true, "reduce_bucket_size": 2e8, "contiguous_gradients": true } }
My GPU are A100PCIe *8, here is my environment:
`
(base) root@61e731354b65:~# nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2022 NVIDIA Corporation
Built on Tue_May__3_18:49:52_PDT_2022
Cuda compilation tools, release 11.7, V11.7.64
Build cuda_11.7.r11.7/compiler.31294372_0
PyTorch version: 1.13.1+cu117
Is debug build: False
CUDA used to build PyTorch: 11.7
ROCM used to build PyTorch: N/A
OS: Ubuntu 18.04.6 LTS (x86_64)
GCC version: (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
Clang version: Could not collect
CMake version: Could not collect
Libc version: glibc-2.17
Python version: 3.7.13 (default, Mar 29 2022, 02:18:16) [GCC 7.5.0] (64-bit runtime)
Python platform: Linux-3.10.0-1160.71.1.el7.x86_64-x86_64-with-debian-buster-sid
Is CUDA available: True
CUDA runtime version: 11.7.64
CUDA_MODULE_LOADING set to: LAZY
GPU models and configuration:
GPU 0: NVIDIA A100 80GB PCIe
GPU 1: NVIDIA A100 80GB PCIe
GPU 2: NVIDIA A100 80GB PCIe
GPU 3: NVIDIA A100 80GB PCIe
GPU 4: NVIDIA A100 80GB PCIe
GPU 5: NVIDIA A100 80GB PCIe
GPU 6: NVIDIA A100 80GB PCIe
GPU 7: NVIDIA A100 80GB PCIe
Nvidia driver version: 510.54
cuDNN version: Probably one of the following:
/usr/lib/x86_64-linux-gnu/libcudnn.so.8.2.0
/usr/lib/x86_64-linux-gnu/libcudnn_adv_infer.so.8.2.0
/usr/lib/x86_64-linux-gnu/libcudnn_adv_train.so.8.2.0
/usr/lib/x86_64-linux-gnu/libcudnn_cnn_infer.so.8.2.0
/usr/lib/x86_64-linux-gnu/libcudnn_cnn_train.so.8.2.0
/usr/lib/x86_64-linux-gnu/libcudnn_ops_infer.so.8.2.0
/usr/lib/x86_64-linux-gnu/libcudnn_ops_train.so.8.2.0
/usr/local/cuda-11.7/targets/x86_64-linux/lib/libcudnn.so.8
/usr/local/cuda-11.7/targets/x86_64-linux/lib/libcudnn_adv_infer.so.8
/usr/local/cuda-11.7/targets/x86_64-linux/lib/libcudnn_adv_train.so.8
/usr/local/cuda-11.7/targets/x86_64-linux/lib/libcudnn_cnn_infer.so.8
/usr/local/cuda-11.7/targets/x86_64-linux/lib/libcudnn_cnn_train.so.8
/usr/local/cuda-11.7/targets/x86_64-linux/lib/libcudnn_ops_infer.so.8
/usr/local/cuda-11.7/targets/x86_64-linux/lib/libcudnn_ops_train.so.8
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
Byte Order: Little Endian
CPU(s): 72
On-line CPU(s) list: 0-71
Thread(s) per core: 2
Core(s) per socket: 18
Socket(s): 2
NUMA node(s): 2
Vendor ID: GenuineIntel
CPU family: 6
Model: 85
Model name: Intel(R) Xeon(R) Gold 6154 CPU @ 3.00GHz
Stepping: 4
CPU MHz: 1199.890
CPU max MHz: 3700.0000
CPU min MHz: 1200.0000
BogoMIPS: 6000.00
Virtualization: VT-x
L1d cache: 32K
L1i cache: 32K
L2 cache: 1024K
L3 cache: 25344K
NUMA node0 CPU(s): 0-17,36-53
NUMA node1 CPU(s): 18-35,54-71
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 art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu 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 epb cat_l3 cdp_l3 invpcid_single intel_ppin intel_pt ssbd mba ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm cqm mpx rdt_a avx512f avx512dq rdseed adx smap clflushopt clwb avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local dtherm ida arat pln pts hwp hwp_act_window hwp_epp hwp_pkg_req pku ospke md_clear spec_ctrl intel_stibp flush_l1d arch_capabilities
Versions of relevant libraries:
[pip3] numpy==1.21.5
[pip3] torch==1.13.1+cu117
[pip3] torchaudio==0.13.1+cu117
[pip3] torchelastic==0.2.0
[pip3] torchtext==0.13.0
[pip3] torchvision==0.14.1+cu117
[conda] blas 1.0 mkl
[conda] cudatoolkit 11.3.1 ha36c431_9 nvidia
[conda] ffmpeg 4.3 hf484d3e_0 pytorch
[conda] mkl 2021.4.0 h06a4308_640
[conda] mkl-service 2.4.0 py37h7f8727e_0
[conda] mkl_fft 1.3.1 py37hd3c417c_0
[conda] mkl_random 1.2.2 py37h51133e4_0
[conda] numpy 1.21.5 py37he7a7128_2
[conda] numpy-base 1.21.5 py37hf524024_2
[conda] pytorch-mutex 1.0 cuda pytorch
[conda] torch 1.13.1+cu117 pypi_0 pypi
[conda] torchaudio 0.13.1+cu117 pypi_0 pypi
[conda] torchelastic 0.2.0 pypi_0 pypi
[conda] torchtext 0.13.0 py37 pytorch
[conda] torchvision 0.14.1+cu117 pypi_0 pypi`
What happened?
Is it necessary to have a critic model ?
I got an error:
ImportError: cannot import name 'ConversationalBufferWindowMemory' from 'langchain.chains.conversation.memory' ([/Users/nguyens/Library/Python/3.9/lib/python/site-packages/langchain/chains/conversation/memory.py](https://file+.vscode-resource.vscode-cdn.net/Users/nguyens/Library/Python/3.9/lib/python/site-packages/langchain/chains/conversation/memory.py))
Can anyone please helps to fix?
Hi @juncongmoo,
I noticed that you created this library copy-pasting our official chatllama repo without even mentioning our work. Please note that this is not permitted under an Apache 2.0 license. Please take immediate action or we will have to report you to GitHub to protect the open source community from this fraudolent behaviour.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.