Skip to content

SUPPORT: Pruning support for gpt-oss-20b model #7

@sandeshrajbhandari

Description

@sandeshrajbhandari

Was there any planned support for openai/gpt-oss-20b model? I've tried a few things, but it seems the codebase isn't configured to handle the model yet.

Tried to enable pruning for gpt-oss-20b model using the following in MODEL_ATTRS in model_utils.py.

"GptOssForCausalLM": {
        "moe_block": "mlp",
        "gate_proj": "gate_up_proj",
        "up_proj": "gate_up_proj",
        "down_proj": "down_proj",
        "experts": "experts",
        "fused": True,
        "router": "router",
        "num_experts": "num_local_experts",
        "num_experts_per_tok": "num_experts_per_tok",
    },

and for observer.py

@dataclass
class GptOssMoEObserverHookConfig(MoETransformerObserverConfig):
    module_class_name_to_hook_regex: Optional[str] = r"GptOssMLP"
    num_experts_attr_name: str = "config.num_local_experts"
    top_k_attr_name: str = "config.num_experts_per_tok" 
    fused_experts: bool = True

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions