Skip to content

default NPI file added #498

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions QEfficient/base/modeling_qeff.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,18 @@ def _compile(
if mdp_ts_json_path := compiler_options.pop("mdp_load_partition_config", None):
command.append(f"-mdp-load-partition-config={mdp_ts_json_path}")

# Default node precision file added for Gemma3:AI-100
if hasattr(self, "model"):
config = getattr(self.model, "config", None)
if config is None and hasattr(self.model, "model"):
config = getattr(self.model.model, "config", None)
if (
config
and hasattr(config, "architectures")
and "Gemma3ForConditionalGeneration" in config.architectures
):
compiler_options["node_precision_info"] = constants.DEFAULT_GEMMA3_NODE_PRECISION_INFO

for key, value in compiler_options.items():
option = "-" + key.replace("_", "-")
if isinstance(value, bool):
Expand Down
1 change: 1 addition & 0 deletions QEfficient/utils/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ def get_models_dir():

# Gemma3 Constant
GEMMA3_MAX_POSITION_EMBEDDINGS = 32768
DEFAULT_GEMMA3_NODE_PRECISION_INFO = "examples/gemma3_example/fp32_mm.yaml"


class Constants:
Expand Down
2 changes: 0 additions & 2 deletions examples/gemma3_example/gemma3_mm.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
aic_enable_depth_first=True,
skip_vision=True,
mos=1,
node_precision_info="examples/gemma3_example/fp32_mm.yaml",
)

messages = [
Expand Down Expand Up @@ -77,7 +76,6 @@
mxint8_kv_cache=False,
aic_enable_depth_first=True,
mos=1,
node_precision_info="examples/gemma3_example/fp32_mm.yaml",
)

### IMAGE + TEXT ###
Expand Down
Loading