You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After downloading the 405B Model, I try to run the tool convert_llama_ckpt.py but I keep getting this error. I am using :
Compute: n2d-highmem-96 with 768 GB of memory on Vertex Workbench
Python version: Python 3.10.14
python3 saxml/saxml/tools/convert_llama_ckpt.py --base /home/jupyter/.llama/checkpoints/Meta-Llama3.1-405B-Instruct/ --pax /home/jupyter/saxmlllama --model-size llama3_405b Loading the base model from /home/jupyter/.llama/checkpoints/Meta-Llama3.1-405B-Instruct/ Loading checkpoint 1 of 8 ... /home/jupyter/saxml/saxml/tools/convert_llama_ckpt.py:116: FutureWarning: You are using torch.loadwithweights_only=False(the current default value), which uses the default pickle module implicitly. It is possible to construct malicious pickle data which will execute arbitrary code during unpickling (See https://github.com/pytorch/pytorch/blob/main/SECURITY.md#untrusted-models for more details). In a future release, the default value forweights_onlywill be flipped toTrue. This limits the functions that could be executed during unpickling. Arbitrary objects will no longer be allowed to be loaded via this mode unless they are explicitly allowlisted by the user via torch.serialization.add_safe_globals. We recommend you start setting weights_only=True for any use case where you don't have full control of the loaded file. Please open an issue on GitHub for any issues related to this experimental feature. checkpoint = torch.load(ckpt_path, map_location='cpu') Loading checkpoint 2 of 8 ... Loading checkpoint 3 of 8 ... Loading checkpoint 4 of 8 ... Loading checkpoint 5 of 8 ... Loading checkpoint 6 of 8 ... Loading checkpoint 7 of 8 ... Loading checkpoint 8 of 8 ... Traceback (most recent call last): File "/home/jupyter/saxml/saxml/tools/convert_llama_ckpt.py", line 239, in <module> convert(args.base_model_path, args.pax_model_path, args.model_size) File "/home/jupyter/saxml/saxml/tools/convert_llama_ckpt.py", line 150, in convert wk = np.reshape(wk, [num_heads * dims_per_head, num_kv_heads, dims_per_head]) File "/opt/conda/lib/python3.10/site-packages/numpy/core/fromnumeric.py", line 285, in reshape return _wrapfunc(a, 'reshape', newshape, order=order) File "/opt/conda/lib/python3.10/site-packages/numpy/core/fromnumeric.py", line 59, in _wrapfunc return bound(*args, **kwds) ValueError: cannot reshape array of size 16777216 into shape (16384,16,128)
The text was updated successfully, but these errors were encountered:
Adding more context here. Here are the layer shapes before converting:
Layer 0 wq shape before reshape: (16384, 16384)
Layer 0 wk shape before reshape: (16384, 1024)
Layer 0 wv shape before reshape: (16384, 1024)
And here is the error:
File "/home/jupyter/saxml/saxml/tools/convert_llama_ckpt-fixed.py", line 219, in
convert(args.base_model_path, args.pax_model_path, args.model_size)
File "/home/jupyter/saxml/saxml/tools/convert_llama_ckpt-fixed.py", line 130, in convert
wk = np.reshape(wk, [num_heads * dims_per_head, num_kv_heads, dims_per_head])
File "/opt/conda/lib/python3.10/site-packages/numpy/core/fromnumeric.py", line 285, in reshape
return _wrapfunc(a, 'reshape', newshape, order=order)
File "/opt/conda/lib/python3.10/site-packages/numpy/core/fromnumeric.py", line 59, in _wrapfunc
return bound(*args, **kwds)
ValueError: cannot reshape array of size 16777216 into shape (16384,16,128)
After downloading the 405B Model, I try to run the tool convert_llama_ckpt.py but I keep getting this error. I am using :
Compute: n2d-highmem-96 with 768 GB of memory on Vertex Workbench
Python version: Python 3.10.14
python3 saxml/saxml/tools/convert_llama_ckpt.py --base /home/jupyter/.llama/checkpoints/Meta-Llama3.1-405B-Instruct/ --pax /home/jupyter/saxmlllama --model-size llama3_405b Loading the base model from /home/jupyter/.llama/checkpoints/Meta-Llama3.1-405B-Instruct/ Loading checkpoint 1 of 8 ... /home/jupyter/saxml/saxml/tools/convert_llama_ckpt.py:116: FutureWarning: You are using
torch.loadwith
weights_only=False(the current default value), which uses the default pickle module implicitly. It is possible to construct malicious pickle data which will execute arbitrary code during unpickling (See https://github.com/pytorch/pytorch/blob/main/SECURITY.md#untrusted-models for more details). In a future release, the default value for
weights_onlywill be flipped to
True. This limits the functions that could be executed during unpickling. Arbitrary objects will no longer be allowed to be loaded via this mode unless they are explicitly allowlisted by the user via
torch.serialization.add_safe_globals. We recommend you start setting
weights_only=Truefor any use case where you don't have full control of the loaded file. Please open an issue on GitHub for any issues related to this experimental feature. checkpoint = torch.load(ckpt_path, map_location='cpu') Loading checkpoint 2 of 8 ... Loading checkpoint 3 of 8 ... Loading checkpoint 4 of 8 ... Loading checkpoint 5 of 8 ... Loading checkpoint 6 of 8 ... Loading checkpoint 7 of 8 ... Loading checkpoint 8 of 8 ... Traceback (most recent call last): File "/home/jupyter/saxml/saxml/tools/convert_llama_ckpt.py", line 239, in <module> convert(args.base_model_path, args.pax_model_path, args.model_size) File "/home/jupyter/saxml/saxml/tools/convert_llama_ckpt.py", line 150, in convert wk = np.reshape(wk, [num_heads * dims_per_head, num_kv_heads, dims_per_head]) File "/opt/conda/lib/python3.10/site-packages/numpy/core/fromnumeric.py", line 285, in reshape return _wrapfunc(a, 'reshape', newshape, order=order) File "/opt/conda/lib/python3.10/site-packages/numpy/core/fromnumeric.py", line 59, in _wrapfunc return bound(*args, **kwds) ValueError: cannot reshape array of size 16777216 into shape (16384,16,128)
The text was updated successfully, but these errors were encountered: