Skip to content

Commit 4888f34

Browse files
authored
Unpin to support transformers==4.52.3 (#1479)
## Purpose ## * Support the latest transformers release ## Prerequisites ## * #1481 * #1411 ## Fixes ## * #1457 ## Changes ## * Unpin transformers version * Add `torchvision`, `librosa`, and `soundfile` to dev dependencies (needed to test models) * Fix default ignore list for tracing debugger * Add back llama4 model tests --------- Signed-off-by: Kyle Sayers <kylesayrs@gmail.com>
1 parent 7141a28 commit 4888f34

File tree

3 files changed

+21
-19
lines changed

3 files changed

+21
-19
lines changed

setup.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,7 @@ def localversion_func(version: ScmVersion) -> str:
116116
"requests>=2.0.0",
117117
"tqdm>=4.0.0",
118118
"torch>=1.7.0",
119-
# TODO (#1457) revert to "transformers>4.0,<5.0" after tests pass
120-
"transformers>4.0,<4.52.0",
119+
"transformers>4.0,<5.0",
121120
"datasets",
122121
"accelerate>=0.20.3,!=1.1.0",
123122
"pynvml",
@@ -136,11 +135,14 @@ def localversion_func(version: ScmVersion) -> str:
136135
"pytest-rerunfailures>=13.0",
137136
"parameterized",
138137
"lm_eval==0.4.5",
139-
# example test dependencies
138+
# test dependencies
140139
"beautifulsoup4~=4.12.3",
141140
"cmarkgfm~=2024.1.14",
142141
"trl>=0.10.1",
143142
"pandas",
143+
"torchvision",
144+
"librosa",
145+
"soundfile",
144146
# linting, formatting, and type checking
145147
"black~=24.4.2",
146148
"isort~=5.13.2",

src/llmcompressor/transformers/tracing/debug.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def parse_args():
2323
parser.add_argument("--model_id", type=str, required=True, help="The stub of the model to load") # noqa: E501
2424
parser.add_argument("--model_class", type=str, required=True, help="The class name of the model") # noqa: E501
2525
parser.add_argument("--sequential_targets", type=str, nargs="*", default=None, metavar="TARGET", help="List of targets for sequential tracing") # noqa: E501
26-
parser.add_argument("--ignore", type=str, nargs="*", default=[], metavar="PATTERN", help="List of patterns to ignore during tracing") # noqa: E501
26+
parser.add_argument("--ignore", type=str, nargs="*", default=["_update_causal_mask"], metavar="PATTERN", help="List of patterns to ignore during tracing") # noqa: E501
2727
parser.add_argument("--modality", type=str, default="text", help="Modality of calibration dataset, defaults to text") # noqa: E501
2828
parser.add_argument("--trust_remote_code", type=bool, default=False, help="Whether to trust model remote code") # noqa: E501
2929
parser.add_argument("--skip_weights", type=bool, default=True, help="Whether to load the model with dummy weights") # noqa: E501

tests/llmcompressor/transformers/tracing/test_models.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
AutoModelForCausalLM,
44
Gemma3ForConditionalGeneration,
55
Idefics3ForConditionalGeneration,
6+
Llama4ForConditionalGeneration,
67
LlavaForConditionalGeneration,
78
MllamaForConditionalGeneration,
89
Qwen2_5_VLForConditionalGeneration,
@@ -86,21 +87,20 @@
8687
"vision",
8788
[],
8889
),
89-
# TODO: add back once transformers is bumped
90-
# (
91-
# "meta-llama/Llama-4-Scout-17B-16E-Instruct",
92-
# Llama4ForConditionalGeneration,
93-
# "Llama4TextDecoderLayer",
94-
# "vision",
95-
# [],
96-
# ),
97-
# (
98-
# "meta-llama/Llama-4-Maverick-17B-128E-Instruct",
99-
# Llama4ForConditionalGeneration,
100-
# "Llama4TextDecoderLayer",
101-
# "vision",
102-
# [],
103-
# ),
90+
(
91+
"meta-llama/Llama-4-Scout-17B-16E-Instruct",
92+
Llama4ForConditionalGeneration,
93+
"Llama4TextDecoderLayer",
94+
"vision",
95+
[],
96+
),
97+
(
98+
"meta-llama/Llama-4-Maverick-17B-128E-Instruct",
99+
Llama4ForConditionalGeneration,
100+
"Llama4TextDecoderLayer",
101+
"vision",
102+
[],
103+
),
104104
# --- audio ---
105105
(
106106
"openai/whisper-large-v3",

0 commit comments

Comments
 (0)