pytorch / torchchat

Run PyTorch LLMs locally on servers, desktop and mobile
BSD 3-Clause "New" or "Revised" License
3.4k stars 224 forks source link

Bug fix: Enable fast to override quantize json #1377

Closed Jack-Khuu closed 6 days ago

Jack-Khuu commented 1 week ago

Follow up fix for: https://github.com/pytorch/torchchat/commit/46977645de6e9e29e58fada7d600c1930ed6f67b

We want to allow "fast" to work as a manual overwrite of a --quantize accelerator config, which the previous PR disabled while fixing a different bug


No overwrite

python3 torchchat.py generate llama3.1 --quantize '{"precision": {"dtype":"float16"}, "executor":{"accelerator":"mps"}}'

NumExpr defaulting to 10 threads.
PyTorch version 2.6.0.dev20241002 available.
lm_eval is not installed, GPTQ may not be usable
Using device=mps

Overwrite with device arg

python3 torchchat.py generate llama3.1 --quantize '{"precision": {"dtype":"float16"}, "executor":{"accelerator":"mps"}}' --device cpu

overriding json-specified device mps with cli device cpu
NumExpr defaulting to 10 threads.
PyTorch version 2.6.0.dev20241002 available.
lm_eval is not installed, GPTQ may not be usable
Using device=cpu Apple M1 Max

Overwrite with fast arg

python3 torchchat.py generate llama3.1 --quantize '{"precision": {"dtype":"float16"}, "executor":{"accelerator":"cpu"}}' --device fast

overriding json-specified device cpu with cli device mps
NumExpr defaulting to 10 threads.
PyTorch version 2.6.0.dev20241002 available.
lm_eval is not installed, GPTQ may not be usable
Using device=mps

Run with fast arg (same as running without device arg)

python3 torchchat.py generate llama3.1 --device fast

NumExpr defaulting to 10 threads.
PyTorch version 2.6.0.dev20241002 available.
lm_eval is not installed, GPTQ may not be usable
Using device=mps
pytorch-bot[bot] commented 1 week ago

:link: Helpful Links

:test_tube: See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/torchchat/1377

Note: Links to docs will display an error until the docs builds have been completed.

:heavy_exclamation_mark: 1 Active SEVs

There are 1 currently active SEVs. If your PR is affected, please view them below:

:white_check_mark: No Failures

As of commit 8db4b728279a1acbbbd0e10d0dc8b0f7f22ed411 with merge base 46977645de6e9e29e58fada7d600c1930ed6f67b (image): :green_heart: Looks good so far! There are no failures yet. :green_heart:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

Jack-Khuu commented 1 week ago

cc: @mikekgfb