-
You must be signed in to change notification settings -
refine inference step 2 #498
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
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
ffe91c7
support reminding better backend
wenhuach21 bbbcccb
support 3bits on cuda
wenhuach21 5b05565
fix 3bits asym
wenhuach21 cf2057c
tiny change
wenhuach21 daf45c7
support loading gptq/awq to autoround format
wenhuach21 8130667
Update auto_round/autoround.py
wenhuach21 728c2c3
tiny change
wenhuach21 9313c44
Merge branch 'refine_inference' of https://github.com/intel/auto-roun…
wenhuach21 d2f7087
fix typo
wenhuach21 db673ad
add more info
wenhuach21 ad361f8
fix typo
wenhuach21 1f5542e
fix typo
wenhuach21 50ba0a2
fix some issues
wenhuach21 760f841
fix ut
wenhuach21 File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -73,7 +73,7 @@ pip install auto-round-lib | |
|
||
## Model Quantization | ||
|
||
### Basic Usage (Gaudi2/CPU/GPU) | ||
### Basic Usage (Gaudi2/CPU/XPU/GPU) | ||
|
||
A user guide detailing the full list of supported arguments is provided by calling ```auto-round -h``` on the terminal. | ||
Set the format you want in `format` and | ||
|
@@ -268,7 +268,7 @@ autoround.save_quantized(output_dir, format='auto_round', inplace=True) | |
|
||
### Export Formats | ||
**AutoRound Format**: This format is well-suited for CPU, HPU devices, 2 bits, as well as mixed-precision | ||
inference. **[2,4] bits are supported**. However, it has not yet gained widespread community adoption. | ||
inference. **[2,3,4,8] bits are supported**. However, it has not yet gained widespread community adoption. | ||
|
||
**AutoGPTQ Format**: This format is well-suited for symmetric quantization on CUDA devices and is widely adopted by the | ||
community, **[2,3,4,8] bits are supported**. However, **the | ||
|
@@ -324,14 +324,9 @@ in [Gaudi Guide](https://docs.habana.ai/en/latest/). | |
from transformers import AutoModelForCausalLM, AutoTokenizer | ||
from auto_round import AutoRoundConfig | ||
|
||
backend = "auto" ##cpu, hpu, cuda | ||
quantization_config = AutoRoundConfig( | ||
backend=backend | ||
) | ||
quantized_model_path = "./tmp_autoround" | ||
model = AutoModelForCausalLM.from_pretrained(quantized_model_path, | ||
device_map=backend.split(':')[0], | ||
quantization_config=quantization_config) | ||
device_map="auto") | ||
tokenizer = AutoTokenizer.from_pretrained(quantized_model_path) | ||
text = "There is a girl who likes adventure," | ||
inputs = tokenizer(text, return_tensors="pt").to(model.device) | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.