Skip to content

Commit 3ef8b7a

Browse files
committed
start on initialize
Signed-off-by: Kyle Sayers <[email protected]>
1 parent ff14533 commit 3ef8b7a

File tree

2 files changed

+7
-13
lines changed

2 files changed

+7
-13
lines changed

src/llmcompressor/modifiers/modifier.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,12 @@ def initialize(self, state: State, **kwargs):
8989

9090
self.initialized_ = self.on_initialize(state=state, **kwargs)
9191

92+
# trigger start
93+
fake_start_event = Event(type_=EventType.BATCH_START, global_step=0)
94+
if self.should_start(fake_start_event):
95+
self.on_start(state, fake_start_event, **kwargs)
96+
self.started_ = True
97+
9298
def finalize(self, state: State, **kwargs):
9399
"""
94100
Finalize the modifier for the given model and state.

tests/llmcompressor/transformers/compression/recipes/sparse_24_fp8.yaml

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,4 @@ quant_stage:
2323
strategy: token
2424
dynamic: true
2525
symmetric: true
26-
targets: ["Linear"]
27-
pruning_modifiers:
28-
ConstantPruningModifier:
29-
targets: [
30-
're:.*q_proj.weight',
31-
're:.*k_proj.weight',
32-
're:.*v_proj.weight',
33-
're:.*o_proj.weight',
34-
're:.*gate_proj.weight',
35-
're:.*up_proj.weight',
36-
're:.*down_proj.weight',
37-
]
38-
start: 0
26+
targets: ["Linear"]

0 commit comments

Comments
 (0)