Skip to content

Commit 28a94e6

Browse files
committed
[wip] flux eval
Summary: Test Plan: Reviewers: Subscribers: Tasks: Tags: ghstack-source-id: 70a7b71 ghstack-comment-id: 3667066648 Pull-Request: #3502
1 parent 23a58c0 commit 28a94e6

File tree

5 files changed

+590
-30
lines changed

5 files changed

+590
-30
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,3 +381,4 @@ torchao/experimental/deps
381381

382382
# local claude code files
383383
CLAUDE.local.md
384+
.claude

benchmarks/quantization/create_quantized_model.py

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -9,36 +9,7 @@
99

1010
import torch
1111
from transformers import AutoModelForCausalLM, AutoTokenizer, TorchAoConfig
12-
13-
from torchao.quantization import (
14-
Float8DynamicActivationFloat8WeightConfig,
15-
Float8DynamicActivationInt4WeightConfig,
16-
Int4WeightOnlyConfig,
17-
Int8DynamicActivationInt8WeightConfig,
18-
Int8WeightOnlyConfig,
19-
PerRow,
20-
)
21-
22-
23-
def string_to_config(s):
24-
if s == "None":
25-
return None
26-
elif s == "float8_rowwise":
27-
return Float8DynamicActivationFloat8WeightConfig(granularity=PerRow())
28-
elif s == "int4_groupwise_weight_float8_rowwise_activation":
29-
return Float8DynamicActivationInt4WeightConfig()
30-
elif s == "int4_groupwise_hqq_weight_only":
31-
return Int4WeightOnlyConfig(
32-
group_size=32,
33-
int4_packing_format="tile_packed_to_4d",
34-
int4_choose_qparams_algorithm="hqq",
35-
)
36-
elif s == "int8_rowwise_weight_only":
37-
return Int8WeightOnlyConfig()
38-
elif s == "int8_rowwise":
39-
return Int8DynamicActivationInt8WeightConfig()
40-
else:
41-
raise AssertionError(f"unsupported {s}")
12+
from utils import string_to_config
4213

4314

4415
def quantize_model_and_save(model_id, quant_config, output_dir):

0 commit comments

Comments
 (0)