Comments (7)
Have you tried adding
"attention_bias": false
to the config.json?
I used a local volume to save the model and altered the config as described. It works (tested with image ghcr.io/huggingface/text-generation-inference:2.0.3).
from text-generation-inference.
I encounter this as well. I believe it arises from the recent addition of Granite support after Phi-3 support in TGI 2.0.3. See here.
from text-generation-inference.
@OjoDojoJo What's your full command line? I'm running this command on a aws g6.48xlarge
docker run -it --rm --name tgi -p 8080:80 --gpus all --shm-size 2g \
-v /models/:/models/ ghcr.io/huggingface/text-generation-inference:2.0.3 \
--model-id /models/microsoft/Phi-3-medium-128k-instruct/ \
--hostname 0.0.0.0 --trust-remote-code --num-shard 8 \
--max-input-length=9000 --max-total-tokens=9500 \
--max-batch-prefill-tokens=9000
And I'm getting this error:
[rank1]: Traceback (most recent call last):
[rank1]: File "/opt/conda/bin/text-generation-server", line 8, in <module>
[rank1]: sys.exit(app())
[rank1]: File "/opt/conda/lib/python3.10/site-packages/text_generation_server/cli.py", line 90, in serve
[rank1]: server.serve(
[rank1]: File "/opt/conda/lib/python3.10/site-packages/text_generation_server/server.py", line 258, in serve
[rank1]: asyncio.run(
[rank1]: File "/opt/conda/lib/python3.10/asyncio/runners.py", line 44, in run
[rank1]: return loop.run_until_complete(main)
[rank1]: File "/opt/conda/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
[rank1]: return future.result()
[rank1]: File "/opt/conda/lib/python3.10/site-packages/text_generation_server/server.py", line 222, in serve_inner
[rank1]: model = get_model(
[rank1]: File "/opt/conda/lib/python3.10/site-packages/text_generation_server/models/__init__.py", line 420, in get_model
[rank1]: return FlashLlama(
[rank1]: File "/opt/conda/lib/python3.10/site-packages/text_generation_server/models/flash_llama.py", line 84, in __init__
[rank1]: model = FlashLlamaForCausalLM(prefix, config, weights)
[rank1]: File "/opt/conda/lib/python3.10/site-packages/text_generation_server/models/custom_modeling/flash_llama_modeling.py", line 368, in __init__
[rank1]: self.model = FlashLlamaModel(prefix, config, weights)
[rank1]: File "/opt/conda/lib/python3.10/site-packages/text_generation_server/models/custom_modeling/flash_llama_modeling.py", line 292, in __init__
[rank1]: [
[rank1]: File "/opt/conda/lib/python3.10/site-packages/text_generation_server/models/custom_modeling/flash_llama_modeling.py", line 293, in <listcomp>
[rank1]: FlashLlamaLayer(
[rank1]: File "/opt/conda/lib/python3.10/site-packages/text_generation_server/models/custom_modeling/flash_llama_modeling.py", line 232, in __init__
[rank1]: self.self_attn = FlashLlamaAttention(
[rank1]: File "/opt/conda/lib/python3.10/site-packages/text_generation_server/models/custom_modeling/flash_llama_modeling.py", line 108, in __init__
[rank1]: self.query_key_value = load_attention(config, prefix, weights)
[rank1]: File "/opt/conda/lib/python3.10/site-packages/text_generation_server/models/custom_modeling/flash_llama_modeling.py", line 45, in load_attention
[rank1]: return TensorParallelColumnLinear.load_multi(
[rank1]: File "/opt/conda/lib/python3.10/site-packages/text_generation_server/layers/tensor_parallel.py", line 115, in load_multi
[rank1]: weight = weights.get_multi_weights_col(
[rank1]: File "/opt/conda/lib/python3.10/site-packages/text_generation_server/utils/weights.py", line 264, in get_multi_weights_col
[rank1]: w = [self.get_sharded(f"{p}.weight", dim=0) for p in prefixes]
[rank1]: File "/opt/conda/lib/python3.10/site-packages/text_generation_server/utils/weights.py", line 264, in <listcomp>
[rank1]: w = [self.get_sharded(f"{p}.weight", dim=0) for p in prefixes]
[rank1]: File "/opt/conda/lib/python3.10/site-packages/text_generation_server/utils/weights.py", line 112, in get_sharded
[rank1]: filename, tensor_name = self.get_filename(tensor_name)
[rank1]: File "/opt/conda/lib/python3.10/site-packages/text_generation_server/utils/weights.py", line 63, in get_filename
[rank1]: raise RuntimeError(f"weight {tensor_name} does not exist")
[rank1]: RuntimeError: weight model.layers.0.self_attn.q_proj.weight does not exist
from text-generation-inference.
Have you tried adding
"attention_bias": false
to the config.json?
I used a local volume to save the model and altered the config as described. It works (tested with image ghcr.io/huggingface/text-generation-inference:2.0.3).
Can confirm that this works. There's currently an open PR on HF to fix the issue. In the meantime, you can run the model by directly specifying the revision. Here's my full command:
docker run --gpus all --shm-size 2g -p 8080:80 \
-v $PWD/data:/data ghcr.io/huggingface/text-generation-inference:2.0 \
--model-id microsoft/Phi-3-mini-128k-instruct \
--revision refs/pr/68 \
--trust-remote-code \
-p 8080 \
--hostname 0.0.0.0
from text-generation-inference.
I'm still getting the same issue as @amihalik, even with the attention bias fixed:
RuntimeError: weight model.layers.0.self_attn.q_proj.weight does not exist
Not sure what causes it, I'm using pretty much the exact same docker commands.
from text-generation-inference.
Still fails for me with TGI 2.0, trust remote code, attention_bias false.
RuntimeError: weight model.layers.0.self_attn.q_proj.weight does not exist
from text-generation-inference.
It is the same for us. tells me
The argument 'trust_remote_code' is to be used with Auto classes. It has no effect here and is ignored.
from text-generation-inference.
Related Issues (20)
- Can I run text-generation-interface "offline" HOT 1
- Guide/support for quantization + MLPSpeculator HOT 2
- ROCm: Server error: transport error when running batch size >=2 (Falcon-11B) HOT 1
- ROCm: Support models with head_dim>128
- ROCm: mismatch in generation for gpt2
- Poor/inconsistent results from Phi-3-mini-128k HOT 1
- idefics2: Sizes of tensors must match except in dimension 0. Expected size 448 but got size 447 for tensor number 2 in the list. HOT 2
- Some typo error in the picture of flash_attention.md HOT 1
- Unable to run TGI following the instructions on the readme HOT 5
- docker-compose throws `flash attention is not installed` error HOT 3
- Phi-3-mini-128k crashes on simple query HOT 2
- Add Environment Variable for OTLP Service Name HOT 2
- ImportError: libcuda.so.1: cannot open shared object file: No such file or directory HOT 10
- Tree-attention for medusa HOT 2
- get stucked when run text-generation-benchmark on AMD gpu
- Unable to load Qwen2-72B-Instruct-exl2 model HOT 2
- `mistralai/Mixtral-8x22B-Instruct-v0.1`: Getting `RuntimeError: 'ptxas' failed with error code 127` while warming up on 8 GPUs
- `mistralai/Mixtral-8x22B-Instruct-v0.1`: Successful warmup, crashes on inference HOT 1
- Long install report HOT 1
- P40 with USE_FLASH_ATTENTION=False
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from text-generation-inference.