Skip to content

Commit b928cc7

Browse files
committed
Update on "Use llm_config instead of args in export_llama functions"
Differential Revision: [D75484927](https://our.internmc.facebook.com/intern/diff/D75484927) [ghstack-poisoned]
2 parents 97ec69c + a1057a0 commit b928cc7

File tree

2 files changed

+4
-14
lines changed

2 files changed

+4
-14
lines changed

examples/models/llama/config/llm_config.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,11 +162,11 @@ class QuantizationConfig:
162162
pt2e_quantize: Optional[Pt2eQuantize] = None
163163
group_size: Optional[int] = None
164164
use_spin_quant: Optional[SpinQuant] = None
165-
use_qat: Optional[bool] = None
165+
use_qat: bool = False
166166
calibration_tasks: Optional[List[str]] = None
167167
calibration_limit: Optional[int] = None
168168
calibration_seq_length: Optional[int] = None
169-
calibration_data: Optional[str] = None
169+
calibration_data: str = "Once upon a time"
170170

171171
def __post_init__(self):
172172
if self.qmode:
@@ -243,7 +243,7 @@ class QNNConfig:
243243

244244
@dataclass
245245
class MPSConfig:
246-
enabled: Optional[bool] = False
246+
enabled: bool = False
247247

248248

249249
@dataclass

examples/models/llama/tests/test_export_llama_lib.py

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,7 @@
88

99
from executorch.devtools.backend_debug import get_delegation_info
1010
from executorch.examples.models.llama.config.llm_config import LlmConfig
11-
from executorch.examples.models.llama.export_llama_lib import (
12-
_export_llama,
13-
build_args_parser,
14-
)
11+
from executorch.examples.models.llama.export_llama_lib import _export_llama
1512

1613
UNWANTED_OPS = [
1714
"aten_permute_copy_default",
@@ -41,13 +38,6 @@ def test_has_expected_ops_and_op_counts(self):
4138
llm_config.model.use_kv_cache = True
4239
llm_config.debug.verbose = True
4340

44-
# We still need args for backward compatibility during transition
45-
parser = build_args_parser()
46-
args = parser.parse_args([])
47-
args.use_sdpa_with_kv_cache = True
48-
args.use_kv_cache = True
49-
args.verbose = True
50-
5141
builder = _export_llama(llm_config)
5242
graph_module = builder.edge_manager.exported_program().graph_module
5343
delegation_info = get_delegation_info(graph_module)

0 commit comments

Comments
 (0)