Commit c905a04
Fix deprecated torch_dtype usage in transformers loading (vllm-project#2109)
While running `llmcompressor`, I saw the following warning:
```
"`torch_dtype` is deprecated! Use `dtype` instead!"
```
This PR replaces the deprecated `torch_dtype` parameter with `dtype` in
`transformers.from_pretrained()` calls.
Since support for the `dtype` argument was introduced in `transformers`
**v4.56.1**, this change also bumps the minimum supported `transformers`
version accordingly.
Transformers ≥4.56.1 requires Python ≥3.9; however, `llmcompressor`
already requires Python ≥3.10, so this change does **not** reduce Python
compatibility for existing users.
The goal of this PR is to eliminate the deprecation warning and align
with current `transformers` APIs.
Related discussion:
[https://github.com/vllm-project/vllm/issues/26293](https://github.com/vllm-project/vllm/issues/26293)
Signed-off-by: Jose Angel Morena <jmorenas@redhat.com>
Co-authored-by: Brian Dellabetta <brian-dellabetta@users.noreply.github.com>
Co-authored-by: Dipika Sikka <dipikasikka1@gmail.com>1 parent 363e1f8 commit c905a04
File tree
101 files changed
+164
-161
lines changed- docs/scripts
- examples
- autoround
- awq
- big_models_with_sequential_onloading
- compressed_inference
- multimodal_audio
- multimodal_vision
- quantization_2of4_sparse_w4a16
- quantization_kv_cache
- quantization_non_uniform
- quantization_w4a16_fp4
- quantization_w4a16
- quantization_w4a4_fp4
- quantization_w8a8_fp8
- quantization_w8a8_int8
- quantizing_moe
- sparse_2of4_quantization_fp8
- transform
- experimental
- attention
- mxfp4
- src/llmcompressor
- entrypoints
- model_free
- modeling
- modifiers
- pruning
- sparsegpt
- utils/pytorch
- wanda
- quantization/gptq
- recipe
- transformers
- tracing
- utils
- utils
- tests
- e2e
- llmcompressor
- modeling
- modifiers
- quantization
- transform
- utils
- pipelines
- transformers
- compression
- sparsegpt
- utils
- tools
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
101 files changed
+164
-161
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
| 48 | + | |
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
94 | | - | |
| 94 | + | |
95 | 95 | | |
96 | 96 | | |
97 | | - | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
98 | 101 | | |
99 | 102 | | |
100 | 103 | | |
| |||
106 | 109 | | |
107 | 110 | | |
108 | 111 | | |
109 | | - | |
| 112 | + | |
110 | 113 | | |
111 | 114 | | |
112 | 115 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
| 43 | + | |
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
| 34 | + | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
| 54 | + | |
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| |||
0 commit comments